- Mean, variance, and covariance of the least-squares estimators, derived via covariance bilinearity.
Concepts
- Once we fit a line, and are just numbers for the sample we happened to observe.
- But before the sample is observed, the responses are random — a different sample would give different numbers.
- That makes the estimators random variables too, with their own mean, variance, and distribution.
- This is exactly where the standard errors used later in inference come from.
- The model assumptions that everything below relies on:
- The predictor values are treated as fixed, known constants — not random.
- , with and , and the errors independent of each other.
- These assumptions carry over directly to : , , and independent for .
- The key move: rewrite the slope as a weighted sum of the responses, since that makes every property below easy to derive.
- Start from the familiar formula .
- Expand the numerator: .
- The part of that expansion drops out, because — leaving .
- Define a fixed weight for each observation: — fixed because it only depends on the (non-random) ‘s.
- That gives — the slope written as a weighted sum of the random ‘s, with fixed weights.
- This is the whole reason the trick exists: once is a weighted sum of the ‘s, every property below follows from ordinary rules for linear combinations of random variables, instead of fighting with directly.
- Three facts about the weights get used repeatedly below — each is just algebra on the definition of .
- , since .
- — write , expand, and the term vanishes, leaving .
- — direct from squaring and summing.
- The slope estimator is unbiased: on average, across repeated samples, centers on the true .
- Take the expectation of the weighted-sum form: .
- Substitute : .
- Using the two facts above, and : .
- So .
- The variance of the slope measures how much would bounce around from one sample to the next.
- Since the are independent, variance distributes over the sum without any cross terms: .
- Every has the same variance , so this is .
- Using the third fact, : .
- Click point: a bigger spread in the -values means a larger , which means a smaller variance — spreading your ‘s out gives the slope estimate more leverage to be pinned down precisely.
- The intercept can be rewritten as a weighted sum too, the same way the slope was.
- Start from .
- Substitute and and collect terms: .
- Define , so — same trick, new weights.
- The intercept estimator is unbiased too, by the same kind of argument.
- Using the simpler form : .
- (the average of the model’s mean response), and from above.
- So .
- Covariance between two weighted sums follows four bilinearity rules, which every proof from here on leans on.
- Constants pull outside: .
- Covariance distributes over a sum, the same way multiplication distributes over addition.
- Covariance of something with itself is just its variance: .
- Independent random variables have covariance — so for independent , , since every cross term with vanishes.
- An intermediate result, , makes the next two proofs simple.
- Write both as weighted sums: and .
- By independence, .
- Using from above, this is .
- The variance of the intercept follows from the usual variance-of-a-difference formula, now that the covariance piece is known.
- .
- The covariance term is (just shown), and since the are independent with common variance.
- So .
- The covariance between the intercept and slope — the bilinearity proof itself.
- Start from , and take the covariance of both sides with : .
- The first term is (shown above), and the second term is just .
- So .
- Sanity check: if , the covariance is negative — tilting the slope up forces the intercept down so the line can still pass through .
- Once errors are assumed normal, the estimators have a known sampling distribution, which is what makes -based inference exact in small samples.
- Linear combinations of jointly normal variables are themselves normal, and are both linear combinations of the ‘s.
- So and .
- In practice is never actually known, so one more substitution is needed before any of this is usable.
- Estimate it with .
- Replace by inside each standard deviation above: and .
- That substitution is also what changes the reference distribution from normal to in the inference formulas later.
Practice Problems
-
Problem 1 (HW1 Q2). Derive using bilinearity rather than memorizing it. Write it the way you would on the exam — the Concepts section above has the fully justified version; this is the fast, exam-pace version of the same derivation.
- Solution.
- (shown earlier via )
- Solution.
-
Problem 2 — verify a real printed standard error (Production data, ). The production data (
RunTime ~ RunSize) has and R reports and a slope standard error of . Using with in place of the unknown , verify this printed value by hand.- Solution.
- — matches R’s printed
Std. Errorexactly
- Solution.