# Tail Risk Lab: portfolio risk under real market scenarios

Prepared for Zhaozhong Xu · November 2026 · Version 2

## Question and application

How do probability-based daily loss forecasts behave when applied to actual equity, long Treasury and gold ETF portfolios? How does the same allocation behave in different crises?

The desk translates return quantiles into dollar VaR and expected shortfall for an illustrative portfolio value. Users can change target weights, compare five models, replay historical shocks, and set simultaneous hypothetical asset returns. The three saved allocations are experiments, not investment recommendations. The project is a risk study, not a trading strategy.

## Real data and portfolio construction

Yahoo Finance adjusted closes for SPY, TLT and GLD supply 5,283 aligned daily price observations (2005-01-03 to 2025-12-31), giving 5,282 close-to-close return vectors. Return is adjusted_close[t] / adjusted_close[t−1] − 1. No missing sessions are filled. Rebuilding from the raw snapshots checks all three date sets match; unmatched sessions cause a failure for manual inspection rather than silently creating multi-session daily returns.

SPY represents U.S. large-cap equities; TLT holds long-duration U.S. Treasuries; GLD provides gold exposure. In particular, a 60/40 SPY–TLT portfolio is **not** the same as a conventional equity / broad aggregate bond portfolio. The ETF universe is selected retrospectively and cannot establish generalization to all assets.

Data were retrieved on 2026-11-28 UTC. Raw responses, exact query URLs and SHA-256 hashes are saved under data/etf_raw/ and data/etf_provenance.json. Prices are a revised vendor series; adjusted-close ratios are treated as an indicative reinvested-return proxy, not audited fund total returns or point-in-time data. Future adjustments can revise levels; relative returns can also change if vendors correct histories. This is not a live market feed.

For target weights w, portfolio return is r_p,t = Σ_j w_j r_j,t. All experiments assume daily rebalancing, no commissions, spread, slippage, taxes or financing, and no leverage or shorting. Adjusted ETF returns already reflect fund-level expenses implicitly, but do not include investor trading costs. This is not a fixed-share buy-and-hold calculation. Compounded paths evolve as V_t = V_(t−1)(1 + r_p,t).

## Forecast design

First 252 return observations initialize variance; 1,000 subsequent standardized residuals populate the filtered empirical distribution. Each day is forecast before observing that day’s return. Main evaluation is 2010–2025: 4,024 days × 5 models × 2 confidence levels × 3 portfolios = **120,720 ETF forecasts**. The snapshot forecast after 2025-12-31 is an unscored next-session forecast, not a forecast for the current date.

| Model | Fixed specification |
| --- | --- |
| Historical | Previous 1,000 raw portfolio losses |
| Rolling Gaussian | Zero mean; previous 252 squared returns averaged |
| EWMA Gaussian | Zero mean; σ²_(t+1) = 0.94 σ²_t + 0.06 r²_t |
| EWMA Student-t | Same EWMA variance; Student-t innovations, fixed ν = 5, scaled to unit variance |
| Filtered historical | Previous 1,000 losses standardized by their own contemporaneous EWMA forecast, rescaled by next-session σ |

For Student-t innovations, Z = sqrt((ν−2)/ν) T_ν. Thus σ denotes standard deviation for both Gaussian and Student-t models. Using an unscaled Student-t would confound heavy tails with a higher variance. Quantiles are computed from the standard Student-t density with Simpson integration and bisection; ES uses sqrt((ν−2)/ν) (ν + q²)/(ν−1) f_ν(q)/(1−α). ν is a fixed modeling choice, not estimated or optimized on the test sample. At 95%, its unit-variance quantile can be smaller than Gaussian even though its far tails are heavier.

The original four-model market-factor study remains accessible at market-study.html and reports/research_report.md. Its 42,264 forecasts are separate from the ETF study and must not be described as additional independent replication evidence.

## Evaluation and uncertainty

Loss is −return. VaR is an upper loss quantile; ES is the mean of the worst 1−α probability mass. Empirical VaR uses the inverse empirical CDF; ES integrates its upper tail with fractional boundary mass. We report strict VaR breaches, proper quantile (pinball) loss, Kupiec unconditional coverage, first-order Christoffersen independence / joint coverage, and Wilson breach-rate intervals. The original research memo gives the likelihood formulas. ES values and a descriptive ES residual are available, but no formal joint VaR/ES calibration test is implemented.

