Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How to derive the equations in 3:19-3:30 provide in a MIT opencourse ware lecture about the least square method?

Link: http://www.youtube.com/watch?v=YwZYSTQs-Hk

Thanks in advance!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Suppose that you have a collection of data points $(x_i,y_i)$ and you are trying to optimize the parameters of a line $y=ax+b$ to get the best fit, where we're defining best fit to mean least squares. Then we want to minimize

$$\sum_i (ax_i+b-y_i)^2 $$

This will happen when the partial derivatives with respect to both $a$ and $b$ are zero. If we take the partial derivative with respect to $a$, we obtain

$$2\sum_i (ax_i+b-y_i)x_i=0$$

and if we take the partial with respect to $b$ we obtain

$$2\sum_i (ax_i+b-y_i)=0$$.

The equations on the board are just these rewritten.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.