apaSharpeRatio.Annualized.Lo(Returns, PeriodsPerYear, RiskfreeReturns, nLags)
=apaSharpeRatio.Annualized.Lo(Returns, PeriodsPerYear, RiskfreeReturns, nLags)Result
Returns the annualized Sharpe ratio of excess returns, adjusted for serial correlation.
Syntax
Returns: r x c matrix of returns. Each column represents a different time series.
PeriodsPerYear: number of return periods per year (whole number), e.g. 12 for monthly data
RiskfreeReturns: optional; single value, r x 1 vector (shared by all columns) or r x c matrix of riskfree returns per period; default: 0
nLags: optional; number of autocorrelation lags used, between 0 and PeriodsPerYear − 1; 0 gives SR·sqrt(PeriodsPerYear); default: PeriodsPerYear − 1
Algorithm
SR(q) = SR·q / sqrt(q + 2·Σ_{k=1..L} (q − k)·ρ_k) (Lo 2002), with q = PeriodsPerYear and L = nLags.
SR uses the sample standard deviation (denominator n − 1); ρ_k are the sample autocorrelations of the excess returns (sum of lagged cross-products divided by the sum of squared deviations).
Remarks
The result is a 1 x c row vector with one value per column of Returns.
Positive autocorrelation (e.g. smoothed or illiquid returns) lowers the annualized Sharpe ratio compared with SR·sqrt(q). #N/A is returned if the adjusted variance is not positive.
