update
This commit is contained in:
@@ -338,8 +338,6 @@ plt<span style="color: #666666">.</span>show()
|
||||
</div>
|
||||
<h3 id="part-a-paper-and-pencil-part-also-as-weekly-exercise-for-week-36">Part a): Paper and pencil part (also as weekly exercise for week 36) </h3>
|
||||
|
||||
<p>This part should be included in your theory description of the report.</p>
|
||||
|
||||
<p>This exercise deals with various mean values and variances in linear regression method (here it may be useful to look up chapter 3, equation (3.8) of <a href="https://www.springer.com/gp/book/9780387848570" target="_blank">Trevor Hastie, Robert Tibshirani, Jerome H. Friedman, The Elements of Statistical Learning, Springer</a>).</p>
|
||||
|
||||
<p>The assumption we have made is
|
||||
@@ -385,7 +383,7 @@ $$
|
||||
\mbox{Var}(\boldsymbol{\beta}) = \sigma^2 \, (\mathbf{X}^{T} \mathbf{X})^{-1}.
|
||||
$$
|
||||
|
||||
<p>We can use the last expression when we define a so-called confidence interval for the parameters \( \beta \).
|
||||
<p>We can use the last expression when we define a so-called confidence interval for the parameters \( \beta \). .
|
||||
A given parameter \( \beta_j \) is given by the diagonal matrix element of the above matrix.
|
||||
</p>
|
||||
<h3 id="part-b-ordinary-least-square-ols-on-the-franke-function">Part b) : Ordinary Least Square (OLS) on the Franke function </h3>
|
||||
@@ -472,7 +470,7 @@ dataset \( \mathcal{L} \) consisting of the data
|
||||
\( \mathbf{X}_\mathcal{L}=\{(y_j, \boldsymbol{x}_j), j=0\ldots n-1\} \).
|
||||
</p>
|
||||
|
||||
<p>Let us assume that the true data is generated from a noisy model</p>
|
||||
<p>As in part a), we assume that the true data is generated from a noisy model</p>
|
||||
|
||||
$$
|
||||
\boldsymbol{y}=f(\boldsymbol{x}) + \boldsymbol{\epsilon}.
|
||||
@@ -498,14 +496,26 @@ $$
|
||||
|
||||
<p>Here the expected value \( \mathbb{E} \) is the sample value. </p>
|
||||
|
||||
<p>Show that you can rewrite this as</p>
|
||||
<p>Show that you can rewrite this in terms of a term which contains the variance of the model itself (the so-called variance term), a
|
||||
term which measures the deviation from the true data and the mean value of the model (the bias term) and finally the variance of the noise.
|
||||
That is, show that
|
||||
</p>
|
||||
$$
|
||||
\mathbb{E}\left[(\boldsymbol{y}-\boldsymbol{\tilde{y}})^2\right]=\frac{1}{n}\sum_i(f_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2+\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2+\sigma^2.
|
||||
\mathbb{E}\left[(\boldsymbol{y}-\boldsymbol{\tilde{y}})^2\right]=(\mathrm{Bias}[\tilde{y}])^2+\mathrm{var}[\tilde{f}]+\sigma^2,
|
||||
$$
|
||||
|
||||
<p>The answer to this exercise can be included in the theory part of the report.
|
||||
Explain what the terms mean, which one is the bias and which one is
|
||||
the variance and discuss their interpretations.
|
||||
<p>with </p>
|
||||
$$
|
||||
(\mathrm{Bias}[\tilde{y}])^2=\left(\boldsymbol{y}-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right]\right)^2,
|
||||
$$
|
||||
|
||||
<p>and </p>
|
||||
$$
|
||||
\mathrm{var}[\tilde{f}]=\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2.
|
||||
$$
|
||||
|
||||
<p>The answer to this exercise should be included in the theory part of the report.
|
||||
Explain what the terms mean and discuss their interpretations.
|
||||
</p>
|
||||
|
||||
<p>Perform then a bias-variance analysis of the Franke function by
|
||||
@@ -515,6 +525,7 @@ studying the MSE value as function of the complexity of your model.
|
||||
<p>Discuss the bias and variance trade-off as function
|
||||
of your model complexity (the degree of the polynomial) and the number
|
||||
of data points, and possibly also your training and test data using the <b>bootstrap</b> resampling method.
|
||||
You can follow the code example in the jupyter-book at <a href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter3.html#the-bias-variance-tradeoff" target="_blank"><tt>https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter3.html#the-bias-variance-tradeoff</tt></a>.
|
||||
</p>
|
||||
|
||||
<p>Note also that when you calculate the bias, in all applications you don't know the function values \( f_i \). You would hence replace them with the actual data points \( y_i \).</p>
|
||||
|
||||
Reference in New Issue
Block a user