Ordinary Least Squares
Direct solution method - Ordinary Least Squares and the Line of Best Fit #
It is possible to compute the best parameters for linear regression in one shot (closed-form), instead of iteratively improving them step-by-step. fileciteturn34file10turn34file6
For linear regression, the direct method is usually Ordinary Least Squares (OLS).
Ordinary Least Squares (OLS) chooses the “best” line by minimising squared prediction errors.
Key takeaway: OLS defines “best fit” as the line that minimises the total squared residual error across all data points.