Skip to content
LeetQuant
QR04 Regression and Numerical Optimisation

QR04 · Regression and Numerical Optimisation · Lesson 3 of 6

Regression Assumptions and Diagnostics

The Gauss–Markov assumptions and what breaks when each fails: robust (White) and Newey–West standard errors, multicollinearity and VIF, leverage and influence, and omitted-variable bias.

20 min

Two separate questions

A regression gives you two things: a coefficient β^\hat\beta and a standard error for it. Most violated assumptions damage only one of them. Heteroskedasticity and autocorrelation leave β^\hat\beta unbiased but make the textbook standard error wrong. Omitted variables and measurement error bias β^\hat\beta itself, and no standard-error correction fixes that. Multicollinearity damages neither in principle; it just makes the honest standard error large.

The objective: state the assumptions behind OLS, know which failure hits the coefficient and which hits the inference, and know the standard fix for each.

The Gauss–Markov assumptions

For y=Xβ+εy = X\beta + \varepsilon with XX an n×kn \times k design matrix:

  1. Linearity in the parameters (the regressors may be nonlinear transforms such as x2x^2 or log⁡x\log x).
  2. Full column rank: no regressor is an exact linear combination of the others, so X⊤XX^\top X is invertible.
  3. Strict exogeneity: E[ε∣X]=0\mathbb E[\varepsilon \mid X] = 0.
  4. Spherical errors: Var⁡(ε∣X)=σ2I\operatorname{Var}(\varepsilon \mid X) = \sigma^2 I, i.e. constant variance (homoskedasticity) and no correlation across observations.

Assumptions 1–3 give unbiasedness: β^=β+(X⊤X)−1X⊤ε\hat\beta = \beta + (X^\top X)^{-1}X^\top\varepsilon, so E[β^∣X]=β\mathbb E[\hat\beta \mid X] = \beta. Adding 4 gives

Var⁡(β^∣X)=σ2(X⊤X)−1,\operatorname{Var}(\hat\beta \mid X) = \sigma^2 (X^\top X)^{-1},

and the Gauss–Markov theorem: OLS is BLUE, the best (lowest-variance) linear unbiased estimator. Proof sketch: write any other linear estimator as β~=((X⊤X)−1X⊤+D)y\tilde\beta = \big((X^\top X)^{-1}X^\top + D\big)y. Unbiasedness forces DX=0DX = 0, and then Var⁡(β~)=σ2(X⊤X)−1+σ2DD⊤\operatorname{Var}(\tilde\beta) = \sigma^2(X^\top X)^{-1} + \sigma^2 DD^\top, which exceeds the OLS variance by a PSD matrix.

Normality of ε\varepsilon is not a Gauss–Markov assumption. It is needed only for exact finite-sample tt and FF distributions; with a large sample the central limit theorem gives approximately normal β^\hat\beta anyway. "BLUE" is also weaker than it sounds: a biased estimator such as ridge can have lower mean squared error.

Heteroskedasticity and White standard errors

If Var⁡(εi∣X)=σi2\operatorname{Var}(\varepsilon_i \mid X) = \sigma_i^2 varies across observations, write Ω=diag⁡(σi2)\Omega = \operatorname{diag}(\sigma_i^2). Then

Var⁡(β^∣X)=(X⊤X)−1 X⊤ΩX (X⊤X)−1,\operatorname{Var}(\hat\beta \mid X) = (X^\top X)^{-1}\,X^\top \Omega X\,(X^\top X)^{-1},

the sandwich. The textbook formula σ2(X⊤X)−1\sigma^2(X^\top X)^{-1} is the special case Ω=σ2I\Omega = \sigma^2 I. White's estimator plugs in squared residuals for the unknown σi2\sigma_i^2:

Var⁡^HC0(β^)=(X⊤X)−1(∑iei2 xixi⊤)(X⊤X)−1.\widehat{\operatorname{Var}}_{\text{HC0}}(\hat\beta) = (X^\top X)^{-1}\Big(\sum_i e_i^2\, x_i x_i^\top\Big)(X^\top X)^{-1} .

HC1 multiplies by n/(n−k)n/(n - k); HC3 divides each ei2e_i^2 by (1−hii)2(1 - h_{ii})^2 and behaves better in small samples. None of them requires knowing the form of the heteroskedasticity.

When does it matter? In simple regression with centred xx, the true slope variance is ∑xi2σi2/(∑xi2)2\sum x_i^2\sigma_i^2 / (\sum x_i^2)^2. The classical formula effectively replaces σi2\sigma_i^2 by its average. They agree when σi2\sigma_i^2 is unrelated to xi2x_i^2; when noise is larger at extreme xx, which is typical in finance (returns are noisier when volatility, volume or the signal itself is extreme), the classical standard error is too small.

