Skip to main content

10. cvičení

\xdef\mcal#1{\mathcal{#1}} \xdef\scal#1#2{\langle #1, #2 \rangle} \xdef\N{\mathbb N} \xdef\R{\mathbb R} \xdef\Q{\mathbb{Q}} \xdef\Z{\mathbb{Z}} \xdef\D{\mathbb{D}} \xdef\bm#1{\boldsymbol{#1}} \xdef\vv#1{\mathbf{#1}} \xdef\vvp#1{\pmb{#1}} \xdef\floor#1{\lfloor #1 \rfloor} \xdef\ceil#1{\lceil #1 \rceil} \xdef\grad#1{\mathrm{grad} , #1} \xdef\ve{\varepsilon} \xdef\im#1{\mathrm{im}(#1)} \xdef\tr#1{\mathrm{tr}(#1)} \xdef\norm#1{\left\vert \left\vert #1 \right\vert\right\vert} \xdef\scal#1#2{\langle #1, #2 \rangle} \xdef\ex#1{\mathrm{E} ,\left( #1\right)} \xdef\exv#1{\mathrm{E}, \vv{#1}} \xdef\mtrx#1{\begin{pmatrix}#1\end{pmatrix}}

Scheffeho věta P([bT(Aβ^Aβ)]2mF1α(m,np)σ^2bTA(XTX)1ATb)=1α P\left([\vv b^T (A\hat\beta - A \beta)]^2 \leq m F_{1 - \alpha}(m, n - p) \hat \sigma^2 \vv b^T A (\vv X^T \vv X)^{-1} A^T \vv b\right) = 1 - \alpha bRm\forall b \in \R^m, je-li matice AA typu m×pm \times p plné hodnosti.

Příklad Yi=β0+β1HeightI+β2Sexi+β3(Height+Sex)i+εi,εN(0,σ2) Y_i = \beta_0 + \beta_1 \cdot \text{Height}_I + \beta_2 \cdot \text{Sex}_i + \beta_3 \cdot (\text{Height} + \text{Sex})_i + \ve_i, \quad \ve \sim N(0, \sigma^2) a chceme zkonstruovat 95% PS pro chlapce a dívky

1) Napíšeme tvar reg. křivky

  • d: y=β^0+β^1xy = \hat \beta_0 + \hat\beta_1 x
  • ch: y=β^0+β^2+(β^1+β^3)xy = \hat\beta_0 + \hat\beta_2 + (\hat \beta_1 + \hat \beta_3)x

2) Zvolíme vhodný tvar b\vv b a AA:

  • d: b=(1x)R2\vv b = \mtrx{1 \\ x} \in \R^2, pak (1x)(10000100)A(β^1β^2β^3β^4) \mtrx{1 & x} \overbrace{\mtrx{1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0}}^A \mtrx{\hat \beta_1 \\ \hat \beta_2 \\ \hat \beta_3 \\ \hat \beta_4}

  • ch: b=(1x)\vv b = \mtrx{1 \\ x}, pak (1x)(10100101)A(β^1β^2β^3β^4) \mtrx{1 & x} \overbrace{\mtrx{1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1}}^A \mtrx{\hat \beta_1 \\ \hat \beta_2 \\ \hat \beta_3 \\ \hat \beta_4}

Nejprve počítejme pro dívky, Označme bTA=xT=(1,x,0,0) \vv b^T A = \vv x^T = (1, x, 0, 0) 3) Odvodíme tvar pásu spolehlivosti (PS) P([xTβ^xTβy=β0+β1x]22F1α(2,n4)σ2xT(XTX)1x)=1α P\left([\vv x^T \hat \beta - \underbrace{\vv x^T \beta}_ {y = \beta_0 + \beta_1 x}]^2 \leq 2 F_ {1 - \alpha}(2, n - 4) \sigma^2 \vv x^T (\vv X^T \vv X)^{-1} \vv x \right) = 1 - \alpha kde yy je náhodná proměnná. Upravujme

P(xTβ^y2F1α(2,n4)σ2xT(XTX)1x)=1α P\left(|\vv x^T \hat \beta - y| \leq \sqrt{2 F_{1 - \alpha}(2, n - 4) \sigma^2 \vv x^T (\vv X^T \vv X)^{-1} \vv x} \right) = 1 - \alpha

  • pro xTβ^y>0\vv x^T \hat \beta - y > 0 dostáváme dolní hranici P(yxTβ^2F1α(2,n4)σ2xT(XTX)1x)=1α P\left(y \geq \vv x^T \hat \beta - \sqrt{2 F_{1 - \alpha}(2, n - 4) \sigma^2 \vv x^T (\vv X^T \vv X)^{-1} \vv x} \right) = 1 - \alpha
  • nebo pro xTβ^y<0\vv x^T \hat \beta - y < 0 dostáváme horní hranici P(yxTβ^+2F1α(2,n4)σ2xT(XTX)1x)=1α P\left(y \leq \vv x^T \hat \beta + \sqrt{2 F_{1 - \alpha}(2, n - 4) \sigma^2 \vv x^T (\vv X^T \vv X)^{-1} \vv x} \right) = 1 - \alpha