2.2.7 · D1Linear & Logistic Regression

Foundations — Assumptions of linear regression

2,683 words12 min readBack to topic

Before you can judge whether an assumption holds, you must be fluent in the alphabet the topic speaks. We go symbol by symbol. Each entry: plain words → the picture → why the topic needs it. Nothing is used before it is built.


1. The data: points on a grid

The picture: dots scattered on a 2-D grid. Horizontal axis = , vertical axis = . Observation is one dot at position .

Why the topic needs it: every assumption is a statement about these dots and the line we run through them. No dots, nothing to assume.

Figure — Assumptions of linear regression

2. The true line vs the fitted line: vs

There are two straight lines in this whole subject, and telling them apart is the single most important habit.

Two symbols to picture, both just numbers we compute from the data:

  • (say "beta-nought-hat") = the estimated intercept. Where our line crosses the vertical axis, i.e. the prediction when . In the picture, the height of the line's left anchor.
  • (say "beta-one-hat") = the estimated slope. How many units climbs each time goes up by one — the steepness, rise over run.

Why the topic needs it: the estimated intercept and slope are the thing regression computes. When the parent note works with , those bare 's are the true parameters the model assumes exist; the fitting procedure hands us the hatted estimates — see §7.

Fitting this line by minimizing squared gaps is exactly Ordinary Least Squares (OLS).

Figure — Assumptions of linear regression

3. The error and the residual: and

This is the heart of every assumption. There are two gap-symbols and beginners mix them up — and they line up exactly with the two lines of §2.

The picture: for each dot, draw a short vertical stick from the dot down (or up) to the fitted line. The length of that stick is the residual . A dot above the line has ; a dot below has ; a dot exactly on the line has .

Why the topic needs it: all four LINE assumptions are rules about . We check them using .

Figure — Assumptions of linear regression

4. Expectation and the zero-mean rule:

The picture: imagine the vertical spread of dots at one fixed . They bounce around, but they have a centre of mass. That centre is — "the average , given that is this value."

Why the topic needs it: the Linearity assumption is exactly i.e. "the centre of the -cloud, for each , lies on nature's straight line." Individual dots scatter; only their average is required to be linear.


5. Variance and : how wide the scatter is

The picture: two clouds of dots. A tight cloud has small ; a fat cloud has large . Variance is the "thickness" of the band.

Why the topic needs it: constant is what lets the parent's variance formula collapse to the clean .

Figure — Assumptions of linear regression

6. Covariance and the uncorrelated-errors rule:

The picture: plot against the next error . If the points form a tilted sausage, they're correlated (bad). If they form a shapeless round blob, covariance (good) — though a blob shaped like a ring would also have zero covariance while clearly not being independent.

Why the topic needs it: the Independence assumption of OLS is, strictly, the uncorrelated-errors condition for (this is what Gauss–Markov actually requires). Time-series and repeated-measures data break it, which is why the parent points you to generalized least squares (GLS) — an OLS cousin that lets errors have known correlations — or mixed models.


7. Going multi-dimensional: vectors, matrices, ,

The parent jumps to . Let's earn every piece.

  • (transpose) = flip the table on its side: rows become columns. Picture rotating the grid 90°.
  • = a small square matrix summarising how the predictor columns relate to each other — a "correlation-flavoured" summary.
  • (inverse) = the matrix version of "divide". Just as blows up when , the inverse blows up when is nearly flat (tiny determinant).

Why the topic needs it: the No-Multicollinearity assumption and the ridge fix (Ridge and Lasso Regression) are both about keeping safely away from zero.


8. The normal curve

The picture: a smooth symmetric hill over the residual sticks — most cluster near zero, tapering both ways. A Q-Q plot compares your actual residuals to this ideal bell; if they match, points lie on the 45° line.

Why the topic needs it: normality is what licenses the -tests and -tests of Hypothesis Testing in Regression. For prediction alone it's optional; the Bias-Variance Tradeoff and Gauss–Markov guarantee unbiasedness without it. It is also the bridge (from §6) that upgrades uncorrelated errors into independent ones.


Prerequisite map

Data points x_i y_i

True line beta and fitted line betahat

Residual e_i equals y minus yhat

Expectation and zero mean error

Variance sigma squared

Covariance uncorrelated errors

Normal bell curve

Matrix X and X transpose X

Determinant and inverse

Assumptions of Linear Regression

Everything above pours into the parent: the five assumptions. Related destinations: Generalized Linear Models (GLMs) generalises the bell-curve assumption to other distributions.


Equipment checklist

Self-test: can you say each answer before revealing it?

What does the subscript mean?
A name tag for observation number — nothing more.
What is the difference between lowercase and capital ?
is one measured number sitting in the table; is the random-variable view — the whole cloud of possible outcomes before any dot lands.
What is the difference between and ?
is nature's true (unknown) slope; is our estimate of it, computed from the data. Truth wears no hat, guesses do.
What is the difference between and ?
is the true unseen error from nature's line; is the observable residual from our fitted line.
What does control in the picture?
The slope of our fitted line — how steep it is, the rise in per unit rise in .
What does describe geometrically?
The centre of mass (average) of the -cloud at a fixed ; linearity says these centres lie on a straight line.
State the zero-mean error assumption and its picture.
— at every the residual sticks average to zero, so the line runs through the middle of the cloud.
Why do we square distances to get variance?
So that gaps above and below the mean don't cancel out, and so that larger gaps are penalised more heavily than small ones.
Does mean the errors are independent?
No — it only rules out a linear relationship (uncorrelatedness). Independence is stronger; the two coincide only when the errors are jointly normal.
What does GLS stand for and when do you reach for it?
Generalized Least Squares — the OLS cousin used when errors are correlated or have unequal variance.
When does blow up, and what is that called?
When (predictor columns nearly parallel) — multicollinearity.
What does claim about the shape of the errors?
They follow a symmetric bell curve centred at zero with constant spread .