Detecting it: plot residuals against fitted values or each regressor and look for a fan; formally, the Breusch–Pagan test regresses ei2e_i^2 on the regressors and compares nR2nR^2 with a χ2\chi^2. In practice, just report robust standard errors.

Weighted least squares is the efficient alternative when you know (or can model) σi2\sigma_i^2: weight each observation by 1/σi21/\sigma_i^2. It changes the coefficients; robust standard errors do not.

Worked example

how far off is the classical standard error?

A regressor takes the values x∈{−2,−1,0,1,2}x \in \{-2, -1, 0, 1, 2\} and the error variance is σi2=1+xi2\sigma_i^2 = 1 + x_i^2. Compare the true variance of the OLS slope with what the classical formula reports (using the average error variance). By what factor are the classical tt-statistics inflated?

Show solution

The xx values are centred, with ∑xi2=10\sum x_i^2 = 10. The variances are σi2=5,2,1,2,5\sigma_i^2 = 5, 2, 1, 2, 5, averaging 15/5=315/5 = 3.

True (sandwich) variance:

∑xi2σi2(∑xi2)2=4⋅5+1⋅2+0+1⋅2+4⋅5100=44100=0.44.\frac{\sum x_i^2\sigma_i^2}{(\sum x_i^2)^2} = \frac{4 \cdot 5 + 1 \cdot 2 + 0 + 1 \cdot 2 + 4 \cdot 5}{100} = \frac{44}{100} = 0.44 .

Classical: σˉ2/∑xi2=3/10=0.30\bar\sigma^2 / \sum x_i^2 = 3/10 = 0.30.

The true standard error is 0.44/0.30≈1.21\sqrt{0.44/0.30} \approx 1.21 times the classical one, so classical tt-statistics are about 21% too large: a reported t=2.2t = 2.2 is really about 1.81.8. The coefficient itself is still unbiased. A simulation with 200,000 draws from this design gives an HC0-to-classical standard-error ratio of 1.21.

Autocorrelated errors and Newey–West

In time series, errors are often correlated across tt. The middle of the sandwich becomes ∑t∑sxtxs⊤ E[εtεs]\sum_t\sum_s x_t x_s^\top\,\mathbb E[\varepsilon_t\varepsilon_s], which includes cross terms. For a single regressor, with autocorrelations ρx(j)\rho_x(j) of the regressor and ρε(j)\rho_\varepsilon(j) of the error, the true variance is approximately the classical one times

1+2∑j≥1ρx(j) ρε(j).1 + 2\sum_{j \ge 1} \rho_x(j)\,\rho_\varepsilon(j) .

Two consequences. Autocorrelated errors with a serially uncorrelated regressor barely hurt the slope's standard error. But a persistent regressor (valuation ratios, interest rates, slow signals) combined with autocorrelated errors makes the classical standard error far too small.

The Newey–West estimator estimates the middle term with the first LL lagged cross-products, down-weighted by Bartlett weights wj=1−j/(L+1)w_j = 1 - j/(L + 1) (the weights guarantee a PSD estimate). Choose LL to cover the dependence: at least the overlap length for overlapping returns, or a rule of thumb like L≈0.75 n1/3L \approx 0.75\,n^{1/3}.

Detecting it: plot the residual autocorrelation function; the Durbin–Watson statistic is approximately 2(1−ρ^1)2(1 - \hat\rho_1), so values well below 2 signal positive autocorrelation. And if the residual autocorrelation is strong, ask whether the model is missing dynamics (a lagged term) rather than just patching the standard errors.

Panels: when many assets share a date, their errors are correlated cross-sectionally; cluster standard errors by date (and by firm if residuals persist over time).

Worked example

overlapping returns

You regress 5-day forward returns, sampled every day, on a slow-moving signal (treat its autocorrelation as 1 at short lags). Daily returns are independent. By how much do the classical standard errors understate the truth? What does Newey–West with L=4L = 4 deliver in this population?

Show solution

Consecutive 5-day returns share 4 of their 5 days, so the error autocorrelations are ρε(j)=(5−j)/5\rho_\varepsilon(j) = (5 - j)/5 for j=1,…,4j = 1, \dots, 4 and zero beyond. With ρx(j)≈1\rho_x(j) \approx 1 the variance factor is

1+2⋅4+3+2+15=1+4=5.1 + 2\cdot\frac{4 + 3 + 2 + 1}{5} = 1 + 4 = 5 .

The true standard error is 5≈2.24\sqrt 5 \approx 2.24 times the classical one. A classical tt-statistic of 3 is really about 1.3. This is the overlapping-observations problem: 1,000 daily observations of a 5-day return carry about the information of 200 independent ones.

