F. HEKİMOĞLU
← cd ~/work/quant
// QUANT · VOLATILITY FORECASTING

GARCH versus machine learning, scored honestly

Forecast h-day realized volatility and test whether XGBoost beats a well-specified GARCH(1,1) or HAR-RV out of sample, scored with QLIKE and a Hansen-SPA snooping control. It does not.

00Overview

Volatility is the one thing in finance that is genuinely predictable, which makes it the fair fight for machine learning against classical econometrics. This project forecasts h-day realized volatility with seven models and scores them with QLIKE under a leakage-free walk-forward, with a Hansen-SPA test to control for trying many models.

Out-of-sample QLIKE at h=1

OUT-OF-SAMPLE QLIKE AT h=1 (lower is better)
0.53
HAR-RV
0.57
XGBoost
1.68
EWMA
1.80
GARCH
1.91
RW

01Method

  • Seven models: GARCH(1,1), EGARCH, GJR-GARCH, HAR-RV, XGBoost, EWMA and a random walk.
  • Anchored walk-forward; the scaler, GARCH parameters, HAR-RV OLS and XGBoost are all fit on the train slice only.
  • Forward-only targets with an explicit gap, plus a purge and embargo sized to the horizon h.
  • QLIKE loss, Diebold-Mariano pairwise tests, and Hansen-SPA for snooping control.

02The honest test

At every horizon a classical model wins or ties: HAR-RV takes h=1 and h=22, EGARCH takes h=5. XGBoost is never more than marginal, and Hansen-SPA does not crown ML a significant winner (p = 0.503 at h=1). This reproduces Hansen and Lunde (2005): GARCH(1,1) is hard to beat.

Best at h=1HAR-RV
SPA p-value0.503ML not significant
ML beats GARCHno

03Stack & links

pythonarchxgboostgarchhar-rvqlike
SEC 00 · INDEXENDARK--:--:--⌘K / ? help