Skip to content

Commit 3ca1289

Browse files
committed
update exercises week 38
1 parent 9f547ac commit 3ca1289

File tree

7 files changed

+10
-24
lines changed

7 files changed

+10
-24
lines changed
0 Bytes
Binary file not shown.
231 Bytes
Binary file not shown.

doc/LectureNotes/_build/html/_sources/exercisesweek38.ipynb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,12 @@
178178
"We see that $\\mathbb{E} \\big[ \\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}} \\big] \\not= \\mathbb{E} \\big[\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}\\big ]$ for any $\\lambda > 0$.\n"
179179
]
180180
},
181-
{
182-
"cell_type": "markdown",
183-
"id": "65f6f914",
184-
"metadata": {},
185-
"source": [
186-
"**b)** Why do we say that Ridge regression gives a biased estimate? Is this a problem?\n"
187-
]
188-
},
189181
{
190182
"cell_type": "markdown",
191183
"id": "b4e721fc",
192184
"metadata": {},
193185
"source": [
194-
"**c)** Show that the variance is\n"
186+
"**b)** Show that the variance is\n"
195187
]
196188
},
197189
{
@@ -297,7 +289,8 @@
297289
"source": [
298290
"$$\n",
299291
"\\mathrm{var}[\\tilde{y}]=\\mathbb{E}\\left[\\left(\\tilde{\\boldsymbol{y}}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n",
300-
"$$\n"
292+
"$$\n",
293+
"In order to arrive at the equation for the bias, we have to approximate the unknown function $f$ with the output/target values $y$."
301294
]
302295
},
303296
{

doc/LectureNotes/_build/html/exercisesweek38.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,7 @@ <h2>Exercise 2: Expectation values for Ridge regression<a class="headerlink" hre
480480
\mathbb{E} \big[ \hat{\boldsymbol{\beta}}^{\mathrm{Ridge}} \big]=(\mathbf{X}^{T} \mathbf{X} + \lambda \mathbf{I}_{pp})^{-1} (\mathbf{X}^{\top} \mathbf{X})\boldsymbol{\beta}
481481
\]</div>
482482
<p>We see that <span class="math notranslate nohighlight">\(\mathbb{E} \big[ \hat{\boldsymbol{\beta}}^{\mathrm{Ridge}} \big] \not= \mathbb{E} \big[\hat{\boldsymbol{\beta}}^{\mathrm{OLS}}\big ]\)</span> for any <span class="math notranslate nohighlight">\(\lambda &gt; 0\)</span>.</p>
483-
<p><strong>b)</strong> Why do we say that Ridge regression gives a biased estimate? Is this a problem?</p>
484-
<p><strong>c)</strong> Show that the variance is</p>
483+
<p><strong>b)</strong> Show that the variance is</p>
485484
<div class="math notranslate nohighlight">
486485
\[
487486
\mathbf{Var}[\hat{\boldsymbol{\beta}}^{\mathrm{Ridge}}]=\sigma^2[ \mathbf{X}^{T} \mathbf{X} + \lambda \mathbf{I} ]^{-1} \mathbf{X}^{T}\mathbf{X} \{ [ \mathbf{X}^{\top} \mathbf{X} + \lambda \mathbf{I} ]^{-1}\}^{T}
@@ -517,6 +516,7 @@ <h2>Exercise 3: Deriving the expression for the Bias-Variance Trade-off<a class=
517516
\[
518517
\mathrm{var}[\tilde{y}]=\mathbb{E}\left[\left(\tilde{\boldsymbol{y}}-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right]\right)^2\right]=\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2.
519518
\]</div>
519+
<p>In order to arrive at the equation for the bias, we have to approximate the unknown function <span class="math notranslate nohighlight">\(f\)</span> with the output/target values <span class="math notranslate nohighlight">\(y\)</span>.</p>
520520
<p><strong>b)</strong> Explain what the terms mean and discuss their interpretations.</p>
521521
</section>
522522
<section id="exercise-4-computing-the-bias-and-variance">

doc/LectureNotes/_build/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/LectureNotes/_build/jupyter_execute/exercisesweek38.ipynb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,12 @@
178178
"We see that $\\mathbb{E} \\big[ \\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}} \\big] \\not= \\mathbb{E} \\big[\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}\\big ]$ for any $\\lambda > 0$.\n"
179179
]
180180
},
181-
{
182-
"cell_type": "markdown",
183-
"id": "65f6f914",
184-
"metadata": {},
185-
"source": [
186-
"**b)** Why do we say that Ridge regression gives a biased estimate? Is this a problem?\n"
187-
]
188-
},
189181
{
190182
"cell_type": "markdown",
191183
"id": "b4e721fc",
192184
"metadata": {},
193185
"source": [
194-
"**c)** Show that the variance is\n"
186+
"**b)** Show that the variance is\n"
195187
]
196188
},
197189
{
@@ -297,7 +289,8 @@
297289
"source": [
298290
"$$\n",
299291
"\\mathrm{var}[\\tilde{y}]=\\mathbb{E}\\left[\\left(\\tilde{\\boldsymbol{y}}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n",
300-
"$$\n"
292+
"$$\n",
293+
"In order to arrive at the equation for the bias, we have to approximate the unknown function $f$ with the output/target values $y$."
301294
]
302295
},
303296
{

doc/LectureNotes/exercisesweek38.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
"$$\n",
291291
"\\mathrm{var}[\\tilde{y}]=\\mathbb{E}\\left[\\left(\\tilde{\\boldsymbol{y}}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n",
292292
"$$\n",
293-
"In order to arrive at the last equation, we have to approximate the unknown function $f$ with the output/target values $y$."
293+
"In order to arrive at the equation for the bias, we have to approximate the unknown function $f$ with the output/target values $y$."
294294
]
295295
},
296296
{

0 commit comments

Comments
 (0)