The least squares principle
Summary
Setup
- Given data x1,x2,…,xn and y1,y2,…,yn and a linear trendline
y=b1+b2x
- where b1 and b2 are arbitrary constants , the residuals ei will depend on b1 and b2 .
- Therefore, RSS will depend on b1 and b2 .
Least squares principle:
Select b1 and b2 such that RSS is minimized
- The problem
minb1,b2RSS=minb1,b2n∑i=1e2i
- is called the least squares problem . The solution is given by the OLS formulas:
b2=∑ni=1(xi−¯x)(yi−¯y)∑ni=1(xi−¯x)2
b1=¯y−b2¯x