(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

http://www.math.tamu.edu/~vargo/courses/251/HW7.pdf [Broken]

Given a set of points (xi,yi) and assuming f(xi) is linear, the deviation measured is F(m,b)=[itex]\sum_{i}^{n}(y_i - f(x_i))^2[/itex]. There are a few different questions about this from the link above.

3. The attempt at a solution

I'm not sure why the expression [itex]\sum_{i}^{n}(y_i - f(x_i))^2[/itex] is squared.

Part one says to find the partials of this expression with respect to m and b. Here's my take on it. [itex]y_i[/itex] comes from the set of points, and [itex]f(x_i)[/itex] would be equal to [itex]mx_i+b[/itex].

Using the chain rule,

[itex]\frac{\partial F}{\partial m} = \sum_i^n 2x_i(y_i-(mx_i+b))[/itex]

[itex]\frac{\partial F}{\partial b} = \sum_i^n 2(y_i-(mx_i+b))[/itex]

Are these correct?

I can kind of see where this question is going. We can use these derivatives to sort of find the 'best fit', I'm guessing where the change in deviation is zero, that is probably the minimum deviation.

Sooo, dF. Does he mean both of the partials? Either one? Or are my expressions wrong to begin with. I haven't got any real experience with the summing notation, but I took a stab at solving for b by setting dF/db = 0.

[itex]b=\frac{\sum_i^n 2(y_i - mx_i)}{2n}[/itex]

That was just kind of a shot in the dark. If someone could give me a push in the right direction I'd appreciate it! Thanks :)

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Least Squares Regression

**Physics Forums | Science Articles, Homework Help, Discussion**