Classical ML

Assumptions of Linear Regression

Evaluating the core mathematical assumptions required for unbiased Ordinary Least Squares regression.

🟡 intermediate5 min readsupervised
Linear Regression using Ordinary Least Squares (OLS) relies on key statistical assumptions for valid parameter inference. Core assumptions include Linearity between features and target, Independence of error residuals, Homoscedasticity (constant residual variance), and Normality of residuals. Violating these assumptions introduces coefficient bias, invalidates p-values and confidence intervals, and requires diagnostic fixes like log transforms or Robust Standard Errors.

The OLS Regression Assumptions

Ordinary Least Squares (OLS) Linear Regression is the workhorse of statistical modeling:

$$Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \dots + \beta_p X_p + \epsilon$$

However, the Gauss-Markov Theorem proves OLS is the Best Linear Unbiased Estimator (BLUE) ONLY when specific mathematical assumptions hold.

Violating these assumptions invalidates p-values, standard errors, and confidence intervals.

┌──────────────────────────┬──────────────────────────┬──────────────────────────┬──────────────────────────┐
│ 1. LINEARITY             │ 2. INDEPENDENCE          │ 3. HOMOSCEDASTICITY      │ 4. NORMALITY OF ERRORS   │
├──────────────────────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┤
│ Relationship between X   │ Errors ε_i are un-       │ Variance of errors ε_i   │ Residual errors ε_i follow│
│ and Y is linear.         │ correlated across rows.  │ is constant across X.    │ Normal Distribution N(0, σ2)│
└──────────────────────────┴──────────────────────────┴──────────────────────────┘

Detailed Breakdown & Diagnostic Checks

1. Linearity

The expected value of $Y$ is a linear combination of parameters $\beta$.

2. Independence of Errors (No Autocorrelation)

Residual errors $\epsilon_i$ and $\epsilon_j$ must be independent.

3. Homoscedasticity (Constant Error Variance)

The variance of residual errors $\text{Var}(\epsilon_i \mid X) = \sigma^2$ must remain constant across all feature levels.

  HOMOSCEDASTICITY (GOOD):                 HETEROSCEDASTICITY (BAD - FUNNEL SHAPE!):
  Residuals                                Residuals
    │  •   •  •  •  •  •                     │                 •   •   •
  0 ┼───────────────────────               0 ┼───────── •  •  •  •   •   •   •
    │  •   •  •  •  •  •                     │                 •   •   •
    └───────────────────────► Fitted Values  └───────────────────────► Fitted Values

4. Normality of Residual Errors

Residual errors $\epsilon \sim \mathcal{N}(0, \sigma^2)$ must follow a Normal Distribution.

5. No Multicollinearity

Predictor features $X_i$ must not be perfectly linearly correlated with each other.

Say this out loud

Ordinary Least Squares regression relies on Linearity, Independence of errors, Homoscedasticity, and Normality of residuals. Linearity requires straight relationships. Independence requires uncorrelated errors checked via Durbin Watson. Homoscedasticity requires constant residual variance, while Normality ensures valid p values and confidence intervals.

Followups to expect

  1. What happens to OLS coefficients if the Normality assumption is violated for large N? According to the Central Limit Theorem, for large sample sizes ($N > 100$), non normal residuals do not invalidate coefficient point estimates or hypothesis tests.
  2. Does Homoscedasticity violation cause coefficient bias? No! Heteroscedasticity does not bias point estimates $\hat{\beta}$, but it corrupts standard error calculations, producing wrong p-values and confidence intervals.

Check yourself

Question 1 of 3

What diagnostic test or plot checks the Homoscedasticity (constant error variance) assumption in OLS regression?

More in Classical ML

See all →
Bias–Variance Tradeoff4 minOverfitting vs Underfitting3 minLinear Regression4 min