The previous post considered the problem of finding the line that best fits a set of points in the plane, with the additional restriction that the points' center of mass was at the origin.
This post will consider points without any restrictions, but the line, however, must pass through the origin.
Let the points be given as for , where is the number of points. We will furthermore require that not all are equal to zero or, equivalently, that .
Again, we will look for a least squares definition of best. So we seek a line that minimizes the following error function:
To find the stationary point of , we set the partial derivative with respect to to zero:
In conclusion, we have
Note how this is the exact same slope as the case where the center of mass was at the origin.