Unit 2, lesson 13

Regression and statistical identification

How ordinary least squares solves the normal equations as an orthogonal projection, what exogeneity and statistical identification add, and how omitted variable bias and heteroskedasticity change the sandwich covariance.

  • Video 13
  • Estimation and regression

A regression of a fund’s monthly excess returns on the market’s excess returns gives a slope that is often read as the fund’s market beta. Computing that slope is pure geometry and works for any data set. Whether it estimates a definite population coefficient, how uncertain it is, and whether it says anything about what would happen if the fund’s market exposure changed are separate questions, and each needs assumptions about errors that are never observed. This lesson derives ordinary least squares as an orthogonal projection, states the exogeneity and identification assumptions that interpretation needs, derives the omitted variable formula, and shows how heteroskedasticity changes the covariance of the estimator but not the fit.

Key terms

Ordinary least squares

Definition Let y∈Rny \in \mathbb{R}^n be a vector of responses and XX an n×kn \times k design matrix whose columns are the regressors, often including a column of ones for an intercept. An ordinary least squares estimate is any β^∈Rk\hat\beta \in \mathbb{R}^k that minimizes, over b∈Rkb \in \mathbb{R}^k, the sum of squared residuals

S(b)=∥y−Xb∥2.S(b) = \lVert y - Xb \rVert^2 .

The fitted vector y^=Xβ^\hat y = X\hat\beta is the orthogonal projection of yy onto the column space Col⁡(X)\operatorname{Col}(X), so a minimizer always exists and the fitted vector is unique. If XX has full column rank kk, which requires n≥kn \ge k, the minimizer itself is unique and

β^=(X⊤X)−1X⊤y.\hat\beta = (X^\top X)^{-1} X^\top y.

If the columns are linearly dependent, the minimizers form the set β^+Null⁡(X)\hat\beta + \operatorname{Null}(X), and the pseudoinverse solution X+yX^{+}y is the one with the smallest Euclidean norm. With an intercept and one regressor, so that XX has rows (1,xj)(1, x_j), the slope and intercept are

b^=∑j(xj−xˉ)(yj−yˉ)∑j(xj−xˉ)2,a^=yˉ−b^ xˉ.\begin{gathered} \hat b = \frac{\sum_j (x_j - \bar x)(y_j - \bar y)}{\sum_j (x_j - \bar x)^2}, \\[0.4em] \hat a = \bar y - \hat b\,\bar x . \end{gathered}

Nothing in this definition involves probability.

In plain words Least squares picks the combination of the regressor columns that comes closest to the response vector in Euclidean distance. The closest fitted vector is always unique. The coefficients that produce it are unique only when no column is a linear combination of the others.

Example Take the constructed predictor values 00, 11, 22, 33 and responses 11, 22, 22, 55. The means are 1.51.5 and 2.52.5. The centered predictors −1.5-1.5, −0.5-0.5, 0.50.5, 1.51.5 have squared sum 55, and their products with the centered responses −1.5-1.5, −0.5-0.5, −0.5-0.5, 2.52.5 are 2.252.25, 0.250.25, −0.25-0.25, 3.753.75, with sum 66. So b^=6/5=1.2\hat b = 6/5 = 1.2 and a^=2.5−1.2⋅1.5=0.7\hat a = 2.5 - 1.2 \cdot 1.5 = 0.7, with fitted values 0.70.7, 1.91.9, 3.13.1, 4.34.3 and sum of squared residuals 1.81.8. The line with intercept 11 and slope 11 fits 11, 22, 33, 44 and has sum of squared residuals 22, which is 1.81.8 plus 0.20.2, the squared distance between the two fitted vectors.

Normal equations

Definition The normal equations of the least squares problem are

X⊤X b=X⊤y.X^\top X\, b = X^\top y .

The objective S(b)=∥y−Xb∥2S(b) = \lVert y - Xb \rVert^2 has gradient −2X⊤(y−Xb)-2X^\top(y - Xb) and Hessian 2X⊤X2X^\top X, which is positive semidefinite, so SS is convex and bb minimizes SS if and only if it solves the normal equations. Equivalently, the residual e=y−Xβ^e = y - X\hat\beta is orthogonal to every column of XX, that is, X⊤e=0X^\top e = 0. Writing y−Xb=e+X(β^−b)y - Xb = e + X(\hat\beta - b) and using X⊤e=0X^\top e = 0 gives, for every b∈Rkb \in \mathbb{R}^k,

