2025-10-04 11:06 Tags:

OLS Regression

We want to fit a line:

by minimizing the sum of squared residuals:


Step 1: Minimize w.r.t. α

Take derivative:


Step 2: Minimize w.r.t. β

Take derivative:

Substitute :

So the slope is:


Step 3: Intuition

  • Numerator:

    → measures how much and move together.

  • Denominator:

    → measures how spread out is.

  • Therefore: