analogue-risk

The engine, on the S&P 500

Pick any day since 1932 and see which past days it looks like, and what came next.

This page runs the analogue engine on the same data and settings as the paper's 5-day S&P 500 forecasts (vol.DAILY_W). For the day you pick, it takes the shape of the last 20 days of volatility, finds the closest past shapes whose next 5 days are already known, and forecasts the next 5 days from what happened after them.

Pick a day

Grey is the volatility that actually happened over each next 5 days. Blue is the paper's out-of-sample Analogue+HAR forecast, which starts after the calibration period. Click the chart, or focus it and use the arrow keys (Shift for a month).

Loading 24,802 days of data…

How this stays accurate

The data and the paper's forecasts on this page come from the package itself, written out by docs/demo/build.py. The forecasts you change with the settings come from engine.js, a line-by-line port of src/analog.rs. Every time the data is rebuilt, the script checks two things and stops if either fails:

  1. The out-of-sample QLIKE of all six models matches the paper's table (results/e2_volatility.csv, row "S&P 500 (h=5)"). Five agree to about 15 digits. GARCH agrees to 8, because its optimiser stops at a 10⁻⁶ tolerance and the last digits vary between machines.
  2. On 1,250 sampled days, across five settings (nearest neighbours and kernel, with and without regimes), engine.js gives the same forecast as the Rust engine to within 10⁻⁹, and picks exactly the same analogues.
Two things on this page aren't in the paper's comparison. The live forecast is the engine's raw output: before comparing models, the paper adds a per-fold bias correction fitted on earlier data. Volatility is annualised with 252 trading days.