∥y−Xb∥2=∥e∥2+∥X(β^−b)∥2,\begin{aligned} \lVert y - Xb \rVert^2 &= \lVert e \rVert^2 \\[0.4em] &\quad + \lVert X(\hat\beta - b) \rVert^2, \end{aligned}

which proves the minimum directly. The normal equations always have a solution. The matrix X⊤XX^\top X is invertible exactly when XX has full column rank, and then it is positive definite and the solution is unique. When XX contains a column of ones, the corresponding equation says that the residuals sum to zero, and with one regressor the fitted line passes through the point of means (xˉ,yˉ)(\bar x, \bar y).

In plain words At the best fit, nothing linear is left in the residual that a regressor column could still explain. If the residual had a nonzero dot product with some column, moving the fit a little along that column would reduce the squared error.

Example For the four data points above,

X⊤X=[46614],X⊤y=[1021],\begin{gathered} X^\top X = \begin{bmatrix} 4 & 6 \\ 6 & 14 \end{bmatrix}, \\[0.4em] X^\top y = \begin{bmatrix} 10 \\ 21 \end{bmatrix}, \end{gathered}

so for an intercept aa and a slope bb the normal equations are 4a+6b=104a + 6b = 10 and 6a+14b=216a + 14b = 21. The values a=0.7a = 0.7 and b=1.2b = 1.2 satisfy both, since 2.8+7.2=102.8 + 7.2 = 10 and 4.2+16.8=214.2 + 16.8 = 21. The residuals 0.30.3, 0.10.1, −1.1-1.1, 0.70.7 sum to zero, and weighted by the predictors they give 0+0.1−2.2+2.1=00 + 0.1 - 2.2 + 2.1 = 0. These two zero sums are the two normal equations.

Exogeneity

Definition Consider the linear model

y=Xβ+ε,y = X\beta + \varepsilon,

with a random n×kn \times k design XX, an unknown coefficient vector β∈Rk\beta \in \mathbb{R}^k and an error vector ε\varepsilon whose entries are integrable. The regressors are strictly exogenous if E[ε∣X]=0\mathbb{E}[\varepsilon \mid X] = 0, so every error has conditional mean zero given the regressors of all observations. If XX has full column rank, substituting the model into the formula for β^\hat\beta gives

β^−β=(X⊤X)−1X⊤ε,\hat\beta - \beta = (X^\top X)^{-1}X^\top\varepsilon,

and therefore E[β^∣X]=β\mathbb{E}[\hat\beta \mid X] = \beta. This is conditional unbiasedness, and it gives E[β^]=β\mathbb{E}[\hat\beta] = \beta whenever β^\hat\beta is integrable. A weaker condition, contemporaneous exogeneity, asks only that the error of each observation have mean zero and be uncorrelated with the regressors of the same observation. It does not by itself give unbiasedness. Together with independent and identically distributed observations, finite second moments and a nonsingular second-moment matrix of the regressors, it gives consistency of β^\hat\beta through the law of large numbers, a result stated here without the details. In an autoregression the regressor yt−1y_{t-1} depends on earlier errors, so strict exogeneity fails while contemporaneous exogeneity can still hold.

In plain words Exogeneity says that the unobserved part of the response has no systematic component that lines up with the regressors. It is an assumption about errors that are never seen. The fitted residuals cannot confirm it, because they are orthogonal to the regressors by construction in every data set.

Example Take the model yj=a+b xj+εjy_j = a + b\,x_j + \varepsilon_j with the predictor values 00, 11, 22, 33. The error of the estimated slope is a weighted sum of the errors,

b^−b=∑j=14wjεj,w=(−0.3,−0.1,0.1,0.3),\begin{gathered} \hat b - b = \sum_{j=1}^{4} w_j \varepsilon_j, \\[0.4em] w = (-0.3, -0.1, 0.1, 0.3), \end{gathered}

with wj=(xj−xˉ)/∑i(xi−xˉ)2w_j = (x_j - \bar x)/\sum_i (x_i - \bar x)^2. Under strict exogeneity its conditional mean is zero. Since the weights sum to zero, an error mean that is the same constant for every observation shifts only the intercept. If instead E[εj∣X]=0.2 xj\mathbb{E}[\varepsilon_j \mid X] = 0.2\,x_j, then E[b^∣X]=b+0.2∑jwjxj=b+0.2\mathbb{E}[\hat b \mid X] = b + 0.2\sum_j w_j x_j = b + 0.2, because ∑jwjxj=1\sum_j w_j x_j = 1. The fit then reports a slope that is too large by 0.20.2 on average, and nothing in the residuals reveals it.

Statistical identification

Definition A parameter is identified in a statistical model if the distribution of the observable data determines its value uniquely, so that two different parameter values allowed by the model never produce the same distribution of observables. For a pair (x,y)(x, y) with a random regressor vector x∈Rkx \in \mathbb{R}^k and a response yy, both with finite second moments, and a nonsingular matrix E[xx⊤]\mathbb{E}[x x^\top], the coefficient of the best linear predictor of yy given xx,

β∗=(E[xx⊤])−1E[xy],\beta^{*} = \bigl(\mathbb{E}[x x^\top]\bigr)^{-1}\mathbb{E}[x y],

is identified. If y=x⊤β+εy = x^\top\beta + \varepsilon, then

β∗=β+(E[xx⊤])−1E[xε],\begin{aligned} \beta^{*} &= \beta \\[0.4em] &\quad + \bigl(\mathbb{E}[x x^\top]\bigr)^{-1}\mathbb{E}[x\varepsilon], \end{aligned}

so the projection coefficient equals the model coefficient exactly when E[xε]=0\mathbb{E}[x\varepsilon] = 0. If E[xx⊤]\mathbb{E}[x x^\top] is singular, some regressor is almost surely a linear combination of the others, and only certain combinations of the coefficients are identified. Reading β\beta as the change in yy caused by an intervention on xx needs further assumptions or a research design that rules out confounding, reverse causation and selection. Using it for forecasting needs regressors that are known when the forecast is made.

In plain words A regression always produces numbers. Identification asks whether those numbers estimate one definite population quantity, and which one. The projection coefficient is fixed by the distribution of the data, while reading it as a structural or causal coefficient adds assumptions that the data cannot check.

Example A model includes the market’s excess return twice, once in percent as x1x_1 and once in decimals as x2=x1/100x_2 = x_1/100. Then β1x1+β2x2=(β1+β2/100) x1\beta_1 x_1 + \beta_2 x_2 = (\beta_1 + \beta_2/100)\,x_1, so all coefficient pairs with the same value of β1+β2/100\beta_1 + \beta_2/100 give the same distribution of the data. Only that combination is identified, the design matrix of every sample lacks full column rank, and the fitted values are still unique. Timing gives a second example. A regression of a fund’s daily return on the same day’s market return can have a well-identified projection coefficient and still not provide a forecast of the fund’s return, because the regressor is not known in advance.

Omitted variable bias

Definition Suppose scalar random variables satisfy

Y=α+βX+γZ+ε,Y = \alpha + \beta X + \gamma Z + \varepsilon,

where XX, ZZ and ε\varepsilon have finite second moments, Var⁡(X)>0\operatorname{Var}(X) > 0 and Cov⁡(X,ε)=0\operatorname{Cov}(X, \varepsilon) = 0. The population slope of the regression of YY on XX alone, with an intercept, is β~=Cov⁡(X,Y)/Var⁡(X)\tilde\beta = \operatorname{Cov}(X, Y)/\operatorname{Var}(X). Covariance with a constant is zero, so

Cov⁡(X,Y)=βVar⁡(X)+γCov⁡(X,Z),\begin{aligned} \operatorname{Cov}(X, Y) &= \beta\operatorname{Var}(X) \\[0.4em] &\quad + \gamma\operatorname{Cov}(X, Z), \end{aligned}

and dividing by Var⁡(X)\operatorname{Var}(X) gives

β~=β+γ Cov⁡(X,Z)Var⁡(X).\tilde\beta = \beta + \gamma\,\frac{\operatorname{Cov}(X, Z)}{\operatorname{Var}(X)}.

The second term is the omitted variable bias. It vanishes exactly when γ=0\gamma = 0 or Cov⁡(X,Z)=0\operatorname{Cov}(X, Z) = 0. Under independent and identically distributed sampling with finite second moments, the slope of the short regression converges in probability to β~\tilde\beta, not to β\beta. The same algebra holds exactly in every sample. The short regression slope equals the long regression’s coefficient on XX plus its coefficient on ZZ times the slope from regressing ZZ on XX.

