Machine Learning for Volatility Forecasting
Objectives
- Frame next-day volatility forecasting as a supervised learning problem with an explicit feature matrix and a leak-free target.
- Explain how a gradient-boosted tree ensemble learns a nonlinear map from features to expected variance, and how regularization controls overfitting.
- Evaluate a volatility model honestly with walk-forward out-of-sample testing and QLIKE loss, and judge when its forecast is genuine evidence rather than fitted noise.
You already know how to measure volatility. The harder question — the one that actually moves money — is how to forecast it.
Realized volatility from yesterday is a fact. Tomorrow's volatility is a guess. The whole game of options pricing, position sizing, and risk control runs on that guess, and the quality of the guess is the difference between a number that is genuine evidence an asset is about to move and a number that is just noise dressed up in a decimal point. For decades the standard tools were the GARCH family, which assume one tidy equation: tomorrow's variance is a fixed blend of today's squared shock and today's variance. That equation is elegant, and it is also a straitjacket. Markets do not promise to be linear, and the relationships between yesterday's signals and tomorrow's turbulence are tangled in ways no single hand-written formula captures. This is exactly the kind of problem supervised machine learning was built for.
Let us be precise about what supervised learning is, because the precision is where students go wrong.
Supervised learning is the task of estimating a function that maps inputs to an output, learned from examples where you already know the answer. You assemble a table. Each row is one observation — say, one trading day. The columns are split into two kinds. On the left, a set of features, the things you know at the moment you make the forecast. On the right, a single target, the thing you are trying to predict, whose true value you can look up after the fact. The algorithm's job is to find a function that, fed the features, produces an output as close as possible to the target — not on the rows it has already seen, but on rows it has never seen. That last clause is the entire discipline. A model that memorizes the past is worthless; a model that generalizes is the only kind worth having.
For volatility forecasting, the target is the natural choice: the realized volatility of the next period — tomorrow's, or the next twenty days', depending on your horizon. The features are everything plausibly informative that you can compute strictly from data available today. Recent realized volatility over several lookback windows. The level of returns and their recent skew. Trading volume and its trend. The shape of the implied-volatility surface, if you have options data. A regime indicator. None of these features may peek at the future — and this is the single most common, most expensive mistake in applied finance. If even one feature is computed using information from after the forecast moment, you have leakage, and your model will look brilliant in backtest and fail the instant it touches real money. Treat leakage as the original sin of supervised learning.
Now, what function does the model learn? You could use linear regression, but volatility is stubbornly nonlinear and the modern workhorse is the gradient-boosted decision tree — the engine inside libraries like XGBoost and LightGBM, and the engine inside the SVQ service. The intuition is worth slowing down for. A single decision tree asks a sequence of yes-or-no questions — is recent volatility above this threshold? is volume in the top quartile? — and partitions the data into buckets, predicting the average target within each bucket. One tree is weak and crude. Gradient boosting builds them in sequence: the first tree makes a rough prediction, you measure its errors, and the next tree is trained specifically to predict those errors. Add that correction, measure the new, smaller errors, and train another tree on those. Each tree is a small step down the gradient of the loss, hence the name. After several hundred such steps you have an ensemble that captures genuinely nonlinear, interacting structure — high volatility plus rising volume plus a particular surface shape — that no single equation would have written down.
The danger, of course, is that this flexible machine will fit the noise as happily as the signal. Three knobs hold it back, and together they are called regularization: you shrink each tree's contribution by a small learning rate so no single tree dominates; you cap tree depth so the questions stay coarse; and you penalize complexity so the ensemble prefers the simplest story that fits. Tuning these is not decoration — it is the whole art of making the forecast trustworthy.
The SVQ ML volatility-forecast service is this pipeline, productionized. Each night it assembles a feature row per instrument from the surface-capture store and the return series, feeds it to a trained gradient-boosted ensemble, and emits a forecast of next-session realized volatility alongside a confidence band. The band matters as much as the point estimate: when SVQ's model has seen many similar feature configurations and they led to consistent outcomes, the band is tight and the forecast is real evidence that position size can lean on. When today's features sit in a sparse, unfamiliar corner of the training space, the band widens — the service is saying, honestly, that this is extrapolation, not knowledge. That band is the guard against trusting a confident-looking number that the model has no business being confident about.