Newey–West with L=4L = 4 uses weights 4/5,3/5,2/5,1/54/5, 3/5, 2/5, 1/5, so even with the true autocorrelations its factor is

1+2⋅4⋅4+3⋅3+2⋅2+1⋅125=1+2.4=3.4,1 + 2\cdot\frac{4 \cdot 4 + 3 \cdot 3 + 2 \cdot 2 + 1 \cdot 1}{25} = 1 + 2.4 = 3.4 ,

still short of 5. The Bartlett down-weighting needs LL larger than the overlap (or the uniform-weight Hansen–Hodrick estimator) to capture an MA(4) fully. Sampling non-overlapping returns every 5 days avoids the issue at the cost of observations.

Multicollinearity and VIF

The variance of coefficient jj can be written

Var⁡(β^j)=σ2∑i(xij−xˉj)2⋅11−Rj2,\operatorname{Var}(\hat\beta_j) = \frac{\sigma^2}{\sum_i (x_{ij} - \bar x_j)^2}\cdot\frac{1}{1 - R_j^2},

where Rj2R_j^2 is the R2R^2 from regressing xjx_j on the other regressors. The second factor is the variance inflation factor, VIFj=1/(1−Rj2)\text{VIF}_j = 1/(1 - R_j^2). With two regressors of correlation ρ\rho, VIF=1/(1−ρ2)\text{VIF} = 1/(1 - \rho^2): ρ=0.9\rho = 0.9 gives 5.265.26 (standard errors ×2.29\times 2.29), ρ=0.95\rho = 0.95 gives 10.310.3. A common flag is VIF above 5 or 10.

What collinearity does not do: bias the coefficients, hurt the fit or the predictions (as long as new data keep the same correlation structure), or invalidate the standard errors, which are correct, just large. What it does: makes individual coefficients unstable, sign-flipping between samples, while their sum (or whatever combination the data identify) is precise. Remedies: drop or combine regressors, collect more varied data, or regularise (ridge, next lesson). Near-collinearity also shows up numerically as a large condition number of X⊤XX^\top X.

Leverage and influence

The fitted values are y^=Hy\hat y = Hy with the hat matrix H=X(X⊤X)−1X⊤H = X(X^\top X)^{-1}X^\top. Its diagonal entry hiih_{ii}, the leverage, is how much yiy_i pulls its own fitted value. Facts: 0≤hii≤10 \le h_{ii} \le 1, ∑ihii=k\sum_i h_{ii} = k (so the average is k/nk/n), and in simple regression

hii=1n+(xi−xˉ)2∑j(xj−xˉ)2.h_{ii} = \frac1n + \frac{(x_i - \bar x)^2}{\sum_j (x_j - \bar x)^2} .

Leverage depends only on XX: it measures how unusual the regressors are, not whether the point fits. The residual of a high-leverage point has variance σ2(1−hii)\sigma^2(1 - h_{ii}), which is small, because the line is dragged towards it. So raw residuals hide influential points. Better measures:

  • The leave-one-out (deleted) residual ei/(1−hii)e_i/(1 - h_{ii}): the error in predicting yiy_i from a fit without it.
  • Cook's distance Di=ei2ks2⋅hii(1−hii)2D_i = \dfrac{e_i^2}{k s^2}\cdot\dfrac{h_{ii}}{(1 - h_{ii})^2}, which measures how far all fitted values move when point ii is dropped. Di>1D_i > 1 (or well above 4/n4/n) deserves a look.

A point is influential when it has both high leverage and a large deleted residual. In finance the usual culprits are crash days, data errors and a few very large or illiquid stocks.

Worked example

a single point bends the line

Fit OLS to (1,1),(2,2),(3,3),(4,4),(10,4)(1, 1), (2, 2), (3, 3), (4, 4), (10, 4). Find the leverages, the residual of the last point, its deleted residual and its Cook's distance.

Show solution

xˉ=4\bar x = 4 and ∑(xi−xˉ)2=9+4+1+0+36=50\sum(x_i - \bar x)^2 = 9 + 4 + 1 + 0 + 36 = 50, so the leverages are 0.2+(xi−4)2/500.2 + (x_i - 4)^2/50:

h=(0.38, 0.28, 0.22, 0.20, 0.92),∑hii=2=k.h = (0.38,\ 0.28,\ 0.22,\ 0.20,\ 0.92), \qquad \textstyle\sum h_{ii} = 2 = k .

The fit is y^=1.68+0.28x\hat y = 1.68 + 0.28x, against slope 1 for the first four points alone. Residuals are −0.96,−0.24,0.48,1.20,−0.48-0.96, -0.24, 0.48, 1.20, -0.48: the point at x=10x = 10 has one of the smallest residuals because it has dragged the line to itself.

