We have a linear model `f(x) = ax+b`

and want to minimise the sum of squares of the errors `(y - (ax+b))^2` given data

`(x,y) =` (1,2),(3,4),(4,5)

Rewrite the model as

`f(x) = a(x-bar(x)) + b_1` where `b_1 = b + abar(x)`

Then the least-squares estimate of `b_1` is `bar(y)`

So `hat(b_1) = (2+4+5)/3 = 11/3`

The least-square estimate of `a` is given by

`hat(a) = (Sigma_1^n(x_i-bar(x))(y_i-bar(y)))/(Sigma_1^n((x_i-barx)^2)) = ((1-8/3)(2-11/3)+(3-8/3)(4-11/3)+(4-8/3)(5-11/3))/((1-8/3)^2+(3-8/3)^2+(4-8/3)^2) `

`= (14/3)"/"(14/3) = 1`

Therefore the least-square estimate of `b` is given by

`hat(b_1) -hat(a)bar(x) = 11/3-(1)8/3 = 3/3 = 1`

**least squares estimates are a=1, b=1**

## See eNotes Ad-Free

Start your **48-hour free trial** to get access to more than 30,000 additional guides and more than 350,000 Homework Help questions answered by our experts.

Already a member? Log in here.