# 證明 $\hat{\beta_0},\ \hat{\beta_1}$ 的不同特性 ## Define * $S_{XX} = \Sigma^n_{i=1}(x_i - \overline{x})^2$ * $S_{YY} = \Sigma^n_{i=1}(y_i - \overline{y})^2$ * $S_{XY} = \Sigma^n_{i=1}(x_i - \overline{x})(y_i - \overline{y})$ ## Given * $\hat{\beta_1} = \Sigma^n_{i=1}\cfrac{(x_i - \overline{x})}{\Sigma^n_{j = 1}(x_j - \overline{x})^2} y_i = \Sigma^n_{i = 1}w_iy_i$ * $\hat{\beta_0} = \Sigma^n_{i=1} (\cfrac{1}{n} - \cfrac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}}) y_i = \Sigma^n_{i = 1}w_iy_i$ * $\Sigma^n_{i=1} Var(y_i) = \sigma^2$ * $\Sigma^n_{i=1} (x_i - \overline{x})(y_i - \overline{y}) = \Sigma^n_{i=1} (x_i - \overline{x})y_i$ ## Prove * $E(\hat{\beta_1}) =\ ?$ $\begin{aligned} E(\hat{\beta_1}) &= E(\Sigma^n_{i = 1}w_i \ y_i) = \Sigma^n_{i = 1} w_i (\beta_0 + \beta_1 x_i) \\ &= \beta_0 \ \color{blue}{\Sigma^n_{i = 1} \ w_i} + \beta_1 \ \color{green}{\Sigma^n_{i = 1} w_i x_i} \\ &= \beta_0 \cdot \color{blue}{0} + \beta_1 \cdot \color{green}{1} \\ &= \beta_1 \end{aligned}$ $\therefore E(\hat{\beta_1}) = \beta_1$ - $\color{blue}{藍色部分 \ \Sigma^n_{i = 1} \ w_i = \Sigma^n_{i = 1} \ \cfrac{(x_i - \overline{x})}{S_{XX}} = \cfrac{1}{S_{XX}} \underbrace{\Sigma^n_{i = 1}(x_i - \overline{x})}_{= \ 0}}$ - $\color{green}{綠色部分 \ {\Sigma^n_{i = 1} w_i x_i} = \Sigma^n_{i = 1} \ \cfrac{(x_i - \overline{x}) \cdot x_i}{S_{XX}} = \cfrac{1}{S_{XX}} \Sigma^n_{i = 1} \ {(x_i - \overline{x}) (x_i - \overline{x})} = \cfrac{S_{XX}}{S_{XX}} = 1}$ --- * $Var(\hat{\beta_1}) =\ ?$ $\begin{aligned} Var(\hat{\beta_1}) &= Var(\Sigma^n_{i = 1}w_iy_i) = \Sigma^n_{i = 1} w_i^2 \ Var(y_i) = \Sigma^n_{i = 1} w_i^2 \ \sigma^2 \\ &= \sigma^2 \ \Sigma^n_{i = 1}\cfrac{(x_i - \overline{x})^2}{(S_{XX})^2} = \cfrac{\sigma^2}{(S_{XX})^2} \ \underbrace{\Sigma^n_{i = 1} (x_i - \overline{x})^2}_{\ = \ S_{XX}} \\ &= \cfrac{\sigma^2}{(S_{XX})} \end{aligned}$ $\therefore Var(\hat{\beta_1}) = \cfrac{\sigma^2}{(S_{XX})}$ --- * $E(\hat{\beta_0}) =\ ?$ $\begin{aligned} E(\hat{\beta_0}) &= E(\Sigma^n_{i = 1}w_i \ y_i) = \Sigma^n_{i = 1} w_i (\beta_0 + \beta_1 x_i) \\ &= \beta_0 \ \color{blue}{\Sigma^n_{i = 1} \ w_i} + \beta_1 \ \color{green}{\Sigma^n_{i = 1} w_i x_i} \\ &= \beta_0 \cdot \color{blue}{1} + \beta_1 \cdot \color{green}{0} \\ &= \beta_0 \end{aligned}$ $\therefore E(\hat{\beta_0}) = \beta_0$ - $\color{blue}{\begin{aligned} 藍色部分 \ \Sigma^n_{i = 1} \ w_i &= \Sigma^n_{i = 1} \left[\ \cfrac{1}{n} - \cfrac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}} \ \right] = \Sigma^n_{i = 1} \cfrac{1}{n} - \Sigma^n_{i = 1} \cfrac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}} \\ &= 1 - \cfrac{\overline{x}}{S_{XX}} \underbrace{\Sigma^n_{i = 1}(x_i - \overline{x})}_{= \ 0} = 1 \end{aligned} }$ - $\color{green}{\begin{aligned} 綠色部分 \ {\Sigma^n_{i = 1} w_i x_i} &= \Sigma^n_{i = 1} \left[\ (\cfrac{1}{n} - \cfrac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}}) \cdot x_i \ \right] = \cfrac{1}{n} \Sigma^n_{i = 1} x_i - \cfrac{\overline{x}}{S_{XX}} \underbrace{\Sigma^n_{i = 1} \left[\ (x_i - \overline{x}) \cdot x_i \ \right]}_{= \ S_{XX}} \\ &= \overline{x} - \overline{x} = 0 \end{aligned} }$ --- * $Var(\hat{\beta_0}) =\ ?$ $\begin{aligned} Var(\hat{\beta_0}) &= Var(\Sigma^n_{i = 1}w_iy_i) = \Sigma^n_{i = 1} w_i^2 \sigma^2 = \sigma^2 \cdot \Sigma^n_{i = 1}(\cfrac{1}{n} - \cfrac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}})^2 \\ &\overset{將 \ w_i^2 \ 拆開}{=} \sigma^2 \left[\ \color{blue}{\Sigma^n_{i = 1} \frac{1}{n^2}} - \color{green}{2 \cdot \frac{1}{n} \cdot \Sigma^n_{i = 1} \frac{(x_i - x) \cdot \overline{x}}{S_{XX}}} + \color{purple}{\Sigma^n_{i = 1} (\frac{(x_i - \overline{x}) \cdot \overline{x}}{S_{XX}})^2} \ \right] \\ &= \sigma^2 \left[\ \color{blue}{\frac{1}{n}} - \color{green}{0} + \color{purple}{\frac{\overline{x}^2}{S_{XX}}} \ \right] \end{aligned}$ $\therefore Var(\hat{\beta_0}) = \sigma^2 \left[\ \frac{1}{n} + {\frac{\overline{x}^2}{S_{XX}}} \ \right]$ - $\color{green}{綠色部分 = \cfrac{2}{n} \times \cfrac{\overline{x}}{S_{XX}} \times \underbrace{\Sigma_{i = 1}^n (x_i - \overline{x})}_{= \ 0} = 0}$ - $\color{purple}{紫色部分 = \cfrac{1}{S_{XX}^2} \times {\Sigma_{i = 1}^n \left[\ (x_i - \overline{x}) \cdot \overline{x} \ \right]^2} = \cfrac{\overline{x}^2}{S_{XX}^2} \times S_{XX} = {\cfrac{\overline{x}^2}{S_{XX}}}}$