← All notes
Machine learningApplied14 min

Gradient boosting for volatility: where XGBoost wins and where it does not

Boosted trees are the strongest general-purpose model for tabular data, and volatility forecasting is a tabular problem. That is the case for. The case against is that trees cannot extrapolate, and volatility spikes are extrapolation.

What boosting is doing

Gradient boosting fits an additive ensemble of shallow trees, each new tree fitted to the gradient of the loss with respect to the current prediction. XGBoost's contribution was to use a second-order expansion of the loss and to put explicit regularisation on tree complexity and leaf weights, which is why it behaves so much better than naive boosting on noisy data. LightGBM grows leaf-wise with histogram binning, which is faster on wide feature sets and, with default settings, somewhat more eager to overfit.

The property that matters here: a tree predicts a constant within each leaf. The model's output is therefore bounded by the range of targets observed during training. It cannot produce a number it has never seen.

Where it wins: breadth of information

HAR uses three numbers from one series. Boosting shines when the honest answer to "what else might predict tomorrow's volatility?" is a long list, because it handles many correlated predictors, nonlinearity and interactions without any of them being specified in advance. A feature set worth building:

Three modelling choices repeatedly turn out to matter more than hyperparameters:

  1. Predict log RV. The raw target is right-skewed and heteroskedastic; squared error on it puts nearly all the gradient on crisis days. Logs fix this. Add the variance correction when inverting.
  2. Predict the residual against HAR. Let OLS handle the linear persistence it already captures perfectly, and give boosting only the part that is left. This preserves HAR's extrapolation behaviour while keeping the nonlinear gains — usually the single biggest improvement available.
  3. Tune conservatively. Shallow trees (depth three to six), small learning rate with early stopping on a time-ordered validation split, and subsampling. Financial data has a low signal-to-noise ratio; capacity is rarely the binding constraint.

Where it loses

The extrapolation problem. If the training set's highest observed volatility is twenty-five percent annualised, the model will not predict sixty. It will saturate at its top leaf and stay there. Precisely when an accurate forecast is most valuable, a tree ensemble is structurally incapable of producing one. A linear model in logs has no such ceiling.

Related weaknesses worth stating plainly:

The leakage traps

Almost every spectacular volatility backtest is a leakage bug. The usual suspects:

An honest summary

With HAR's own inputs, XGBoost roughly ties HAR and costs far more to maintain. With a genuinely wider feature set — implied volatility, cross-asset, order flow — it produces a real and repeatable improvement, typically largest at short horizons and smallest at long ones. Fitted as a residual correction on top of HAR rather than as a replacement, it keeps the linear model's extrapolation behaviour and adds the nonlinear structure. That hybrid is where we have found the reliable gains, and it is the configuration we would defend in front of a sceptical risk committee.

References