In plain words A regression that leaves out ZZ credits XX with the part of the effect of ZZ that moves together with XX. The bias has the sign of γ\gamma times the sign of Cov⁡(X,Z)\operatorname{Cov}(X, Z), and more data do not remove it.

Example In a constructed model a fund’s return YY depends on the market return XX and a size factor return ZZ with β=1\beta = 1, γ=2\gamma = 2, Var⁡(X)=1\operatorname{Var}(X) = 1 and Cov⁡(X,Z)=0.5\operatorname{Cov}(X, Z) = 0.5. The short regression targets

β~=1+2⋅0.51=2,\tilde\beta = 1 + 2 \cdot \frac{0.5}{1} = 2,

twice the direct coefficient. Larger samples estimate 22 more and more precisely, and the estimate never moves toward 11. Including ZZ as a regressor recovers β=1\beta = 1 when ε\varepsilon is also uncorrelated with ZZ and the second-moment matrix of the regressors is nonsingular.

Heteroskedasticity and sandwich covariance

Definition In the linear model with strict exogeneity and full column rank, let Ω=Var⁡(ε∣X)=E[εε⊤∣X]\Omega = \operatorname{Var}(\varepsilon \mid X) = \mathbb{E}[\varepsilon\varepsilon^\top \mid X], assumed finite. From β^−β=(X⊤X)−1X⊤ε\hat\beta - \beta = (X^\top X)^{-1}X^\top\varepsilon,

Var⁡(β^∣X)=(X⊤X)−1X⊤ΩX(X⊤X)−1,\begin{aligned} &\operatorname{Var}(\hat\beta \mid X) \\[0.4em] &= (X^\top X)^{-1}X^\top \Omega X (X^\top X)^{-1}, \end{aligned}

called the sandwich covariance. The errors are homoskedastic when Ω=σ2In\Omega = \sigma^2 I_n, for example when they are uncorrelated with a common conditional variance. The sandwich then reduces to σ2(X⊤X)−1\sigma^2(X^\top X)^{-1}, and with n>kn > k the estimate σ^2=∥e∥2/(n−k)\hat\sigma^2 = \lVert e \rVert^2/(n - k) is conditionally unbiased for σ2\sigma^2. The errors are heteroskedastic when the conditional variances Var⁡(εj∣X)\operatorname{Var}(\varepsilon_j \mid X) differ across observations. Heteroskedasticity leaves the normal equations, the fitted vector and conditional unbiasedness unchanged. It changes only the covariance, and the classical formula can then be too small or too large. The heteroskedasticity-consistent estimator replaces Ω\Omega by diag⁡(e12,…,en2)\operatorname{diag}(e_1^2, \dots, e_n^2) built from the residuals. Its justification is asymptotic, for independent observations under moment conditions, and is stated here without proof. With serially correlated errors Ω\Omega also has off-diagonal entries, which a diagonal correction does not cover, and estimators that add cross-date terms are needed.

In plain words The fit does not care whether some observations are noisier than others. The uncertainty does, because each observation’s error variance enters the covariance with a weight that reflects how strongly that observation moves the coefficients.

Example For the four-point fit, a homoskedastic model gives σ^2=1.8/2=0.9\hat\sigma^2 = 1.8/2 = 0.9 and an estimated slope variance of 0.9/5=0.180.9/5 = 0.18, a standard error of about 0.42430.4243. To see the sandwich without sampling error, keep the same predictors and suppose the errors are conditionally uncorrelated with conditional variances known to be 11, 11, 11 and 55. With the slope weights w=(−0.3,−0.1,0.1,0.3)w = (-0.3, -0.1, 0.1, 0.3),

Var⁡(b^∣X)=∑j=14wj2Var⁡(εj∣X)=0.09+0.01+0.01+0.45=0.56.\begin{aligned} &\operatorname{Var}(\hat b \mid X) \\[0.4em] &= \sum_{j=1}^{4} w_j^2 \operatorname{Var}(\varepsilon_j \mid X) \\[0.4em] &= 0.09 + 0.01 + 0.01 + 0.45 \\[0.4em] &= 0.56 . \end{aligned}

The homoskedastic formula with the average variance 22 would give 2/5=0.42/5 = 0.4, too small, because the noisiest observation sits at the edge of the design where its weight is largest. Four observations are far too few for any large-sample result, which is why this example uses known variances instead of the residual-based estimator.

