回復 11# mcgrady0628 的帖子
計算證明題第 2 題:
令 \(f(x)=2x^3-3(k+1)x^2+6kx-2k\),則
\(f\,'(x)=6x^2-6(k+1)+6k=6(x-k)(x-1)\)
\(f\,'(x)=0\) 之兩根為 \(x=k\) 或 \(x=1\)
因為 \(f(x)=0\) 有三相異實根,所以 \(f(k)f(1)<0\)
\(\Leftrightarrow -(k-2)(k-1)^2k<0\)
\(\Leftrightarrow k>2\) 或 \(k<0\)
計算證明題第 3 題:
因為 \(\overline{X}=\overline{Y}=0\),所以 \(\displaystyle \sum_{k=1}^nx_i=\sum_{k=1}^ny_i=0\)
且因為 \(\sigma_x=\sigma_y=1\),所以 \(\displaystyle \sum_{k=1}^nx_i^2=\sum_{k=1}^ny_i^2=n\)
令 \(f(x)=a+bx\)
則
殘差平方和=\(\displaystyle \sum_{k=1}^n\left(y_i-f(x_i)\right)^2\)
\(\displaystyle =\sum_{k=1}^n\left(y_i-a-bx_i\right)^2\)
\(\displaystyle =\sum_{k=1}^n\left(y_i^2+a^2+b^2x_i^2-2ay_i+2abx_i-2bx_iy_i\right)\)
\(\displaystyle =\sum_{k=1}^n y_i^2+na^2+b^2\sum_{k=1}^n x_i^2-2a \sum_{k=1}^n y_i+2ab \sum_{k=1}^n x_i-2b\sum_{k=1}^n x_iy_i\)
\(\displaystyle =n+na^2+nb^2-2b\sum_{k=1}^n x_iy_i\)
\(\displaystyle =n+na^2+n\left(b-\frac{\displaystyle\sum_{k=1}^n x_iy_i}{n}\right)^2-\frac{\displaystyle\left(\sum_{k=1}^n x_i y_i\right)^2}{n}\)
\(\displaystyle \geq n-\frac{\displaystyle\left(\sum_{k=1}^n x_i y_i\right)^2}{n}\)
當殘差平方和有最小值時,\(a=0\) 且 \(\displaystyle b=\frac{\displaystyle\sum_{k=1}^n x_iy_i}{n}\)
因為 \((x_i,y_i),i=1,2,\cdots n\) 為已標準化數據,因此 \(\displaystyle b=\frac{\displaystyle\sum_{k=1}^n x_iy_i}{n}=r\)
亦即當 \(f(x)=rx\) 時,殘差平方和為最小,
可得 \(Y\) 對 \(X\) 的迴歸直線為 \(y=rx.\)