Quant Memo
Core

Support Vector Regression

Instead of penalizing every prediction error, support vector regression draws a tolerance tube around the fitted line and only penalizes points that fall outside it — small errors are simply ignored.

Prerequisites: Soft-Margin SVMs and the C Parameter, The Classical Linear Regression Assumptions

Ordinary least squares regression penalizes every deviation from the fitted line, no matter how small — a prediction off by $0.01 contributes to the loss just as a prediction off by $100 does, only less. Support vector regression (SVR) starts from a different premise: define a tolerance band of width ϵ\epsilon around the fitted line, and treat any error inside that band as free — zero penalty. Only errors that spill outside the tube get penalized, and only in proportion to how far outside they land. The result is a fit that's deliberately insensitive to small noise and shaped almost entirely by the points that genuinely can't be squeezed inside the tube.

The analogy: a garden hose laid across uneven ground

Imagine laying a flexible garden hose across a bumpy lawn so that as much of the lawn's surface as possible stays within a fixed distance of the hose — small bumps within that tolerance need no attention at all, the hose just passes near them without complaint. Only the spots where the ground rises or falls by more than the tolerance actually force the hose to bend. SVR fits a regression line (or curve, with a kernel) exactly the same way: it's shaped by the handful of stubborn points that can't be squeezed inside the ϵ\epsilon-tube, while the many points that already sit comfortably inside contribute nothing to the final shape.

The loss function

SVR minimizes the ϵ\epsilon-insensitive loss:

Lϵ(y,y^)=max(0,yy^ϵ)L_\epsilon(y, \hat y) = \max(0, |y - \hat y| - \epsilon)

Plain English: if the prediction is within ϵ\epsilon of the true value, the loss is exactly zero; beyond that, the loss grows linearly with how far outside the tube the point sits. The full optimization (like the classification SVM) balances this loss against a regularization term controlling the fitted function's flatness, with a hyperparameter CC trading off tube violations against model simplicity — and, as with classification, a kernel can be swapped in to fit a curved rather than linear tube.

loss error |y − ŷ| zero inside ε linear beyond ε
The $\epsilon$-insensitive loss is flat at zero until the error exceeds $\epsilon$, then rises linearly — the exact shape that makes SVR ignore small errors entirely.

Worked example 1: which points get penalized

With ϵ=0.5\epsilon = 0.5, consider four residuals (true minus predicted): 0.20.2, 0.4-0.4, 0.90.9, 1.3-1.3. Loss for each: max(0,0.20.5)=0\max(0, 0.2-0.5)=0; max(0,0.40.5)=0\max(0, 0.4-0.5)=0; max(0,0.90.5)=0.4\max(0, 0.9-0.5)=0.4; max(0,1.30.5)=0.8\max(0, 1.3-0.5)=0.8. Two of the four residuals, both comfortably inside the $0.5 tolerance band, contribute exactly zero to the loss and therefore exert zero pull on where the fitted line sits — only the two points that spilled outside the tube (contributing 0.4 and 0.8) are the ones actually shaping the fit.

Worked example 2: widening the tube changes which points matter

Same four residuals, but widen ϵ\epsilon to 1.01.0: losses become max(0,0.21)=0\max(0,0.2-1)=0; max(0,0.41)=0\max(0,0.4-1)=0; max(0,0.91)=0\max(0,0.9-1)=0; max(0,1.31)=0.3\max(0,1.3-1)=0.3. Now three of four points are inside the tube and contribute nothing — only the 1.3-1.3 residual still matters, and even that one's penalty shrank from 0.8 to 0.3. Widening ϵ\epsilon doesn't just shrink penalties uniformly; it can flip a point from "shapes the fit" to "ignored entirely," which is why ϵ\epsilon is the single most consequential hyperparameter in SVR — it directly controls how many points the model treats as noise versus signal.

outside tube: penalized inside tube: free
Points that land inside the shaded $\epsilon$-tube around the fitted line cost nothing; only points outside it (like the highlighted one) contribute to the loss and pull the fit.

What this means in practice

SVR is useful precisely where you believe small prediction errors are just noise that shouldn't influence the model at all — fitting an implied-volatility curve where quoted prices carry bid-ask noise below a certain size, or a fair-value curve where sub-tick deviations are meaningless. It's less commonly reached for than ridge or gradient-boosted trees in most quant pipelines, mainly because tuning both ϵ\epsilon and CC (and a kernel bandwidth, if nonlinear) well requires more careful cross-validation than a single-hyperparameter method, and because, like the classification SVM, the raw fitted function doesn't come with built-in uncertainty estimates the way a Bayesian or tree-ensemble model can provide.

Support vector regression ignores all errors smaller than a tolerance ϵ\epsilon and penalizes only errors that exceed it, linearly — in contrast to ordinary least squares, which penalizes every deviation (quadratically) no matter how small, making SVR deliberately robust to small, noisy fluctuations around the fit.

Setting ϵ\epsilon too large is a subtle way to silently underfit: if the tolerance band is wider than the actual scale of the signal you're trying to capture, genuinely informative deviations get swallowed into "noise" and ignored along with the real noise, and the fitted function can end up nearly flat even though real structure exists in the data. ϵ\epsilon should be chosen relative to the actual noise scale of the target (e.g., from a rough estimate of measurement or bid-ask noise), not picked as a default or tuned purely to minimize training error, which will always push ϵ\epsilon toward zero and defeat the point of using SVR at all.

Related concepts

Practice in interviews

Further reading

  • Smola & Schölkopf, A Tutorial on Support Vector Regression (2004)
ShareTwitterLinkedIn