
Portfolio Tail-Risk EngineOne-Day VaR and Expected Shortfall, Tested Out of Sample
Do adaptive tail-risk models actually forecast better, or does added complexity just look better? I built a reproducible engine to test that on 14 years of out-of-sample data.
Built a one-day VaR and Expected Shortfall forecasting engine for an equal-weight, monthly rebalanced 11-asset equity portfolio, producing 3,519 out-of-sample daily forecasts (2012–2025) at 95%, 97.5% and 99% confidence under strict no-look-ahead validation.
Ran formal inference with full-sample Diebold–Mariano tests, Newey–West HAC errors and Holm adjustment. Adaptive models significantly beat the Gaussian benchmark in 6 of 12 comparisons, but EWMA and FHS were never statistically distinguishable, so FHS’s descriptive edge is not established.
Read moreShow less
- Compared three models on identical inputs: a 504-day Rolling Gaussian benchmark, an EWMA Gaussian model (λ = 0.94), and Filtered Historical Simulation, which resamples complete standardized residual vectors to preserve cross-asset dependence without assuming normal shocks. Each model runs 100,000 Monte Carlo scenarios per forecast date.
- Tested calibration beyond counting exceptions with Kupiec and Christoffersen backtests, exact Clopper–Pearson intervals by year, and Expected Shortfall tail-severity diagnostics, showing that calibration shifted materially over time.
- Scored accuracy with strictly consistent scoring rules (quantile loss for VaR, FZ0 loss for VaR and ES jointly). EWMA ranked first in 10 of 14 years on VaR accuracy at 95% and 97.5%, while FHS led more often once Expected Shortfall was scored.
- Stress-tested on the Feb–Apr 2020 selloff, where every model under-forecast 99% tail risk, with exception rates of 19.4% (Rolling Gaussian), 8.1% (EWMA) and 6.5% (FHS) against a 1% target.
- Engineered for reproducibility with separated data, forecasting and evaluation layers, non-overwriting result snapshots with SHA-256 checksums, figures regenerated only from verified data, and 650 automated tests.
- Python, NumPy, pandas, SciPy, Matplotlib, pytest







