# Sharpe Ratio - my own calculation differs from Yahoo finance, Morningstar

I am trying to compute the Sharpe ratio for my portfolio. To check that I am doing this correctly, I am first trying to compute it for SPY (the S&P 500 index).

S.R. = mean({SPY return j - risk-free return j})/std dev({SPY return j})


I am using annualized monthly returns that I compute from the SPY index itself. For the risk-free return, I am using the 10-year T-bill. Again, I am using monthly data, same as Yahoo! and Morningstar.

This is how I compute the annualized monthly return for month j:

temp = [ ( (value at month j) - (value at month j-1) ) ] / (value at month j-1)
return for month j = (1+temp)^12 - 1


For some reason, I get 0.61 for the Sharpe Ratio. Yahoo! and Morningstar report it to be about 1.3, again amortized monthly. What am I doing wrong? Here is some sample data:

        S&P price   T-bill price      S&P return   T-bill return
...
Jan-14  176.55      1165.31
Feb-14  184.59      1209.48           0.706417809  0.562739592
Mar-14  186.12      1212.98           0.104125623  0.035283725
Apr-14  187.41      1198.61           0.086417122  -0.133255532
May-14  191.76      1218.43           0.316991962  0.217509175
Jun-14  195.72      1230.87           0.277986402  0.129637856
...


For some reason the computation doesn't work out for me. Can anyone see what I am doing wrong?

-
Hi Laplacian, welcome to quant.SE! Thank you for your question. Can you possibly show some real code instead of pseudo-code? It will help people trying to answer your question. – Bob Jansen Jul 15 '14 at 5:41
Here is some code: – Laplacian Jul 17 '14 at 0:29
Hi Bob, I am actually using Excel to do this for now so there is no real code. I compute the return by doing =(1+(B3-B2)/B2)^12-1, where column B has the actual values for SPY by month (per my snippet above). To compute the market premium, I simply subtract the column of risk-free returns from SPY returns. Then I just divide the mean of the market premium by the std dev of SPY. – Laplacian Jul 17 '14 at 0:41

Your approach of computation is not very standard. Specifically, you do not need to compute the annualized monthly return. One can compute the annualized Sharpe ratio from return sampled at any frequency using the following Generalized formula:

$$Sharpe = \frac{E|R_p - R_{rf}|}{\sqrt{var(R_p - R_{rf})}} * \sqrt{N}$$ where $R_{rf}$ is the benchmark/ risk-free return, $R_p$ is the portfolio return, $N$ is the number of sampling periods in a year. The portfolio return and risk-free rate can be of any interval (daily, weekly, monthly, etc), as long as they are consistent with each other.

In your case, the risk-free rate is effectively 0 nowadays, and N is 12 assuming you are using monthly returns, and N is 252 if you are using daily returns.

Hope it helps.

-
I would argue that the inclusion of the risk free rate is a bit out-dated. I know of a number of hedge funds that do not include the risk free rate in their computations (albeit they mention it in the disclosure documents). There is no real risk-free rate, sovereign bills or bonds are anything but risk-free, including bills issued by the US Treasury. Imagine short rates were 20% then the Sharpe ratio with inclusion of Rf would be badly skewed. Sharpe is not a comparable risk measure but measures return relative to its own risk. – Matt Wolf Jul 15 '14 at 6:19
Hi Matt, I agree with you. Although theoretically I include the risk-free rate in the formula, we never include them in the actual computation. – Simon Jul 15 '14 at 6:23
Not saying that your answer is in any way deficient, just wanted to add that little bit of information. Cheers – Matt Wolf Jul 15 '14 at 6:24
Sure, understood. Cheers. – Simon Jul 15 '14 at 6:26
Thank you for the reply. When I compute the Sharpe ratio from non-annualized monthly returns, then just multiply by sqrt(12), I still get a wrong value: 2.04. I suppose that is closer, but still not quite right (should be 1.33). Any other ideas? Thank you. – Laplacian Jul 17 '14 at 0:45

To compute Sharpe Ratio the risk-free rate has to be proxied by something like the 1-month T-Bill yield. The 10-year Treasury Bond return is not a "risk-free" return.

-