---
# System prepended metadata

title: 迴歸分析作業03

---

# 迴歸分析作業03


:::success
**Homework**
證明：
**1.** $\Sigma{x_i}$${e_i}$=0
**2.** $E(\Sigma{e_i^2}$)= (${n-2}$)$\sigma^2$
:::
<font size=4>**1.**$\Sigma$${x_i}$${e_i}$
=$\Sigma$${x_i}$($y_i$-$\hat{y_i}$)
=$\Sigma$${x_i}$($y_i$-($\hat{\beta_0}$+$\hat{\beta_1}$${x_i}))$
=$\Sigma$$x_i$$y_i$-$\Sigma$$\hat{\beta_0}$${x_i}$-$\Sigma$$\hat{\beta_1}$${x_i}^2$
=$\Sigma$$x_i$($\hat{\beta_0}$+$\hat{\beta_1}$${x_i}$)-$\Sigma$$\hat{\beta_0}$${x_i}$-$\Sigma$$\hat{\beta_1}$${x_i}^2$
=$\Sigma$$\hat{\beta_0}$$x_i$+$\Sigma$$\hat{\beta_1}$${x_i^2}$-$\Sigma$$\hat{\beta_0}$${x_i}$-$\Sigma$$\hat{\beta_1}$${x_i}^2$
=${0}$

<font size=4>**2.** $E(\Sigma{e_i^2}$)
(Def：$\Sigma{e_i^2}(殘差平方和)$=${SSE}$
=${SST}$-${SSR}$=${S_{yy}}$-$\hat{\beta_1}^2$${S_{xx}}$=$\Sigma$(${y_i}$-$\overline{y})^2$-$\hat{\beta_1}^2$${S_{xx}}$=$\Sigma$${y_i}^2$-$n\overline{y}^2$-$\hat{\beta_1}^2{S_{xx}}$)
=$E(\Sigma$${y_i}^2$-$n\overline{y}^2$-$\hat{\beta_1}^2{S_{xx}}$)
=$\Sigma$$E({y_i}^2)$-$nE(\overline{y}^2)$-${S_{xx}}E(\hat{\beta_0}^2)$
=$\Sigma$($V({y_i})$+$(E({y_i}))^2$-$n(V(\overline{y})+(E(\overline{y}))^2)$-${S_{xx}}(V(\hat{\beta_1})$+$(E(\hat{\beta_1}))^2)$
(註：$E(x^2)$=$V(x)$+$(E({x}))^2$)
=$\Sigma$($\sigma^2$+$({\beta_0}$+${\beta_1}x_i)^2)$-$n(\frac{\sigma^2}{n}$+$({\beta_0}$+${\beta_1}\overline{x})^2)$-${S_{xx}}(\frac{\sigma^2}{S_{xx}}$+${\beta_1}^2)$
=$n\sigma^2$+$\Sigma({\beta_0}$+${\beta_1}x_i)^2$-$\sigma^2$-${n}$$({\beta_0}$+${\beta_1}\overline{x})^2$-${\sigma^2}$-${{\beta_1}^2S_{xx}}$
=$(n$-$2)\sigma^2$+$\Sigma({\beta_0}$+${\beta_1}x_i^2)$-${n}$$({\beta_0}$+${\beta_1}\overline{x})^2$-${{\beta_1}^2S_{xx}}$
(Prove：$\Sigma({\beta_0}$+${\beta_1}x_i)^2$-${n}$$({\beta_0}$+${\beta_1}\overline{x})^2$-${{\beta_1}^2S_{xx}}$=${0}$)
$\Sigma({\beta_0}$+${\beta_1}x_i)^2$-${n}$$({\beta_0}$+${\beta_1}\overline{x})^2$-${{\beta_1}^2S_{xx}}$
=$n{\beta_0}^2$+2${\beta_0}{\beta_1}\Sigma(x_i)$+${\beta_1}^2\Sigma(x_i)^2$-$n{\beta_0}^2$-$2n{\beta_0}{\beta_1}\overline{x}$-$n{\beta_1}^2(\overline{x})^2$-${\beta_1}^2\Sigma(x_i$-$\overline{x})^2$
(註：$\frac{\Sigma(x_i)}{{n}}$=$\overline{x}$ & $\frac{\Sigma(x_i)^2}{{n}^2}$=$\overline{x}^2$)
=${\beta_1}^2\Sigma(x_i)^2$-$\frac{1}{{n}}{\beta_1}^2\Sigma(x_i)^2$-${\beta_1}^2\Sigma(x_i$-$\overline{x})^2$
=${\beta_1}^2(\Sigma(x_i)^2$-$\frac{\Sigma(x_i)^2}{n}$-$\Sigma(x_i)^2$+$n\overline{x}^2$)
=${\beta_1}^2($-$\frac{\Sigma(x_i)^2}{n}$+$n\frac{\Sigma(x_i)^2}{{n}^2}$)
=${\beta_1}^2({0})$
=${0}$