Check yourself

  1. A constructed fund has monthly excess returns −1-1, 11, 0.50.5 and 2.52.5 percent in months when the market’s excess return is −1-1, 00, 11 and 22 percent. Fit an intercept and a slope by ordinary least squares and check both normal equations through the residuals.
Show the answer

The means are xˉ=0.5\bar x = 0.5 and yˉ=0.75\bar y = 0.75. The centered market returns −1.5-1.5, −0.5-0.5, 0.50.5, 1.51.5 have squared sum 55, and the centered fund returns are −1.75-1.75, 0.250.25, −0.25-0.25, 1.751.75. The products sum to 2.625−0.125−0.125+2.625=52.625 - 0.125 - 0.125 + 2.625 = 5, so the slope is 5/5=15/5 = 1 and the intercept is 0.75−1⋅0.5=0.250.75 - 1 \cdot 0.5 = 0.25. The fitted values are −0.75-0.75, 0.250.25, 1.251.25, 2.252.25, and the residuals are −0.25-0.25, 0.750.75, −0.75-0.75, 0.250.25. They sum to zero, and weighted by the market returns they give

(−1)(−0.25)+0⋅0.75+1⋅(−0.75)+2⋅0.25=0,\begin{aligned} &(-1)(-0.25) + 0 \cdot 0.75 \\[0.4em] &\quad + 1 \cdot (-0.75) \\[0.4em] &\quad + 2 \cdot 0.25 = 0, \end{aligned}

so both normal equations hold. The sum of squared residuals is 1.251.25. The slope 11 is a projection coefficient of these data. Reading it as the fund’s sensitivity to the market needs exogeneity, which these checks cannot establish.

  1. A model has predictor values −1-1, 00, 11 and strictly exogenous regressors, and its errors are conditionally uncorrelated with known conditional variances 44, 11 and 11. A colleague says that the heteroskedasticity makes the slope estimator biased, and that its variance is the homoskedastic value computed with the average error variance 22. Correct both claims.
Show the answer

Unbiasedness needs only E[ε∣X]=0\mathbb{E}[\varepsilon \mid X] = 0 and full column rank, so the slope estimator is still conditionally unbiased. The centered predictors are −1-1, 00, 11 with squared sum 22, so the slope weights are −0.5-0.5, 00, 0.50.5 and the sandwich variance is

0.25⋅4+0⋅1+0.25⋅1=1.25,\begin{aligned} &0.25 \cdot 4 + 0 \cdot 1 + 0.25 \cdot 1 \\[0.4em] &\quad = 1.25, \end{aligned}

a standard error of about 1.1181.118. The homoskedastic formula with variance 22 gives 2/2=12/2 = 1, which is too small. The error can go either way. With variances 11, 44, 11 the sandwich gives 0.25+0+0.25=0.50.25 + 0 + 0.25 = 0.5, while the homoskedastic formula still gives 11, because the middle observation has zero weight on the slope.

  1. A constructed model has Y=α+0.8X−1.5Z+εY = \alpha + 0.8X - 1.5Z + \varepsilon with Var⁡(X)=0.5\operatorname{Var}(X) = 0.5, Cov⁡(X,Z)=0.3\operatorname{Cov}(X, Z) = 0.3, Cov⁡(X,ε)=0\operatorname{Cov}(X, \varepsilon) = 0 and finite second moments. What does the slope of a regression of YY on XX alone estimate in large samples, and would ten times more data fix the problem?
Show the answer

The omitted variable formula gives

β~=0.8+(−1.5)⋅0.30.5=0.8−0.9=−0.1.\begin{aligned} \tilde\beta &= 0.8 + (-1.5) \cdot \frac{0.3}{0.5} \\[0.4em] &= 0.8 - 0.9 = -0.1 . \end{aligned}

The short regression targets a negative slope although the direct coefficient of XX is positive. The bias −0.9-0.9 has the sign of γ=−1.5\gamma = -1.5 times the sign of the positive covariance. Ten times more data would concentrate the estimate more tightly around −0.1-0.1, not move it toward 0.80.8. Recovering 0.80.8 requires including ZZ, with ε\varepsilon also uncorrelated with ZZ and a nonsingular second-moment matrix of the regressors, or some other identification strategy.

How this lesson connects