Courses › Graduate Econometrics
Random vectors, conditional expectations, and the regression model
Moments of random vectors and variance matrices, the conditional expectation function, the law of iterated expectations, best linear prediction, and what a regression coefficient does and does not mean.
The crash course began with asymptotic theory. Before we can study how estimators behave in large samples, we need to be precise about what they estimate. This module sets up the population objects that the rest of the course tries to learn from data: means and variance matrices of random vectors, the conditional expectation function, and the best linear predictor.
Statistics and Econometrics treated regression as fitting a line to points. Here we ask what population quantity the line is aiming at, and what that quantity means. The answer has two layers. A regression always estimates a well-defined best linear approximation, whether or not anything is causal. Whether its coefficients also measure causal effects depends on assumptions that come from outside the data, a theme that returns in Modules 8 and 11 to 13.
By the end of this module you will be able to
- Compute means, variance matrices and covariances of linear combinations of random vectors, and check that a variance matrix is positive semidefinite.
- Define the conditional expectation function, use the law of iterated expectations, and show that the CEF is the best predictor in mean squared error.
- Decompose a variance into within-group and between-group parts with the law of total variance.
- Derive the best linear predictor β = E[XX′]−1E[XY] and explain how it approximates a nonlinear CEF.
- Distinguish the descriptive regression model from a causal model, and state the population omitted-variable formula.
What this module covers
- Random vectors and variance matrices
- The conditional expectation function
- The law of total variance
- The best linear predictor
- What a regression coefficient means
- Problem set with step-by-step solutions
- Module quiz
Lesson 1.1 Free lesson
Random vectors and variance matrices
Econometrics is about several variables at once: a household’s income, rent and spending; a café’s price, sales and the weather. We collect them in a random vector, a column X = (X1, …, Xk)′. The prime ′ means transpose, so X is a column and X′ is a row.
Its mean vector μ = E[X] simply stacks the means of each element. Its variance matrix (also called the covariance matrix) collects every variance and covariance in one k × k array:
Read the formula entry by entry. The product (X − μ)(X − μ)′ is a column times a row, which gives a k × k matrix whose (i, j) entry is (Xi − μi)(Xj − μj). Taking expectations, the diagonal entries are the variances and the off-diagonal entries are the covariances. Because Cov(Xi, Xj) = Cov(Xj, Xi), Σ is symmetric.
Linear combinations
Most of what we need follows from two rules. For a fixed matrix A and vector b,
The second rule says adding a constant does not change spread, and stretching by A stretches the variance on both sides. A single linear combination a′X is the special case where A is one row: Var(a′X) = a′Σa. This scalar a′Σa is called a quadratic form.
Worked example: A household’s weekly spending
Let X = (coffee spending C, grocery spending G)′ with means $20 and $150, standard deviations $6 and $30, and correlation 0.5. Then Cov(C, G) = 0.5 × 6 × 30 = 90, so Σ = [[36, 90], [90, 900]].
Total spending is T = C + G = a′X with a = (1, 1)′. Its variance is a′Σa = 36 + 900 + 2 × 90 = 1,116, so its SD is √1,116 ≈ $33.41. Notice the covariance term counts twice: once as Σ12 and once as Σ21.
The difference G − C uses a = (−1, 1)′: a′Σa = 36 + 900 − 2 × 90 = 756, an SD of about $27.50. Positively correlated items are more variable in total than in difference.
Positive semidefiniteness
Since a′Σa is the variance of something, it can never be negative. A matrix with a′Σa ≥ 0 for every a is called positive semidefinite (psd). If a′Σa > 0 for every nonzero a, Σ is positive definite and invertible. Σ fails to be positive definite exactly when some combination a′X is constant, that is, when one variable is an exact linear function of the others. In a regression that is perfect collinearity, and it is why software refuses to estimate a model with a dummy for every category plus an intercept.
Common mistake
Writing down any symmetric table of numbers and calling it a variance matrix. Σ = [[4, 5], [5, 4]] is symmetric but implies a correlation of 5/4 > 1. The check: a = (1, −1)′ gives a′Σa = 4 + 4 − 10 = −2 < 0, an impossible negative variance.
Two matrix-calculus facts
We will minimize functions of vectors constantly. Two derivatives do almost all the work: ∂(a′b)/∂b = a, and for a symmetric matrix A, ∂(b′Ab)/∂b = 2Ab. They are the vector versions of d(ab)/db = a and d(ab²)/db = 2ab.
The multivariate normal
A random vector is multivariate normal, X ~ N(μ, Σ), if every linear combination a′X is normally distributed. Three properties make it the workhorse of asymptotic theory: it is fully described by μ and Σ; linear transformations stay normal, AX + b ~ N(Aμ + b, AΣA′); and for jointly normal variables, zero covariance implies independence. That last property is special: for other distributions, uncorrelated variables can still be dependent.
Key ideas
- The variance matrix Σ = E[(X − μ)(X − μ)′] holds all variances and covariances; it is symmetric and positive semidefinite.
- Var(AX + b) = AΣA′; for one combination, Var(a′X) = a′Σa.
- Σ is singular exactly when some variable is a linear function of the others: perfect collinearity.
- Uncorrelated implies independent only for jointly normal variables.
Practice questions: Random vectors, conditional expectations, and the regression model
Try these, then open each answer to check your work.
- 1.If Var(X1) = 9, Var(X2) = 16 and Cov(X1, X2) = 6, what is Var(X1 + X2)?
- 25
- 31
- 37
- 43
Show answer
Answer: C. Var(X1 + X2) = 9 + 16 + 2 × 6 = 37. The covariance appears twice in a′Σa.
- 2.Which of these could be a variance matrix?
- [[1, 3], [3, 1]]
- [[4, 1], [1, 1]]
- [[−1, 0], [0, 2]]
- [[2, 3], [3, 4]]
Show answer
Answer: B. A variance matrix must be symmetric and positive semidefinite. [[4, 1], [1, 1]] has positive diagonal and determinant 3 > 0. The others imply a negative variance for some combination (or, in one case, directly).
- 3.At a restaurant, 40% of meals are lunches with an average bill of $20 and 60% are dinners averaging $35. What is the average bill?
- $26.00
- $27.50
- $29.00
- $35.00
Show answer
Answer: C. By the law of iterated expectations, 0.4 × 20 + 0.6 × 35 = 8 + 21 = $29. The simple average of $20 and $35 ignores the shares.
Problems with step-by-step solutions
- 4.X = (X1, X2)′ has Var(X1) = 4, Var(X2) = 9 and Cov(X1, X2) = 3. Find Var(X1 + X2) and Var(2X1 − X2).
Show step-by-step solution
- Σ = [[4, 3], [3, 9]]. For a = (1, 1)′: a′Σa = 4 + 9 + 2 × 3 = 19.
- For a = (2, −1)′: a′Σa = 4 × 4 + 1 × 9 + 2 × (2)(−1) × 3 = 16 + 9 − 12 = 13.
- 5.Is Σ = [[1, 2], [2, 1]] a valid variance matrix?
Show step-by-step solution
- It is symmetric, but check a = (1, −1)′: a′Σa = 1 + 1 − 2 × 2 = −2.
- A variance cannot be negative, so Σ is not positive semidefinite and cannot be a variance matrix. (It implies a correlation of 2.)
Get the full module
The complete module adds every lesson, interactive graphs, a full problem set with step-by-step solutions, and a quiz. The academy opens in January 2027: join the waitlist for the founding price (lifetime access for $179).
Join the waitlist Try a full module free
More practice: free practice questions for this course.