Skip to content

Phase 2: realised variance — estimators validated on simulated ground truth - #4

Merged
NavyBlueCheese merged 2 commits into
mainfrom
phase-2/realized-variance
Jul 9, 2026
Merged

Phase 2: realised variance — estimators validated on simulated ground truth#4
NavyBlueCheese merged 2 commits into
mainfrom
phase-2/realized-variance

Conversation

@NavyBlueCheese

@NavyBlueCheese NavyBlueCheese commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What was built

  • src/fxvrp/realized/estimators.py — RV, subsample-averaged RV, TSRV (Zhang-Mykland-Ait-Sahalia 2005 with the small-sample adjustment), realised kernel (Parzen weights, BNHLS plug-in bandwidth), realised semivariance.
  • src/fxvrp/realized/jumps.py — bipower variation, tripower quarticity, jump variation, and the Huang-Tauchen ratio jump statistic.
  • src/fxvrp/realized/sampling.py — previous-tick calendar-time sampling on log mid-quotes (Hansen-Lunde), DST-aware 17:00-ET FX day windows.
  • src/fxvrp/realized/panel.py + scripts/build_rv_panel.py — the daily RV panel; thin days flagged on in-window quote updates (held quotes fill any grid, so grid-return counts cannot detect thinness).
  • src/fxvrp/realized/signature.py + scripts/fig_signature.py — the volatility signature plot; paper/figures/signature_plot.pdf generated from real ticks.
  • paper/notes/methodology_realized.md — methodology drafted while building, per the brief.

Ground-truth results (the section 3 table, realised rows)

  • RV -> sigma^2 T under GBM (<1% bias at fine sampling; sampling-noise std matches sqrt(2/n)).
  • RV tracks each Heston path's recorded integral of v dt: corr > 0.999, within 10%.
  • Naive RV under noise equals IV + 2 n omega^2 within 5% and diverges in sampling frequency (demonstrated); TSRV and the realised kernel recover the truth.
  • BPV recovers the continuous part only under Merton; RV - BPV tracks the true per-path sum of squared jumps (corr > 0.99).
  • Jump test: empirical size within binomial tolerance of nominal 5% on 800 jump-free days; power > 60% on days with visible jumps.
  • TQ/BPV^2 -> 1 under constant volatility (the studentisation the z-test relies on).

Full suite: 78 passed, coverage 92.1%, mypy --strict clean, ruff clean.

Real-data output (extends automatically as the backfill completes)

54 usable FX days on disk so far (March 2020 + early 2007): mean annualised vol 11.8%, max 26.5% (COVID), 4 jump days at the 0.1% level including 2020-03-03 - the Fed's emergency inter-meeting cut. The signature curve shows ~35% RV inflation at 5s sampling, flattening at the 5-minute baseline.

Known uncertainties

  • TSRV and kernel-bandwidth equation numbers not verified against the papers; flagged TODO(verify) in docstrings, behaviour pinned by tests.
  • Kernel end-point jittering (BNHLS practice paper) not implemented; documented simplification.
  • The panel spans whatever ticks the backfill has ingested; rerun scripts/build_rv_panel.py to extend.

@NavyBlueCheese
NavyBlueCheese merged commit 489e99a into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant