# Is the sharpe ratio calculated taking the standard deviation of the portfolio or of the excess return?

Does the formula consider the standard deviation of the excess return: $$\frac{πβπ_π}{π{(πβπ_π)}}$$ or that of the return: $$\frac{πβπ_π}{π{(π)}}$$

The first equation, using the excess return in both numerator and denominator is more theoretically correct. Importantly it generalizes to any two returns, not just $$r$$ vs $$r_f$$ but $$r_1$$ vs $$r_2$$ for any two returns.
However in the common case where $$r_f$$ is the short term risk free rate, its movements over time are so small that it makes little difference to the value. And therefore in practice many people use the second form that you quoted, with the denominator being the standard deviation $$\sigma(r)$$ of the fund alone. This is so common that it is a de facto standard in the industry.
• Why is $r_f$ assumed constant? True, in many simplified scenarios it's just taken to be const, but it's not necessarily so both in theory and in practice.
• As other user said, the short term movements of $r_f$ are so small that makes little to no difference, this is the common practice. Anyway, you can get either model rf as a short-rate model or take it from the market (in backtesting) -> $r_{f,t}$ Feb 4 '19 at 18:32