Bootstrap intervals compare filtered historical minus Gaussian EWMA quantile loss, pairing scores by forecast day. Presets use the Python circular moving-block bootstrap with 20-day blocks, 1,000 replicates and seed 2026. Custom browser portfolios use the same block procedure with a deterministic Mulberry32 generator and seed 2026; their finite bootstrap draws differ from Python’s Mersenne Twister. The raw forecasts and deterministic metrics match across implementations; bootstrap endpoints need not be identical. No multiplicity adjustment is applied. Dependence beyond chosen blocks and structural change can invalidate nominal interval coverage.

Wilson intervals and LR reference distributions are approximations. Sparse failures make short-window p-values unreliable, especially the three-session August 2024 diagnostic. These tiny windows cannot validate a 1% or 5% tail model. A p-value above 0.05 is not a certificate of safety, and an overall correct breach frequency can hide clustering.

## 99% forecast results: 2010–2025

Each row has 4,024 forecasts; nominal breach rate is 1%. Scores are basis points of return, not trading P&L.

| Allocation | Model | Breaches | Breach rate | Quantile loss (bp) | Joint coverage p |
| --- | --- | ---: | ---: | ---: | ---: |
| Equity only | Historical | 42 | 1.04% | 4.735 | 0.0003 |
| Equity only | Rolling Gaussian | 106 | 2.63% | 4.954 | <0.0001 |
| Equity only | EWMA Gaussian | 98 | 2.44% | 4.014 | <0.0001 |
| Equity only | EWMA Student-t | 72 | 1.79% | 3.787 | <0.0001 |
| Equity only | Filtered historical | 46 | 1.14% | 3.761 | 0.0049 |
| 60 / 40 · long Treasuries | Historical | 40 | 0.99% | 2.726 | <0.0001 |
| 60 / 40 · long Treasuries | Rolling Gaussian | 74 | 1.84% | 2.729 | <0.0001 |
| 60 / 40 · long Treasuries | EWMA Gaussian | 79 | 1.96% | 2.221 | <0.0001 |
| 60 / 40 · long Treasuries | EWMA Student-t | 55 | 1.37% | 2.126 | 0.0003 |
| 60 / 40 · long Treasuries | Filtered historical | 44 | 1.09% | 2.139 | 0.0044 |
| Equity / Treasuries / gold | Historical | 35 | 0.87% | 2.804 | <0.0001 |
| Equity / Treasuries / gold | Rolling Gaussian | 71 | 1.76% | 2.774 | <0.0001 |
| Equity / Treasuries / gold | EWMA Gaussian | 81 | 2.01% | 2.298 | <0.0001 |
| Equity / Treasuries / gold | EWMA Student-t | 54 | 1.34% | 2.206 | 0.0004 |
| Equity / Treasuries / gold | Filtered historical | 46 | 1.14% | 2.219 | 0.0049 |

Student-t innovations lower the 99% Gaussian EWMA breach counts in each saved portfolio. Filtered empirical tails also improve marginal failure rates. **All five models in all three portfolios reject joint coverage at the 5% level at 99% confidence.** Better marginal calibration therefore does not establish adequate conditional calibration.

### Paired quantile-score uncertainty, 99%

| Allocation | Filtered minus Gaussian EWMA (bp) | 95% bootstrap interval (bp) |
| --- | ---: | --- |
| Equity only | -0.253 | [-0.651, 0.065] |
| 60 / 40 · long Treasuries | -0.082 | [-0.303, 0.079] |
| Equity / Treasuries / gold | -0.078 | [-0.250, 0.057] |

These comparisons are exploratory and do not support a universal winner. The dashboard updates the evidence statement when a 95% interval excludes zero in either direction, rather than always asserting inconclusiveness.

## Historical stress replays

Dates include the first day’s close-to-close return. Each replay starts from the entered notional at the prior close. Replays have no attached probability and do not use current risk forecasts to predict a multi-day crisis.

| Scenario / inclusive dates | SPY only | 60% SPY / 40% TLT | 60% SPY / 30% TLT / 10% GLD |
| --- | ---: | ---: | ---: |
| Financial crisis · 2008-09-15 to 2008-11-20 | -39.82% | -21.65% | -22.59% |
| COVID selloff · 2020-02-19 to 2020-03-23 | -33.40% | -16.02% | -17.51% |
| Stock–bond decline · 2022-01-03 to 2022-12-30 | -18.18% | -22.83% | -19.95% |
| August volatility · 2024-08-01 to 2024-08-05 | -6.07% | -1.91% | -2.53% |

The contrast is economically relevant: the long Treasury sleeve cushions the selected COVID and 2008 paths but worsens the full-year 2022 result compared with equities alone. This demonstrates period-dependent diversification in these data, not a recommendation to add or remove bonds. On an illustrative $100,000, 2022 replay loss is about $22,831 for SPY–TLT 60/40 versus $18,176 for SPY alone. Different rebalancing policies and costs would change the result.

Scenario contribution for asset j is Σ_t V_(t−1) w_j r_j,t. Contributions sum to total portfolio P&L. Peak-to-trough drawdown includes the initial capital as a possible peak. The 2008 replay uses actual ETF returns, but lies before the 2010 forecast evaluation; no ETF forecast-calibration claim is made for it.

## Dollar risk, covariance and hypothetical shocks

VaR and ES scale linearly with entered notional because the modeled holdings are linear and weights are fixed. For example, the 60/30/10 snapshot’s 99% filtered VaR is approximately $1,327 and ES $1,694 on $100,000 for the session after 2025-12-31. These numbers are not current quotes or current-date forecasts.

EWMA second-moment matrix C is initialized from 252 return vectors and updated as C_(t+1) = 0.94 C_t + 0.06 r_t r_tᵀ. The zero-mean assumption makes this the modeled covariance. Portfolio variance is wᵀCw; asset component variance share is w_j(Cw)_j/(wᵀCw). Shares sum to one and may be negative for hedging exposures. This is a volatility decomposition, not an allocation of empirical VaR or ES. The separate SPY–TLT chart uses centered Pearson correlations over trailing 252 sessions, sampled every 21 sessions; it is not the EWMA covariance estimator.

The editable one-day shock computes P&L = notional × Σ_j w_j shock_j. For 60/30/10 and simultaneous −5% SPY, −3% TLT, +2% GLD, loss is 3.7%, or $3,700 per $100,000. Shocks are deterministic user assumptions with no estimated occurrence probability. A multi-day historical replay loss cannot be compared directly with one-day VaR as though their horizons matched.

## Verification and reproduction

Run from the project root:

```bash
python3 experiments/refresh_etf_data.py
python3 experiments/run_portfolio_study.py
python3 experiments/write_portfolio_report.py
python3 -m unittest discover -s tests -v
node tests/check_engine.cjs
python3 -m http.server 8080 --directory dist
```

Python requires version 3.10+ with no third-party packages. Node is optional for browser/Python parity verification. The tests cover Student-t unit-variance scaling; current-day and future-return perturbation invariance; correct daily rebalancing, compounding and scenario attribution; covariance/scalar volatility equivalence; empirical ES with ties; and likelihood boundaries. The JavaScript parity check compares every preset daily VaR/ES forecast, deterministic score, breach count, scenario return and next-session threshold against Python. Browser custom calculations run in a Web Worker so the page remains responsive.

## Limits and next research

This is a revised-data retrospective study with a small, selected ETF universe and selected stress windows. Rebalancing costs and taxes are absent. Tail estimation uses about ten observations in a 1% empirical tail of a 1,000-day window. Volatility, tail shape and correlation can shift abruptly. Parameters were fixed for comparison, but the design was not independently preregistered. Student-t ν=5 can be misspecified; standardized historical residuals need not be independent or stationary. Statistical tests do not certify future risk. A future protocol could evaluate transaction costs and monthly rebalancing, Student-t GARCH estimated only on past observations, joint VaR/ES scores, other asset classes and genuinely untouched future data.

## Sources and attribution

- Data: the exact Yahoo Finance chart endpoint URLs and hashes are in data/etf_provenance.json. Market data retain provider rights; the code license does not grant market-data redistribution rights.
- SPY fund description: https://www.ssga.com/us/en/institutional/etfs/state-street-spdr-sp-500-etf-trust-spy
- TLT fund description: https://www.ishares.com/us/products/239454/ishares-20-year-treasury-bond-etf
- GLD fund description: https://www.ssga.com/us/en/individual/etfs/spdr-gold-shares-gld
- Student-t density and variance: NIST, https://www.itl.nist.gov/div898/handbook/eda/section3/eda3664.htm
- EWMA and coverage-test references are linked in reports/research_report.md.

Implemented with AI assistance for Zhaozhong Xu. Before presenting this work in interviews, reproduce the analysis and explain its assumptions, leakage controls and failure modes.
