2
$\begingroup$

So here's the question:

Given a collection of points $(x_1,y_1), (x_2,y_2),\ldots,(x_n,y_n)$, let $x=(x_1,x_2,\ldots,x_n)^T$, $y=(y_1,y_2,\ldots,y_n)^T$, $\bar{x}=\frac{1}{n} \sum\limits_{i=1}^n x_i$, $\bar{y}=\frac{1}{n} \sum\limits_{i=1}^n y_i$.
Let $y=c_0+c_1x$ be the linear function that gives the best least squares fit to the points. Show that if $\bar{x}=0$, then $c_0=\bar{y}$ and $c_1=\frac{x^Ty}{x^Tx}$.

I've managed to do all the problems in this least squares chapter but this one has me completely and utterly stumped. I'm not entirely sure what the question is even telling me in terms of information nor do I get what it's asking. Any ideas on where to start?

  • 0
    Start by representing mathematically what it means that this linear function is the best least squares fit. Best in what sense? what is it minimizing? etc...2012-10-14
  • 0
    @Bitwise is it the error?2012-10-14
  • 0
    yes, the regression line is minimizing the squared error right? meaning that for each data point, there is a matching point on the line, and the squared distance between them should be minimal. Try writing that down explicitly.2012-10-14
  • 0
    @Bitwise okay I understand but i'm not really following on how to write that down explicitly2012-10-14
  • 0
    @CharlieYabben You sure the formula for $\hat c_1$ in the question is correct?2013-04-01
  • 0
    @TongZhang Your edit to replace the wrong denominators by $n$ is allright but the other edit replacing $c_0$ and $c_1$ by $\bar c_0$ and $\bar c_1$ is just unneeded.2013-04-01
  • 0
    @TongZhang Don't. Leave the post as it is, unless something is mathematically wrong in it.2013-04-01

2 Answers 2