You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
log_returns=True compounds log returns as simple returns in mean_historical_return / ema_historical_return / capm_return #784
When log_returns=True (and the default compounding=True), the expected-return estimators annualise log returns with (1 + r).prod() ** (frequency / n) - 1. That formula is for simple returns. Log returns add up over time, so the annual figure should be exp(mean(r) * frequency) - 1.
The result is a large downward bias that grows with volatility, and it flows straight into the optimiser.
Both should be the same CAGR, since they come from the same prices. On this data, the gap is 9.6 pp on average and up to 22.8 pp, and max_sharpe weights change (AAPL, AMZN, BBY, SBUX drop out).
ema_historical_return and capm_return (the market return) use the same (1 + r) step. test_log_return_passthrough only checks that the two outputs differ, so this wasn't caught.
Activity