Risk Analytics
The exact formulas behind Portfolio Lab’s risk figures — volatility, the Sharpe and Sortino ratios, drawdown, Ulcer and Calmar, empirical Value-at-Risk and Expected Shortfall — and how to read them without treating them as forecasts.
Overview
Every risk figure in Portfolio Lab is computed from one historical backtest — the specific holdings, weights, dates, and simulation frequency you chose (see Backtesting). They are descriptions of that past period. Risk Analytics does not run a Monte Carlo simulation, does not produce a probability of success, does not forecast future volatility, and does not optimize an allocation or build an efficient frontier. All figures are nominal (not inflation-adjusted).
The return series each metric uses
The calculator never divides consecutive account values — that would let a contribution look like a gain. It reads the engine’s own cash-flow-neutral per-period return (each period’s external contribution netted out first) and takes two views of it:
- Periodic returns — the homogeneous full-length periods only (the first partial “stub” period is excluded). Feeds volatility, downside deviation, Sharpe, Sortino, VaR, Expected Shortfall, and per-period loss frequency, because those statistics assume every observation covers a comparable span.
- The wealth index —
Wealth₀ = 1, then every canonical return (including the first partial period) chain-linked on. Feeds every drawdown figure, the annualized and cumulative return, Calmar, calendar-year returns, trailing returns, and the rolling 12-month windows.
Annualized volatility
Sample (n−1) standard deviation of the periodic returns, annualized by √252 for Daily, √52 for Weekly, √12 for Monthly. It is null (shown as “—”) with fewer than two periodic observations. This figure changes with the simulation frequency you pick — it is the dispersion of the returns at that frequency, not a single canonical number. It measures how spread out the historical returns were; it is not a probability of loss.
Canonical monthly volatility
A second volatility figure resamples the return series into one compounded return per complete calendar month and annualizes by √12 always, regardless of whether you ran the backtest Daily, Weekly, or Monthly — so the same portfolio over the same window reports the same number at any frequency. It is null until at least two complete calendar months exist. This is the volatility input the Portfolio Rating and comparison badges use, precisely so a rating doesn’t shift just because you changed the simulation frequency.
Sharpe ratio
null when the standard deviation is zero or there are fewer than two periodic observations.Sortino ratio
Same numerator as Sharpe; the denominator is downside deviation instead of full standard deviation, so only harmful volatility is penalized. Portfolio Lab shows Sortino above Sharpe because downside risk is what matters most in retirement. The minimum acceptable return is 0% and hard-coded.
Downside deviation
Note the denominator N is the full periodic-return count, not the number of losing periods. Every period contributes — zero for any period that met or beat 0% — so this is a target semi-deviation, deliberately not a standard deviation restricted to losers (a portfolio that loses exactly −5% every period has no dispersion among its losses but real downside risk, and this formula captures that).
Maximum drawdown
The largest peak-to-trough decline of the cash-flow-neutral wealth index over the backtest — a historical fact about the tested period, never a contribution-inflated nominal balance. A drawdown “period” runs from its prior peak date to its trough to its recovery date (the first date the index regains that peak). A drawdown open at the end of the backtest is left unrecovered.
Drawdown duration and recovery
- Max drawdown duration — the longest span in days from any peak to its recovery date, or to the last date of the backtest if that drawdown is still open (a flag marks it ongoing).
- Worst-drawdown recovery — the time, in years, for the largest-magnitude drawdown to recover. It is reported as unrecovered (not as “0”) when the index never regained that peak within the backtest.
- A separate summary shows the longest and average recovery time (in months) across closed drawdowns only — measured on the same cash-flow-neutral wealth index as everything above, so a contribution made during a downturn can never shorten a recovery or manufacture one.
PerformanceMetrics.RecoveryYears): it stores 0, rather than “unrecovered”, for a drawdown still open at the end of the backtest. The current Portfolio Lab results screen does not display that legacy field — the recovery figures you see come from the corrected wealth-index calculation described above — but the field is still present in the raw API response.Ulcer Index
The root-mean-square of the drawdown-from-peak series. Because it squares every below-peak point, it rewards portfolios that spent little time — and little depth — under water, and penalizes long, deep drawdowns more than a single brief dip. A larger value means the tested portfolio was in a worse drawdown state, more often. It is not a probability of loss.
Calmar ratio
Compounded annualized return over the backtest divided by the absolute value of the maximum drawdown — a return-per-unit-of-worst-loss figure. It is null when the maximum drawdown is exactly zero (no division defined). Unlike Sharpe/Sortino, the numerator here is a geometric (compounded) return, not the arithmetic periodic mean.
95% Historical Value at Risk
VaR95 = sorted[index] (a signed return, e.g. −6.2%)
This is an empirical historical percentile — the actual return at the 5th-percentile rank of the periodic returns that occurred in the backtest. No normal distribution is assumed. It is reported as a signed return, not as a positive “loss” number, and it is not annualized or scaled — it is a one-period figure at your chosen frequency. It requires at least 20 periodic observations; below that it is shown as unavailable with the reason. It is not a maximum possible loss — worse periods than the VaR cutoff did occur in the backtest, and can occur in the future.
95% Expected Shortfall (Conditional VaR)
The average of the periodic returns at or below the VaR cutoff — the average return during the worst ~5% of periods in this backtest. Same empirical basis, same signed convention, same 20-observation minimum, same one-period (not annualized) scale. At exactly 20 observations the tail is a single period, so Expected Shortfall equals VaR; it separates from VaR only as history lengthens. It describes how bad the observed tail was — not a guaranteed or expected future tail loss.
Benchmark-relative analytics
Benchmarks (VOO / QQQ / DIA by default) are run as ordinary backtest series and get their own full set of the metrics above, shown in the same comparison table. SmartRetireCalc does not compute beta, alpha, R², tracking error, information ratio, up/down capture ratios, or a portfolio-to-benchmark correlation for Portfolio Lab results. (Correlation and beta are used internally only to validate a Historical Proxy substitute — never surfaced as a portfolio risk figure.) Benchmark comparison here is side-by-side, not a regression.
Risk vs. Return chart
One point per portfolio and per benchmark: x = annualized volatility (the frequency-specific figure, not the canonical-monthly one), y = annualized return. A point is dropped if either value is null. It is a plain plot of observed historical risk against observed historical return for the tested window — there is no efficient frontier, no “optimal” region, and no optimizer. Two portfolios’ relative positions describe what happened, not what will happen.
Portfolio Rating, badges, and profile tags
The Portfolio Rating is an absolute 0–100 score (rendered as stars) — a weighted blend of four banded sub-scores:
| Dimension | Weight | Input (cash-flow-neutral) |
|---|---|---|
| Growth | 35% | Annualized return |
| Risk | 30% | Absolute maximum drawdown |
| Stability | 20% | Canonical monthly volatility |
| Income | 15% | Annualized dividend yield |
Each sub-score is a fixed-threshold lookup (Excellent / Strong / Moderate / Weak / Minimal) against long-run U.S. market ranges — for example a Growth band at 12% / 9% / 6% / 3% annualized return, a Risk band at 15% / 25% / 35% / 50% drawdown. If a dimension can’t be computed (e.g. canonical monthly volatility with under two complete months), the blend re-normalizes over the dimensions that are available and the result is marked not fully qualified. Stars: 5 at 85+, 4 at 70+, 3 at 55+, 2 at 40+, else 1.
Comparison badges — Highest Growth, Lowest Risk, Highest Income, and Recommended (“best balance”, from the Portfolio Rating) — are awarded relative to the other non-benchmark portfolios in the current comparison, to every portfolio tied for the winning value. Profile tags (Growth / Stable / High Risk / Income / Balanced) are percentile ranks (top 30% / bottom 30%) across the compared portfolios, benchmarks included.
Which metrics change with simulation frequency
Frequency-dependent
- Annualized volatility
- Downside deviation
- Sharpe ratio
- Sortino ratio
- 95% VaR and Expected Shortfall
- Loss frequency (by period)
- Best / worst single period
Frequency-stable
- Canonical monthly volatility (always √12)
- Annualized & cumulative return
- Calmar ratio
- Calendar-year returns, best / worst calendar year
- Trailing returns, rolling 12-month windows
- Portfolio Rating and comparison badges
The frequency-dependent metrics use the periodic-return series and a √(periods-per-year) annualization, so Daily, Weekly, and Monthly runs of the same portfolio give different numbers — they are not directly comparable across frequencies. Drawdown magnitude and duration can also shift slightly: a Daily wealth index can catch a short-lived trough a Monthly one steps over. Where a frequency-stable figure was needed for scoring, the canonical monthly series is used instead.
Incomplete portfolios and historical proxies
- Risk metrics are still computed and shown for an incomplete portfolio — it is only the rankings (rating pool, badges, profile tags) it is left out of.
- Proxy-filled history is treated identically to real history once spliced in — a completed proxy is a gap-free return series, so a proxy-using portfolio stays eligible for the rating and badges (the proxy period is disclosed in the results).
- A metric can still be
nullfor a complete portfolio when its own input is unavailable — most often canonical monthly volatility on a recently started portfolio, or the 95% tail figures on a portfolio with fewer than 20 periodic observations.
How to read these metrics
- Volatility = how dispersed the historical periodic returns were — not a probability of loss.
- Drawdown / Ulcer = how far and how persistently the tested portfolio fell from its own highs during that window.
- Sharpe / Sortino / Calmar = historical return-to-risk ratios under SmartRetireCalc’s assumptions (0% risk-free rate / MAR) — useful for comparing two portfolios over the same window and frequency, not as absolute grades.
- VaR / Expected Shortfall = summaries of the worst ~5% of periods that actually occurred in the backtest — not a floor on future losses.
What Risk Analytics does not tell you
- A probability that a plan succeeds — that is not computed here (or anywhere in Portfolio Lab).
- A forecast of future volatility, drawdown, or return.
- An optimal or efficient allocation — there is no optimizer and no efficient frontier.
- Anything about taxes, fees, or withdrawals — the backtest models none of them.
- A recommendation. The Rating and badges rank the tested history, not your suitability.
Known limitations
- Tail figures (VaR, Expected Shortfall) from short histories are unstable even above the 20-observation floor — at the floor, Expected Shortfall is a single data point.
- Sharpe and Sortino assume a 0% risk-free rate / MAR, which cannot be changed.
- Frequency-dependent metrics are not comparable across Daily / Weekly / Monthly runs.
- The legacy
PerformanceMetrics.RecoveryYearsfield returns 0 for an unrecovered final drawdown (known, unfixed) — not shown in the UI, but present in the raw API response.
Background
- Sortino & Price (1994) — downside risk — the target semi-deviation basis for the Sortino ratio and downside deviation
- Historical / empirical VaR — the nearest-rank percentile method used here — no distributional assumption; contrast with parametric or Monte Carlo VaR, which SmartRetireCalc does not use
- Martin & McCann — Ulcer Index — the RMS-of-drawdown definition
These name the concepts; the exact formulas above are SmartRetireCalc’s implementation, not a claim of conformance to an industry or regulatory standard.
Related calculators
Related guides: Sequence of Returns Risk Guide