Skip to content
All library documents

Annualizing Sharpe Ratios with Log and Compounded Returns

Article Quant Q&A · Author: Wildman

Summary

The document compares approaches to annualizing a Sharpe ratio for an equity index using daily data and a risk-free benchmark. It outlines a log-return calculation that annualizes mean log return and volatility, with the risk-free rate adjusted to an annual basis. A second approach compounds simple returns geometrically to obtain an annual return, while scaling daily volatility by the square root of the number of trading days.

A further example uses an annualized-return function and compares its result with calculations based on log returns. The differing reported values illustrate that Sharpe estimates depend on return conventions and the treatment of the risk-free rate. The examples use particular data, dates, and benchmark assumptions; they do not establish one universal convention or resolve all methodological choices. Care is needed to keep return and risk-free-rate units consistent.

Key ideas

  • Daily excess return is computed by subtracting a daily risk-free rate from the asset return.
  • One log-return approach annualizes average log return and scales volatility by the square root of trading days.
  • A geometric approach compounds simple returns to estimate an annual return before subtracting the risk-free rate.
  • Different return conventions and annualization methods can produce different Sharpe estimates.
  • Risk-free rates and returns must be expressed on compatible time scales.

Tags

Full text
# Annualized Sharpe Ratio calculation


# Annualized Sharpe Ratio calculation












I'm trying to replicate the annualized Sharpe ratio of an buy-and-hold strategy for the Dow Jones Industrial Average index for a period consisting of multiple years. I got the daily DJIA (closing) price index (variable: "price") and the risk-free rate (given in a year percentage, variable: "rf").

The procedure I follow:

- Compute daily log returns, by: `log_returns = log(1+(price(t)/price(t-1)-1))`

- Compute daily log risk-free rates, by: `log_rf = log(1+(rf/100))/252`

- Compute daily excess returns, by: `excess_returns = log_returns-log_rf`

- Compute daily Sharpe ratio, by: `daily_sharpe = mean(excess_returns)/std(excess_returns)`

- Compute annualized Sharpe ratio, by: `annualized_sharpe = sqrt(252)*daily_sharpe`

However the annualized Sharpe ratio doesn't correspond to the reported numbers. Am I missing a step/doing something wrong (with the logs?)?

Edit:

The calculation used by the paper (Bajgrowicz & Scaillet, December 2012):

## Answer by Sergey Bushmanov (score 3)

https://quant.stackexchange.com/a/21214

This is how people usually approach calculating SR with logreturns:

```
library(quantmod)
getSymbols('DJIA', src='yahoo', from = '2009-01-01')
price <- Cl(DJIA)
log_ret <- log(price/lag(price,1))
mean_log_ret <- mean(log_ret, na.rm=T)
sd_log_ret <- sd(log_ret, na.rm=T)
rf <- 0.0025 # benchmark
SR <- (252 * mean_log_ret - log(1+rf))/(sd_log_ret*sqrt(252))
SR

[1] 0.5565204
```

UPDATE. SR with geometrically compounding returns:

```
g_ret <- (price/lag(price,1) - 1)[-1]
n_periods <- length(g_ret)
avg_g_ret <- prod(1 + coredata(g_ret)) ^ (1/n_periods)
annual_g_return <- avg_g_ret^252 - 1
annual_sd_g_return <- sd(g_ret) * sqrt(252)
SR <- (annual_g_return - rf)/annual_sd_g_return
SR

[1] 0.5844989
```

## Answer by tdazio (score 2)

https://quant.stackexchange.com/a/21219

Another way to skin cat:

```
    # risk-free = 0
require(quantmod)
require( PerformanceAnalytics)
getSymbols('DJIA', src='yahoo', from = '2009-01-01', to ='2014-12-31')
price       <- Cl(DJIA)
simple.ret  <- price/lag(price)-1
table.AnnualizedReturns(simple.ret,Rf=0)[3,]
# [1] 0.7267

log.ret <- na.omit(ROC(price))
SD <- sd(log.ret)*sqrt(252)
R <- exp(mean(log.ret)*252)-1
SR <- R/SD
SR 
# [1] 0.7263711
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.