Its deleted residual is −0.48/(1−0.92)=−6-0.48/(1 - 0.92) = -6: the first four points predict y=10y = 10 at x=10x = 10, and the observation is 4. With s2=∑ei2/(n−2)=2.88/3=0.96s^2 = \sum e_i^2/(n - 2) = 2.88/3 = 0.96,

D5=0.4822×0.96⋅0.920.082=0.12×143.75=17.25,D_5 = \frac{0.48^2}{2 \times 0.96}\cdot\frac{0.92}{0.08^2} = 0.12 \times 143.75 = 17.25 ,

far above 1. Every other point has Di<0.5D_i < 0.5. A residual plot alone would have missed it; leverage and Cook's distance do not.

Omitted variables and other exogeneity failures

Strict exogeneity fails whenever something in the error is correlated with a regressor. Then β^\hat\beta is biased, and more data does not help. Partition the true model as y=X1β1+X2β2+εy = X_1\beta_1 + X_2\beta_2 + \varepsilon and regress on X1X_1 only:

E[β^1]=β1+(X1⊤X1)−1X1⊤X2⏟Δ β2,\mathbb E[\hat\beta_1] = \beta_1 + \underbrace{(X_1^\top X_1)^{-1}X_1^\top X_2}_{\Delta}\,\beta_2 ,

where Δ\Delta holds the slopes from regressing each omitted variable on the included ones. With one variable of each, the bias is β2 δ\beta_2\,\delta: its sign is the sign of (effect of the omitted variable) ×\times (its correlation with the included one). That sign rule is what interviewers ask for. Example: regress returns on a stock's analyst-upgrade count without controlling for past momentum. Momentum predicts returns (β2>0\beta_2 > 0) and analysts upgrade winners (δ>0\delta > 0), so the upgrade coefficient is biased upward.

Two other sources of the same problem:

  • Measurement error in a regressor (a noisy proxy): if you observe x+ux + u with independent noise uu, the slope is attenuated towards zero by the factor Var⁡(x)/(Var⁡(x)+Var⁡(u))\operatorname{Var}(x)/(\operatorname{Var}(x) + \operatorname{Var}(u)). Noisy signals look weaker than they are. (Noise in yy only adds variance.)
  • Simultaneity / reverse causality: order flow moves prices and prices attract order flow.

The fixes are design, not standard errors: include the confounder, use within-variation (fixed effects), use instruments, or run a cleaner experiment.

Interview angle

Asked "what assumptions does OLS make and what happens if they fail?", sort the answer into the two questions: is β^\hat\beta still unbiased? (yes under heteroskedasticity, autocorrelation and collinearity; no under omitted variables, measurement error and simultaneity) and is the standard error right? (no under heteroskedasticity and autocorrelation; fix with White, Newey–West or clustering). Then name the diagnostic you would run for each.

Knowledge check

The residuals from a regression of daily stock returns on a signal fan out: they are much larger when the signal is extreme. Which statement is correct?

Knowledge check

Regressing x3x_3 on the other regressors gives R32=0.8R_3^2 = 0.8. Compared with a design where x3x_3 is uncorrelated with the others (same variance of x3x_3, same σ2\sigma^2), the standard error of β^3\hat\beta_3 is multiplied by about:

Knowledge check

Bigger funds have higher fees, and fees reduce net returns. You regress fund net returns on fund size and omit fees. Size has no true effect. What do you expect the size coefficient to be?

Knowledge check

A regression has n = 50 observations and k = 5 coefficients (including the intercept). What is the average leverage across observations?

Key takeaways

  • Gauss–Markov (linearity, full rank, E[ε∣X]=0\mathbb E[\varepsilon \mid X] = 0, spherical errors) makes OLS BLUE with variance σ2(X⊤X)−1\sigma^2(X^\top X)^{-1}. Normality is only for exact small-sample tests.
  • Heteroskedasticity and autocorrelation leave β^\hat\beta unbiased but break the standard errors: use White (HC) or Newey–West (HAC), and cluster by date in panels. Overlapping returns with a persistent signal can understate standard errors by h\sqrt h.
  • VIFj=1/(1−Rj2)\text{VIF}_j = 1/(1 - R_j^2) inflates the variance, not the bias. Collinear coefficients are unstable individually but precise in combination.
  • High leverage hides in small residuals: check hiih_{ii}, deleted residuals and Cook's distance.
  • Omitted-variable bias is β2δ\beta_2\delta, signed by (effect of the omitted variable) ×\times (its correlation with the included one). Measurement error attenuates. Neither shrinks with more data.

Practice problems

Finished reading?

Answer the 4 knowledge checks to complete this lesson (0 done).