Need help with the algebra that derive the beta 1 and beta 2 formula

615 Views Asked by At

No matter how hard I tried, I can't seem to get the equation

$\sum y-(\sum x)\hat\beta_{1}=n\hat\beta_{0}$

I started by$\frac{\hat\beta_{0}}{\hat\beta_{1}}$

then I ended with

with $-\frac{\sum x}{n}$

Please give me some hint

enter image description here

1

There are 1 best solutions below

3
On

Assume that $Y_{i}=\beta_0 + \beta_1x_i + \epsilon_i$. $i=1,...,n$, so

$$ S(\beta) = \sum_{i=1}^n (Y_i - \beta_0 - \beta_1x_i)^2,$$ derivation w.r.t. $\beta_0$ yields $$ \frac{\partial}{\partial\beta_0}S(\hat{\beta_0})= -2\sum(Y_i - \hat{\beta}_0 - \hat{\beta}_1x_i)=0, $$ or equivalently $$ \sum Y_i - n\hat{\beta}_0-\hat{\beta}_1\sum x_i=0 \, . $$