Quant Memo
Core

Quadratic Discriminant Analysis

Linear discriminant analysis draws a straight boundary between classes because it assumes every class has the same spread. Quadratic discriminant analysis lets each class have its own spread and shape, which curves the boundary but costs more parameters to estimate.

Prerequisites: Linear Discriminant Analysis

Linear discriminant analysis (LDA) separates classes with a straight boundary because it assumes every class's data is spread out the same way, just centered differently. That's often wrong — "calm market" days might cluster tightly while "stressed" days spread out much more widely, in a different shape. Quadratic discriminant analysis (QDA) drops the shared-spread assumption and lets each class have its own spread, at the cost of a curved boundary.

The analogy: one umbrella size versus custom umbrellas

LDA assumes everyone in a group needs the same size and shape of umbrella, just centered over a different spot. QDA measures each person and gives them a custom-shaped umbrella that fits their build — more accurate, but you now need far more information per person, and if you only have a few examples of some group, their custom umbrella is a noisy guess.

The mechanics: separate covariance per class

Both model each class kk as multivariate normal with mean μk\mu_k, classifying by whichever class makes a point most probable. LDA forces every class to share one covariance matrix Σ\Sigma, which cancels out of the comparison between classes, leaving a boundary linear in xx. QDA instead estimates a separate Σk\Sigma_k per class, so that cancellation doesn't happen:

δk(x)δj(x)=12logΣk12(xμk)Σk1(xμk)+12logΣj+12(xμj)Σj1(xμj).\delta_k(x) - \delta_j(x) = -\tfrac{1}{2}\log|\Sigma_k| - \tfrac{1}{2}(x-\mu_k)^\top \Sigma_k^{-1}(x-\mu_k) + \tfrac{1}{2}\log|\Sigma_j| + \tfrac{1}{2}(x-\mu_j)^\top \Sigma_j^{-1}(x-\mu_j).

In plain English: the boundary is now genuinely quadratic in xx — it can curve or bend around a class, because each class's own shape directly warps the boundary near it instead of canceling out.

Worked example: two regimes with different volatility

"Calm" days: mean volatility 12%, SD 3%. "Stressed" days: mean 25%, SD 10% — higher on average and far more variable. Under LDA's shared-variance assumption you'd be forced to average these two spreads, distorting both. Under QDA, a new observation at 18% is 2 SDs from calm (using SD 3) but only 0.7 SDs from stressed (using SD 10) — QDA correctly weighs stressed's wider tolerance, something a single shared spread cannot represent.

Decision boundary
flexibility 3.0points on wrong side 9reasonable

Toggle between a linear and more flexible boundary above: allowing curvature lets the classifier hug an irregularly-shaped class more closely — the visual version of what QDA's per-class covariance buys over LDA's shared one.

What this means in practice

QDA needs enough data per class to estimate a full covariance matrix — roughly p2/2p^2/2 parameters per class. With few observations in some class, its estimated Σk\Sigma_k is noisy, and the curved boundary can overfit despite looking more flexible on paper. QDA helps most when classes visibly differ in spread, not just location, with enough data in every class.

QDA generalizes LDA by giving each class its own covariance matrix instead of a shared one, turning the linear boundary quadratic — more flexible, but requiring far more parameters, especially for classes with few observations.

More flexibility isn't automatically better. A class with few observations gives a poorly estimated covariance matrix, and QDA's extra curvature fits noise in that spread rather than a real pattern — often performing worse out of sample than plain LDA. Regularized discriminant analysis, blending shared and per-class covariance, exists to soften this trade-off.

Related concepts

Practice in interviews

Further reading

  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning, ch. 4.3
ShareTwitterLinkedIn