diff --git a/exercises-pdf/ex_advriskmin_1.pdf b/exercises-pdf/ex_advriskmin_1.pdf index 99962aed..e82921c4 100644 Binary files a/exercises-pdf/ex_advriskmin_1.pdf and b/exercises-pdf/ex_advriskmin_1.pdf differ diff --git a/exercises-pdf/ex_advriskmin_2.pdf b/exercises-pdf/ex_advriskmin_2.pdf index c3b5b7fa..72bdfb8c 100644 Binary files a/exercises-pdf/ex_advriskmin_2.pdf and b/exercises-pdf/ex_advriskmin_2.pdf differ diff --git a/exercises-pdf/ex_advriskmin_3.pdf b/exercises-pdf/ex_advriskmin_3.pdf index f1355f67..f90e2fac 100644 Binary files a/exercises-pdf/ex_advriskmin_3.pdf and b/exercises-pdf/ex_advriskmin_3.pdf differ diff --git a/exercises-pdf/ic_advriskmin_1.pdf b/exercises-pdf/ic_advriskmin_1.pdf index 7e783667..993b249a 100644 Binary files a/exercises-pdf/ic_advriskmin_1.pdf and b/exercises-pdf/ic_advriskmin_1.pdf differ diff --git a/exercises-pdf/ic_sol_advriskmin_1.pdf b/exercises-pdf/ic_sol_advriskmin_1.pdf index 9c4619a9..660a2020 100644 Binary files a/exercises-pdf/ic_sol_advriskmin_1.pdf and b/exercises-pdf/ic_sol_advriskmin_1.pdf differ diff --git a/exercises-pdf/sol_advriskmin_1.pdf b/exercises-pdf/sol_advriskmin_1.pdf index 0bf27eed..6e120f5f 100644 Binary files a/exercises-pdf/sol_advriskmin_1.pdf and b/exercises-pdf/sol_advriskmin_1.pdf differ diff --git a/exercises-pdf/sol_advriskmin_2.pdf b/exercises-pdf/sol_advriskmin_2.pdf index 529fcbc5..a15e4e00 100644 Binary files a/exercises-pdf/sol_advriskmin_2.pdf and b/exercises-pdf/sol_advriskmin_2.pdf differ diff --git a/exercises-pdf/sol_advriskmin_3.pdf b/exercises-pdf/sol_advriskmin_3.pdf index eec35a19..ad6be49f 100644 Binary files a/exercises-pdf/sol_advriskmin_3.pdf and b/exercises-pdf/sol_advriskmin_3.pdf differ diff --git a/exercises/advriskmin/ex_rnw/sol_generalized_l2_loss.Rnw b/exercises/advriskmin/ex_rnw/sol_generalized_l2_loss.Rnw index 45acebf2..8063e005 100644 --- a/exercises/advriskmin/ex_rnw/sol_generalized_l2_loss.Rnw +++ b/exercises/advriskmin/ex_rnw/sol_generalized_l2_loss.Rnw @@ -29,7 +29,34 @@ $$\fxh = m^{-1}\left( \frac1n \sum_{i=1}^n m(\yi) \right)$$ is the optimal constant model for $L$. % -\item First, note that +\item \textbf{Recommended solution:} +We need to use the fact that $y,y^{(1)},\ldots,y^{(n)}$ are i.i.d. and the arithmetric mean is an unbiased estimator. That being said, +\begin{align*} + \E_{xy}[m(y)] - \E_{xy}\left[\frac{1}{n} \sum_{i=1}^n m(\yi)\right] = 0. +\end{align*} + +Therefore, + +\begin{align*} +% + \risk_L\left(\fh \right) + &= \E_{xy} [\Lxy] \\ + &= \E_{xy} [ \big(m(y)-m(\fxh)\big)^2 ] \\ + &= \E_{xy} \left[ \left( m(y) - \frac1n \sum_{i=1}^n m(\yi) \right)^2 \right] \\ + &= \E_{xy} \left[ \left( m(y) - \frac{1}{n} \sum_{i=1}^n m(\yi) - \left( \E_{xy}[m(y)] - \E_{xy}\left[\frac{1}{n} \sum_{i=1}^n m(\yi)\right] \right) \right)^2 \right] \\ + &= \E_{xy} \left[ \left( m(y) - \frac{1}{n} \sum_{i=1}^n m(\yi) - \E_{xy}\left[m(y) - \frac{1}{n} \sum_{i=1}^n m(\yi)\right] \right)^2 \right] \\ + &= \var\left( m(y) - \frac{1}{n} \sum_{i=1}^n m(\yi) \right) \\ + &= \var(m(y)) + \var\left(\frac{1}{n} \sum_{i=1}^n m(\yi) \right) \\ + &= \var(m(y)) + \frac{1}{n^2}\var(\sum_{i=1}^n m(\yi)) \\ + &= \var(m(y)) + \frac{1}{n^2} \cdot n \var(m(\yi)) \\ + &= \var(m(y)) + \frac{1}{n^2} \cdot n \var(m(y)) \\ + &= \left(1 + \frac{1}{n} \right) \var(m(y)) \\ +\end{align*} + + +\textbf{Alternative solution:} + +Here we provide an alternative solution to (b). First, note that % \begin{align*} % diff --git a/exercises/advriskmin/figure/unnamed-chunk-2-1.pdf b/exercises/advriskmin/figure/unnamed-chunk-2-1.pdf index 5c487596..895c9d84 100644 Binary files a/exercises/advriskmin/figure/unnamed-chunk-2-1.pdf and b/exercises/advriskmin/figure/unnamed-chunk-2-1.pdf differ diff --git a/exercises/advriskmin/figure/unnamed-chunk-2-2.pdf b/exercises/advriskmin/figure/unnamed-chunk-2-2.pdf index 3e690abf..387544eb 100644 Binary files a/exercises/advriskmin/figure/unnamed-chunk-2-2.pdf and b/exercises/advriskmin/figure/unnamed-chunk-2-2.pdf differ