1. Simple linear regression
The model is . Ordinary least squares (OLS) picks to minimise the residual sum of squares Setting both partial derivatives to zero gives
Key facts:
- The fitted line always passes through .
- Equivalently , where is the correlation; the slope has the sign of .
- With an intercept, the residuals sum to zero and are uncorrelated with .
- In simple regression .
- Swapping the roles of and gives a different line (slope ) unless .
Interpretation: is the change in predicted for a one-unit increase in . Predicting far outside the range of the training (extrapolation) is unreliable.