# Tail Risk Lab: conditional-risk research follow-up

November 28, 2026. Experimental research package; no changes to the public app.

## Purpose

Test whether geopolitical conditions help forecast the SIZE and downside of
monthly portfolio moves, rather than trying to infer their direction. This is a
bounded follow-up to the earlier return-regression/Dirichlet-process experiment,
which did not beat its simple volatility baseline overall. Both architectures
and the prior negative result must remain part of the research record.

The new models are **parametric Bayesian heteroskedastic regressions**, not a
nonparametric DP or GP. Four chains infer log-variance responses, a conservative
constant monthly log drift, and (in the Student-t variant) latent tail precisions.
Elliptical slice sampling handles the Gaussian-prior log-variance coefficients.

## Files and reproduction

Tested Python 3.12.14; install requirements.txt in an isolated environment. From
this directory:

    python tests/test_research.py
    python experiments/analyze_risk_study.py

The included source snapshots and results are ready to inspect. To rerun the
models independently without overwriting the saved run:

    python experiments/run_risk_study.py --output reports/reproduction
    python experiments/analyze_risk_study.py --folder reports/reproduction

To redownload sources, run `python research_tools/sources.py`, then use a fresh
output directory. A new retrieval manifest changes the protocol fingerprint;
old cached forecasts are deliberately rejected if the protocol differs.

Existing pinned source snapshots are reused. No account or API key is required.
The default experiment tests every month in 2022–2025 for three allocations:
SPY; 60/40 SPY/TLT; and 60/30/10 SPY/TLT/GLD. In each case, all fits freeze at the
preceding month's last trading session. The forecast worker receives only
preceding ETF rows; held-out outcomes are accessed later by the scorer.

## Data provenance and availability

- ETF data: the user's frozen adjusted-price snapshot, recovered from their
  saved tail-risk-lab.zip version 2; original source attribution is retained.
- Geopolitics: GPR threats and acts indexes, Caldara and Iacoviello (2022),
  *Measuring Geopolitical Risk*, American Economic Review 112(4), 1194–1225.
  Data from https://www.matteoiacoviello.com/gpr.htm, downloaded November 28,
  2026, CC BY. Original XLS files are pinned to a Git commit and their Git blob
  and SHA-256 hashes are verified. The needed columns are saved as compact CSVs.
- ALFRED returned HTTP 503 service errors in the replacement execution
  environment. **No oil or Treasury-yield observations are fitted in this
  follow-up.** Their earlier completed comparison remains a separate study.
  Bond and gold market returns are named price signals, not invented oil or
  yield observations. The optional ALFRED parser/download functions are retained
  for later recovery but are not used by this experiment.

47 archived GPR snapshots support 48 origins. A missing monthly archive uses the
preceding available one, recorded per forecast. GPR is newspaper coverage of
geopolitical threats/acts; it is neither a war probability nor a causal effect.

An archive tagged YYYYMM is conservatively considered usable from the first day
of the following month. Origins use at least the preceding vintage month and
observations no later than two months before the origin. Incomplete current-month
GPR observations are excluded. These rules use provider vintage labels and do
not independently certify original publication timestamps. The method changed
in 2021, so this version does not pretend the current index existed in 2008.

Older training features are reconstructed from the snapshot available at the
outer fit date, rather than every training month's first-release data. ETF
prices are revised vendor history. Consequently this is vintage-aware research,
not a certified real-time reconstruction or causal experiment.

## Models and fixed priors

Let r_i be monthly portfolio log growth, s_i the preceding 63-session daily log
return standard deviation times sqrt(21), and x_i a vector of known predictors.
The daily standard deviation is bounded to [0.0005,0.2]. Then:

    r_i = mu + s_i exp(x_i' gamma / 2) epsilon_i
    mu ~ Normal(0,0.005²)
    gamma_intercept ~ Normal(0,0.5²)
    gamma_slopes ~ Normal(0,0.15²)

The Gaussian model has epsilon ~ Normal(0,1). The Student-t model uses a fixed
7 degrees of freedom, equivalently lambda_i ~ Gamma(7/2,7/2) in shape/rate form
and epsilon_i | lambda_i ~ Normal(0,1/lambda_i). All applicable parameters and
precisions are inferred jointly; parameters are not fitted once and treated as
known. The Student-t scale is not its standard deviation.

Predictors are absolute preceding 21-session portfolio momentum divided by s_i,
log preceding volatility, absolute TLT and GLD 21-session log returns, and
log(1+GPR threats) / log(1+GPR acts). Training-only centering and standard deviations
are used; standardized features are capped at +/-5. Expanding training samples
contain at least 120 completed monthly outcomes.

The ablation sequence is: the earlier conjugate normalized-drift volatility
baseline; a constant log-variance model with the new raw-drift prior; market
signals affecting variance; added GPR affecting variance; and added Student-t
tails. The constant-risk control isolates the change in drift/variance priors
from the subsequent information additions. A gain against the older baseline
alone is not evidence that geopolitics helped.

## Inference and evaluation

Four chains initially use 750 warmup and 1,250 retained iterations each. A
numerical failure triggers one outcome-blind restart at 3x both counts. Checks
require rank-normalized/folded split Rhat <=1.01 and bulk/tail ESS >=400 for the
predictive mean, variance and loss probability. These are custom targeted
diagnostics, not a guarantee of convergence for every coefficient or scenario.

Scores are CRPS, 90% interval score, observed coverage, median absolute error and
the Brier score for a monthly loss. Scores concern **log growth**, not dollar
returns. Predictive outcome ranges and posterior uncertainty about a loss
probability are separate outputs. Unbounded scale priors do not generally give
a finite arithmetic expected dollar wealth, so no mean-dollar forecast is
reported. Medians, quantiles and event probabilities are well-defined.

This follow-up was specified after the earlier 2022–2025 comparison was seen.
It is development on known history, not an untouched or prospective test.
Model workers do not receive future outcomes, but that alone does not remove
researcher selection bias. No forecast accuracy, causal effect, investment
profit, or long-term retirement calibration is established by this package.
No fees, taxes, inflation or trading rules are modeled.

Sources: Murray, Adams and MacKay (2010), *Elliptical slice sampling*,
https://proceedings.mlr.press/v9/murray10a.html; GPR provider above;
https://mc-stan.org/docs/reference-manual/analysis.html for diagnostic concepts.

## Export sizes

The full research archive retains every origin's numerical diagnostics and
posterior-predictive/probability draws. The compact code/data export retains all
observed source data, source code, monthly score records and aggregate analyses,
plus the January-2024 60/40 posterior example. Other Monte Carlo caches are
omitted from the compact export and can be regenerated with the fixed seeds.
Neither export includes account credentials or private tester information.
