From 752365eafb091d1eec09a1fc69c2a6f1d5c26652 Mon Sep 17 00:00:00 2001 From: Morten Hjorth-Jensen Date: Tue, 19 Sep 2023 09:53:16 +0200 Subject: [PATCH] update on typos --- doc/LectureNotes/exercisesweek38.ipynb | 36 +++++---- doc/LectureNotes/project1.ipynb | 106 ++++++++++++------------- doc/src/week38/exercisesweek38.do.txt | 12 ++- 3 files changed, 82 insertions(+), 72 deletions(-) diff --git a/doc/LectureNotes/exercisesweek38.ipynb b/doc/LectureNotes/exercisesweek38.ipynb index 3cdd38af9..5f82b3d79 100644 --- a/doc/LectureNotes/exercisesweek38.ipynb +++ b/doc/LectureNotes/exercisesweek38.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "78bc86fe", + "id": "b2cf4bdf", "metadata": { "editable": true }, @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "bfac1a23", + "id": "43316fd6", "metadata": { "editable": true }, @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "248903ce", + "id": "1f8db1a6", "metadata": { "editable": true }, @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "d08c4671", + "id": "41067a3c", "metadata": { "editable": true }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "56f9ca3e", + "id": "68997f6b", "metadata": { "editable": true }, @@ -76,7 +76,7 @@ }, { "cell_type": "markdown", - "id": "ae36b494", + "id": "f7e45184", "metadata": { "editable": true }, @@ -88,7 +88,7 @@ }, { "cell_type": "markdown", - "id": "be3eadf1", + "id": "4c15509e", "metadata": { "editable": true }, @@ -97,24 +97,25 @@ "\n", "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\n", "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.\n", + "\n", "That is, show that" ] }, { "cell_type": "markdown", - "id": "ae9ebea0", + "id": "046ec084", "metadata": { "editable": true }, "source": [ "$$\n", - "\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right]=(\\mathrm{Bias}[\\tilde{y}])^2+\\mathrm{var}[\\tilde{f}]+\\sigma^2,\n", + "\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right]=\\mathrm{Bias}[y]+\\mathrm{var}[\\tilde{y}]+\\sigma^2,\n", "$$" ] }, { "cell_type": "markdown", - "id": "d1cbae1b", + "id": "b2cc33db", "metadata": { "editable": true }, @@ -124,19 +125,19 @@ }, { "cell_type": "markdown", - "id": "d2e1f899", + "id": "7ab1bc0e", "metadata": { "editable": true }, "source": [ "$$\n", - "(\\mathrm{Bias}[\\tilde{y}])^2=\\left(\\boldsymbol{y}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2,\n", + "\\mathrm{Bias}[y]=\\mathbb{E}\\left[\\left(\\boldsymbol{y}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right],\n", "$$" ] }, { "cell_type": "markdown", - "id": "0486221c", + "id": "a8da71db", "metadata": { "editable": true }, @@ -146,23 +147,26 @@ }, { "cell_type": "markdown", - "id": "86746df2", + "id": "b74aa5e4", "metadata": { "editable": true }, "source": [ "$$\n", - "\\mathrm{var}[\\tilde{f}]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n", + "\\mathrm{var}[\\tilde{y}]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n", "$$" ] }, { "cell_type": "markdown", - "id": "9aa6d3dc", + "id": "de559d80", "metadata": { "editable": true }, "source": [ + "The answer to this exercise should be included in the theory part of the report. This exercise is also part of the weekly exercises of week 37.\n", + "Explain what the terms mean and discuss their interpretations.\n", + "\n", "Explain what the terms mean and discuss their interpretations.\n", "\n", "Perform then a bias-variance analysis of a simple one-dimensional (or other models of your choice) function by\n", diff --git a/doc/LectureNotes/project1.ipynb b/doc/LectureNotes/project1.ipynb index 2ecd55826..467bad587 100644 --- a/doc/LectureNotes/project1.ipynb +++ b/doc/LectureNotes/project1.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6060626f", + "id": "7424fea1", "metadata": { "editable": true }, @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "fd9f7098", + "id": "c9ca1d90", "metadata": { "editable": true }, @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "75f7ac9b", + "id": "3e4164b6", "metadata": { "editable": true }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "988b2436", + "id": "dd4dcdf5", "metadata": { "editable": true }, @@ -85,7 +85,7 @@ }, { "cell_type": "markdown", - "id": "0725f6b3", + "id": "71ddc478", "metadata": { "editable": true }, @@ -100,7 +100,7 @@ }, { "cell_type": "markdown", - "id": "de583594", + "id": "d4184afb", "metadata": { "editable": true }, @@ -133,7 +133,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "130a5d79", + "id": "62880fe6", "metadata": { "collapsed": false, "editable": true @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "9bf030f4", + "id": "6f7e7c97", "metadata": { "editable": true }, @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "3be47d8d", + "id": "7377112f", "metadata": { "editable": true }, @@ -220,7 +220,7 @@ }, { "cell_type": "markdown", - "id": "f7f14618", + "id": "72f83fe7", "metadata": { "editable": true }, @@ -232,7 +232,7 @@ }, { "cell_type": "markdown", - "id": "913d72b1", + "id": "7a3578ff", "metadata": { "editable": true }, @@ -244,7 +244,7 @@ }, { "cell_type": "markdown", - "id": "7a403d11", + "id": "e0aef819", "metadata": { "editable": true }, @@ -254,7 +254,7 @@ }, { "cell_type": "markdown", - "id": "108b7a27", + "id": "c7f751af", "metadata": { "editable": true }, @@ -266,7 +266,7 @@ }, { "cell_type": "markdown", - "id": "f1e64231", + "id": "c026a4bd", "metadata": { "editable": true }, @@ -295,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "30bca1e7", + "id": "2635bcbd", "metadata": { "editable": true }, @@ -313,7 +313,7 @@ }, { "cell_type": "markdown", - "id": "ae6a3eeb", + "id": "92892df2", "metadata": { "editable": true }, @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "5ba7dff9", + "id": "35987aab", "metadata": { "editable": true }, @@ -346,7 +346,7 @@ }, { "cell_type": "markdown", - "id": "84ca72c8", + "id": "e61048c2", "metadata": { "editable": true }, @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "0d734865", + "id": "5ef456d4", "metadata": { "editable": true }, @@ -369,7 +369,7 @@ }, { "cell_type": "markdown", - "id": "1dac6c19", + "id": "52e6fbad", "metadata": { "editable": true }, @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "e04687a9", + "id": "db6028a0", "metadata": { "editable": true }, @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "f99dbe69", + "id": "9477ad5e", "metadata": { "editable": true }, @@ -405,7 +405,7 @@ }, { "cell_type": "markdown", - "id": "0b3e0564", + "id": "8c2aeccd", "metadata": { "editable": true }, @@ -416,7 +416,7 @@ }, { "cell_type": "markdown", - "id": "f660901d", + "id": "6a774b74", "metadata": { "editable": true }, @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "7a1c7f34", + "id": "98fde9b7", "metadata": { "editable": true }, @@ -441,7 +441,7 @@ }, { "cell_type": "markdown", - "id": "becad040", + "id": "87a4d11d", "metadata": { "editable": true }, @@ -453,7 +453,7 @@ }, { "cell_type": "markdown", - "id": "242ede2f", + "id": "b4844f1e", "metadata": { "editable": true }, @@ -463,7 +463,7 @@ }, { "cell_type": "markdown", - "id": "d4999c5f", + "id": "f7662ade", "metadata": { "editable": true }, @@ -475,7 +475,7 @@ }, { "cell_type": "markdown", - "id": "46386eef", + "id": "1d61362e", "metadata": { "editable": true }, @@ -486,7 +486,7 @@ }, { "cell_type": "markdown", - "id": "9f27e396", + "id": "74bbb4ab", "metadata": { "editable": true }, @@ -519,7 +519,7 @@ }, { "cell_type": "markdown", - "id": "902b759d", + "id": "ac939724", "metadata": { "editable": true }, @@ -531,7 +531,7 @@ }, { "cell_type": "markdown", - "id": "41a0b8d7", + "id": "4066d012", "metadata": { "editable": true }, @@ -550,7 +550,7 @@ }, { "cell_type": "markdown", - "id": "89cced85", + "id": "7e5c5ef4", "metadata": { "editable": true }, @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "22bb8b90", + "id": "690337b9", "metadata": { "editable": true }, @@ -576,19 +576,19 @@ }, { "cell_type": "markdown", - "id": "e88ba22d", + "id": "92dabf3c", "metadata": { "editable": true }, "source": [ "$$\n", - "\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right]=(\\mathrm{Bias}[\\tilde{y}])^2+\\mathrm{var}[\\tilde{f}]+\\sigma^2,\n", + "\\mathbb{E}\\left[(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2\\right]=\\mathrm{Bias}[y]+\\mathrm{var}[\\tilde{y}]+\\sigma^2,\n", "$$" ] }, { "cell_type": "markdown", - "id": "e2156ab0", + "id": "7da90966", "metadata": { "editable": true }, @@ -598,19 +598,19 @@ }, { "cell_type": "markdown", - "id": "7d08fd36", + "id": "33a81d54", "metadata": { "editable": true }, "source": [ "$$\n", - "(\\mathrm{Bias}[\\tilde{y}])^2=\\left(\\boldsymbol{y}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2,\n", + "\\mathrm{Bias}[y]=\\mathbb{E}\\left[\\left(\\boldsymbol{y}-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right]\\right)^2\\right],\n", "$$" ] }, { "cell_type": "markdown", - "id": "5cdcf0c6", + "id": "abb9bd28", "metadata": { "editable": true }, @@ -620,19 +620,19 @@ }, { "cell_type": "markdown", - "id": "3235550b", + "id": "5b4668fd", "metadata": { "editable": true }, "source": [ "$$\n", - "\\mathrm{var}[\\tilde{f}]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n", + "\\mathrm{var}[\\tilde{y}]=\\frac{1}{n}\\sum_i(\\tilde{y}_i-\\mathbb{E}\\left[\\boldsymbol{\\tilde{y}}\\right])^2.\n", "$$" ] }, { "cell_type": "markdown", - "id": "813e8659", + "id": "b453f8fc", "metadata": { "editable": true }, @@ -651,7 +651,7 @@ }, { "cell_type": "markdown", - "id": "adf1396f", + "id": "6fe323b0", "metadata": { "editable": true }, @@ -676,7 +676,7 @@ }, { "cell_type": "markdown", - "id": "a7cb0fd1", + "id": "5fd2f486", "metadata": { "editable": true }, @@ -704,7 +704,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "3be6c174", + "id": "e88e39ea", "metadata": { "collapsed": false, "editable": true @@ -716,7 +716,7 @@ }, { "cell_type": "markdown", - "id": "9544f6e7", + "id": "29817da1", "metadata": { "editable": true }, @@ -728,7 +728,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "c2dc1c15", + "id": "560fc9f4", "metadata": { "collapsed": false, "editable": true @@ -754,7 +754,7 @@ }, { "cell_type": "markdown", - "id": "81854928", + "id": "3fc05383", "metadata": { "editable": true }, @@ -779,7 +779,7 @@ }, { "cell_type": "markdown", - "id": "9a8a9dc4", + "id": "bb21261e", "metadata": { "editable": true }, @@ -793,7 +793,7 @@ }, { "cell_type": "markdown", - "id": "df82eef8", + "id": "c5ab9dbf", "metadata": { "editable": true }, @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "ba32d247", + "id": "7d0dbb14", "metadata": { "editable": true }, @@ -845,7 +845,7 @@ }, { "cell_type": "markdown", - "id": "cb0788db", + "id": "e301049d", "metadata": { "editable": true }, diff --git a/doc/src/week38/exercisesweek38.do.txt b/doc/src/week38/exercisesweek38.do.txt index b3c8ea27a..58e43b517 100644 --- a/doc/src/week38/exercisesweek38.do.txt +++ b/doc/src/week38/exercisesweek38.do.txt @@ -39,24 +39,28 @@ Here the expected value $\mathbb{E}$ is the sample value. 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 !bt \[ -\mathbb{E}\left[(\bm{y}-\bm{\tilde{y}})^2\right]=(\mathrm{Bias}[\tilde{y}])^2+\mathrm{var}[\tilde{f}]+\sigma^2, +\mathbb{E}\left[(\bm{y}-\bm{\tilde{y}})^2\right]=\mathrm{Bias}[y]+\mathrm{var}[\tilde{y}]+\sigma^2, \] !et with !bt \[ -(\mathrm{Bias}[\tilde{y}])^2=\left(\bm{y}-\mathbb{E}\left[\bm{\tilde{y}}\right]\right)^2, +\mathrm{Bias}[y]=\mathbb{E}\left[\left(\bm{y}-\mathbb{E}\left[\bm{\tilde{y}}\right]\right)^2\right], \] !et and !bt \[ -\mathrm{var}[\tilde{f}]=\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\bm{\tilde{y}}\right])^2. +\mathrm{var}[\tilde{y}]=\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\bm{\tilde{y}}\right])^2. \] !et +The answer to this exercise should be included in the theory part of the report. This exercise is also part of the weekly exercises of week 37. +Explain what the terms mean and discuss their interpretations. + Explain what the terms mean and discuss their interpretations. @@ -70,3 +74,5 @@ You can follow the code example in the jupyter-book at URL:"https://compphysics. See also the whiteboard notes from week 37 at URL:"https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2023/NotesSep14.pdf" + +