# Homework Help: Caclulus III problem involving mean.

1. Apr 27, 2014

### saintkickass

http://i.imgur.com/DkYMylb.png, probably easier to understand than me trying to type it out.

so far I tried exapanding the (y_i - y(x_i))^2 and and then subbing in y_i = ax + b. This gives me part of the answer but i'm not sure if it's legal. I'm generally struggling to find a workable relationship between yi, y and y(bar), same for x.

If nothing else, I could use some clarification as to what the y is (y_i - y(x_i))^2. I thought maybe it was like f(x) but if that's not the case, what would it be if not y_i?

Last edited: Apr 27, 2014
2. Apr 27, 2014

### HallsofIvy

The problem is to find the equation of the straight line, y= ax+ b, that is "closest" (in the "least squares" sense) to the given point. That is what "$y(x_i)$" is: the value of that function at $x_i$. $y(x_i)= ax_i+ b$.

No, you do not substitute $ax+ b$ for $y_i$. "$y_i$" is the given y value of the ith point.

3. Apr 27, 2014

### Ray Vickson

It is saying that $E(a,b) = \sum_{i=1}^n ( y_i - a - b x_i)^2.$

4. Apr 27, 2014

### LCKurtz

It is not asking you to find the line of best fit. Just expand $E(a,b)$ out, use the definition of $\bar z$ (for $z$ whatever variable you need) and see if you don't get the answer. (Also note that Ray inadvertently left off the $\frac 1 n$ in his formula above in post #3 $E(a,b) =\color{red}{\frac 1 n} \sum_{i=1}^n ( y_i - a - b x_i)^2$).

Last edited: Apr 27, 2014