Metrics methodology: how Portfolio Lab measures return and risk
This metrics methodology shows how each figure in the Portfolio Lab overview is calculated: with its formula, its annualization and the risk-free rate used. The basis is always the time-weighted period returns from the backtest, i.e. monthly or daily returns after all costs and without the effect of inflows and outflows.
Basics: frequency and risk-free rate
The app recognizes the frequency of a return series from the typical spacing of the data: below four days, 252 periods per year apply; below ten days, 52; otherwise 12. This number n is used for annualization: means are multiplied by n, standard deviations by √n.
The risk-free rate is either a fixed rate p.a. (default 2%) converted to the period, or the time-varying money market rate of the selected currency: in US dollars, the yield on three-month Treasury bills; in euros, €STR, before that EONIA, and before that the overnight rate in Frankfurt. The daily rates are used to build a cash account that accrues interest every calendar day at the previous day's rate (act/360). The risk-free return for a period is the growth of this account between two data points. Before the rate data begin, the fixed rate serves as a substitute; the last published rate is carried forward for at most 45 days.
Return
CAGR = (Π (1 + r_t))^(1 / Y) − 1, Y = (last − first date) / 365.25 + 1 / n- r_t
- period return
- Y
- years covered; the first period counts as well, hence + 1/n
- Total return: Π (1 + r_t) − 1.
- Best and worst year: only full calendar years with all twelve months.
- Trailing returns: return over the last 3 months, year to date, 1, 3, 5 and 10 years; annualized from one year upwards. If the history is too short for a window, the field stays empty.
- CAGR (real): from real period returns (1 + r_t) / (1 + inflation_t) − 1, using the price index of the region set.
- Risk-free rate p.a.: geometric average of the risk-free return over the period.
Risk
- Volatility p.a.: standard deviation of the period returns (sample, divisor T − 1) × √n.
- Maximum drawdown: the largest decline of the value index Π (1 + r) from a peak; the starting value counts as the first peak. The drawdown table shows peak, trough and recovery; with monthly data, in whole calendar months.
- VaR 95% (period): historical, the 5% quantile of the period returns with the sign reversed (linear interpolation between two observations). With 120 months, it lies between the sixth- and seventh-worst return.
- CVaR 95% (period): the average of all returns up to the VaR. This is the expected shortfall, which, unlike the VaR, is coherent (Artzner et al. 1999).
- Skewness and kurtosis: sample estimators with correction; kurtosis is given as excess kurtosis (normal distribution = 0).
- Share of positive periods, best and worst period, gain/loss ratio: the last of these is the average gain of positive periods divided by the average loss of negative ones.
Risk-adjusted metrics
All of the following metrics work with excess returns per period e_t = r_t − rf_t, in the way Sharpe (1994) defines the Sharpe ratio. Definitions of the less well-known measures follow the handbook by Bacon (2008).
| Metric | Formula in Portfolio Lab |
|---|---|
| Sharpe ratio | mean(e) / SD(e) × √n |
| Sortino ratio | mean(e) × n / (√mean(min(e, 0)²) × √n) |
| Calmar ratio | CAGR / |max. drawdown| over the whole period |
| Treynor ratio | mean(e) × n / beta |
| M² (Modigliani) | (mean(e) / SD(e) × SD(e_benchmark) + mean(rf)) × n |
For the Sortino ratio, the minimum acceptable return is the risk-free rate; the denominator includes all periods, with the positive ones counted as zero (Sortino and Price 1994). The Calmar ratio here refers to the entire period, not, as in the original, to the last 36 months. M² rescales the Sharpe ratio to the volatility of the benchmark (Modigliani and Modigliani 1997); the numerator and denominator of the Sharpe ratio are again excess returns, as above.
Relative to the benchmark
If a benchmark is selected, the app also calculates the following over the common periods (at least six):
- Beta: the covariance of the excess returns e of portfolio and benchmark divided by the variance of the benchmark's excess returns (sample), i.e. the slope of the regression e_portfolio = alpha + beta × e_benchmark.
- Alpha p.a.: (mean(e_portfolio) − beta × mean(e_benchmark)) × n, i.e. Jensen's alpha after Jensen (1968), annualized arithmetically.
- Correlation and R²: the Pearson correlation of the period returns; R² is the coefficient of determination of the same regression as beta and alpha (the square of the correlation of the excess returns). With a fixed rate, both correlations are the same.
- Tracking error: standard deviation of the difference returns × √n; information ratio: mean of the difference returns × n / tracking error.
- Upside and downside capture: the geometric mean of the portfolio returns in periods with a rising (or falling) benchmark, divided by the geometric mean of the benchmark in those periods.
Safe and perpetual withdrawal rate
The safe withdrawal rate is the highest annual rate, as a share of the starting value, that does not exhaust the wealth by the end of the period when one twelfth of it is withdrawn at the end of each month and the amount rises with inflation. The perpetual withdrawal rate additionally requires at least the real starting value to be left at the end. The app finds both by bisection between 0 and 100% (50 steps). Without inflation data, it calculates in nominal terms. More in the article withdrawal rate.
Limitations of the metrics
- Monthly or daily: the same investment usually has a slightly different volatility with daily data than with monthly data; only compare metrics of the same frequency.
- Annualized arithmetically: alpha, Treynor, Sortino and M² scale the period mean up by n, whereas the CAGR compounds. With high volatility, the two diverge (see volatility drag).
- Autocorrelation: the square-root rule assumes independent returns; with smoothed series, it overstates Sharpe ratios (Lo 2002).
- Historical: VaR and CVaR describe the past of the selected period, not future extremes.
Frequently asked questions
Why does the Sharpe ratio differ from (CAGR − rate) / volatility?
Because the app calculates with the mean of the excess returns per period, not with the geometric annual return, and the denominator is the volatility of the excess returns.
Which risk-free rate is used?
A fixed rate (default 2% p.a.) or, if chosen in the settings, the time-varying money market rate of the currency: in US dollars the Treasury bill yield, in euros €STR or, before that, EONIA.
How is the Calmar ratio calculated?
CAGR divided by the absolute value of the maximum drawdown, over the entire selected period.
Is the VaR parametric or historical?
Historical: the 5% quantile of the actual period returns, stated per month or per day.
How much data is needed for beta and alpha?
At least six common periods of portfolio and benchmark.
Literature
- Artzner, Philippe; Delbaen, Freddy; Eber, Jean‐Marc; Heath, David (1999): Coherent Measures of Risk. Mathematical Finance 9 (3), pp. 203–228. doi:10.1111/1467-9965.00068
- Bacon, Carl R. (2008): Practical Portfolio Performance Measurement and Attribution. Wiley, 2nd edition.
- Jensen, Michael C. (1968): The Performance of Mutual Funds in the Period 1945–1964. The Journal of Finance 23 (2), pp. 389–416. doi:10.1111/j.1540-6261.1968.tb00815.x
- Lo, Andrew W. (2002): The Statistics of Sharpe Ratios. Financial Analysts Journal 58 (4), pp. 36–52. doi:10.2469/faj.v58.n4.2453
- Modigliani, Franco; Modigliani, Leah (1997): Risk-Adjusted Performance. The Journal of Portfolio Management 23 (2), pp. 45–54. doi:10.3905/jpm.23.2.45
- Sharpe, William F. (1994): The Sharpe Ratio. The Journal of Portfolio Management 21 (1), pp. 49–58. doi:10.3905/jpm.1994.409501
- Sortino, Frank A.; Price, Lee N. (1994): Performance Measurement in a Downside Risk Framework. The Journal of Investing 3 (3), pp. 59–64. doi:10.3905/joi.3.3.59
This page describes how Portfolio Lab calculates; past results are not a forecast. All terms in the glossary.