From c16eb92e4d281a896e5dfd2437cf23cbbfe5177e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:30:26 +0000 Subject: [PATCH 01/11] Define "prediction function" separately from "prediction" A prediction is a guess (a constant, or g(X)); a prediction function is the function g that produces it. The pages already say "prediction function" and link it to the prediction definition. Add a prediction-function definition and example after the input definition, and link the uses that follow it. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_def-prediction-error.qmd | 2 +- _subfiles/_def-prediction-function.qmd | 7 +++++++ _subfiles/_def-reducible-risk.qmd | 2 +- _subfiles/_def-squared-error-risk.qmd | 2 +- _subfiles/_exm-prediction-function.qmd | 8 ++++++++ _subfiles/_lem-cross-term-zero.qmd | 2 +- _subfiles/_thm-best-predictor.qmd | 2 +- _subfiles/_thm-risk-decomposition.qmd | 2 +- .../_cor-best-predictor-argmin.qmd | 4 ++-- expectation.qmd | 8 ++++++++ 10 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 _subfiles/_def-prediction-function.qmd create mode 100644 _subfiles/_exm-prediction-function.qmd diff --git a/_subfiles/_def-prediction-error.qmd b/_subfiles/_def-prediction-error.qmd index 2e931a026..a75998d89 100644 --- a/_subfiles/_def-prediction-error.qmd +++ b/_subfiles/_def-prediction-error.qmd @@ -1,7 +1,7 @@ :::{#def-prediction-error} #### Prediction error -A [prediction function](#def-prediction) $\predfnf{\Predvar}$ has as its [estimand](https://morrison-lab.github.io/sds/estimation.html#def-estimand) +A [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ has as its [estimand](https://morrison-lab.github.io/sds/estimation.html#def-estimand) the observed [outcome](#def-outcome) $\Outvar$ of a [new observation](#def-new-observation) with [input](#def-input) $\Predvar$, not the [conditional mean](#def-cond-expectation-function) of that outcome. The **prediction error** of $\predfn$ is the prediction minus that outcome: diff --git a/_subfiles/_def-prediction-function.qmd b/_subfiles/_def-prediction-function.qmd new file mode 100644 index 000000000..c97cb3e39 --- /dev/null +++ b/_subfiles/_def-prediction-function.qmd @@ -0,0 +1,7 @@ +:::{#def-prediction-function} +#### Prediction function + +A **prediction function** $\predfn$ is a function that takes a value $\predvar$ of the [input](#def-input) +and returns a [prediction](#def-prediction) $\predfnf{\predvar}$ of the [outcome](#def-outcome). + +::: diff --git a/_subfiles/_def-reducible-risk.qmd b/_subfiles/_def-reducible-risk.qmd index da24be460..c76279289 100644 --- a/_subfiles/_def-reducible-risk.qmd +++ b/_subfiles/_def-reducible-risk.qmd @@ -2,7 +2,7 @@ #### Reducible risk In the squared-error risk decomposition of @thm-risk-decomposition, -the excess risk from choosing the prediction function $\predfn$ instead of the conditional mean, +the excess risk from choosing the [prediction function](#def-prediction-function) $\predfn$ instead of the conditional mean, $$\E{\sqf{\E{\Outvar \mid \Predvar} - \predfnf{\Predvar}}} \ge 0$$ diff --git a/_subfiles/_def-squared-error-risk.qmd b/_subfiles/_def-squared-error-risk.qmd index 719e84d22..77540546d 100644 --- a/_subfiles/_def-squared-error-risk.qmd +++ b/_subfiles/_def-squared-error-risk.qmd @@ -1,7 +1,7 @@ :::{#def-squared-error-risk} #### Squared-error risk (expected prediction error) -The **squared-error risk** of a prediction function $\predfnf{\Predvar}$, +The **squared-error risk** of a [prediction function](#def-prediction-function) $\predfnf{\Predvar}$, also called its **expected prediction error** [@hastie2009elements, p. 18], is the expected square of its [prediction error](#def-prediction-error): diff --git a/_subfiles/_exm-prediction-function.qmd b/_subfiles/_exm-prediction-function.qmd new file mode 100644 index 000000000..6a80cfe16 --- /dev/null +++ b/_subfiles/_exm-prediction-function.qmd @@ -0,0 +1,8 @@ +:::{#exm-prediction-function} +#### A constant prediction function + +In @exr-best-predictor, +the function $\predfn_1\paren{\predvar} = 3$ is a [prediction function](#def-prediction-function): +it returns the [prediction](#def-prediction) $3$ for every value of the [input](#def-input). + +::: diff --git a/_subfiles/_lem-cross-term-zero.qmd b/_subfiles/_lem-cross-term-zero.qmd index fc5ffdda9..73ed0fdff 100644 --- a/_subfiles/_lem-cross-term-zero.qmd +++ b/_subfiles/_lem-cross-term-zero.qmd @@ -2,7 +2,7 @@ #### The conditional mean's error is uncorrelated with any function of the input Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. -For any [prediction function](#def-prediction) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +For any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\E{\prederrf{\truemean} \cd \paren{\predfnf{\Predvar} - \truemeanf{\Predvar}}} = 0$$ diff --git a/_subfiles/_thm-best-predictor.qmd b/_subfiles/_thm-best-predictor.qmd index 944f0f581..5b7b2652a 100644 --- a/_subfiles/_thm-best-predictor.qmd +++ b/_subfiles/_thm-best-predictor.qmd @@ -4,7 +4,7 @@ Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. Write $\bestpredfn \eqdef \truemean$ for the prediction function that uses it. -Then for any [prediction function](#def-prediction) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +Then for any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\popriskf{\predfn} \ge \popriskf{\bestpredfn}$$ diff --git a/_subfiles/_thm-risk-decomposition.qmd b/_subfiles/_thm-risk-decomposition.qmd index 247563295..aa1ea5747 100644 --- a/_subfiles/_thm-risk-decomposition.qmd +++ b/_subfiles/_thm-risk-decomposition.qmd @@ -2,7 +2,7 @@ #### Squared-error risk decomposition Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. -For any [prediction function](#def-prediction) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +For any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\popriskf{\predfn} = \popriskf{\truemean} + \E{\sqf{\predfnf{\Predvar} - \truemeanf{\Predvar}}}$$ diff --git a/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd b/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd index 9e0b58ff3..73ed3da46 100644 --- a/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd +++ b/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd @@ -2,7 +2,7 @@ #### Conditional mean as the minimizer of squared-error risk Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. -Among [prediction functions](#def-prediction) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$, +Among [prediction functions](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$, the [conditional expectation function](#def-cond-expectation-function) is a [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer) of the [squared-error risk](#def-squared-error-risk): $$\E{\Outvar \mid \Predvar} \in \argmin_{\predfn} \E{\sqf{\Outvar - \predfnf{\Predvar}}},$$ @@ -13,7 +13,7 @@ where $\argmin$ is the [set of minimizers](https://morrison-lab.github.io/mds/al ::: proof -By @thm-best-predictor, $\bestpredfnf{\Predvar} = \E{\Outvar \mid \Predvar}$ has [risk](#def-risk) no larger than that of any [prediction function](#def-prediction) $\predfn$, +By @thm-best-predictor, $\bestpredfnf{\Predvar} = \E{\Outvar \mid \Predvar}$ has [risk](#def-risk) no larger than that of any [prediction function](#def-prediction-function) $\predfn$, so it is a [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer). ::: diff --git a/expectation.qmd b/expectation.qmd index 461cffa2d..486ccf95c 100644 --- a/expectation.qmd +++ b/expectation.qmd @@ -103,6 +103,14 @@ format: {{< slidebreak >}} +{{< include pds/_subfiles/_def-prediction-function.qmd >}} + +{{< slidebreak >}} + +{{< include pds/_subfiles/_exm-prediction-function.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_def-new-observation.qmd >}} {{< slidebreak >}} From 2cf4bec318ad3618e7bfea6a8b569687526e2f4e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:32:21 +0000 Subject: [PATCH 02/11] Link "function" in the prediction-function definition and example Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_def-prediction-function.qmd | 2 +- _subfiles/_exm-prediction-function.qmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_subfiles/_def-prediction-function.qmd b/_subfiles/_def-prediction-function.qmd index c97cb3e39..6e53fc525 100644 --- a/_subfiles/_def-prediction-function.qmd +++ b/_subfiles/_def-prediction-function.qmd @@ -1,7 +1,7 @@ :::{#def-prediction-function} #### Prediction function -A **prediction function** $\predfn$ is a function that takes a value $\predvar$ of the [input](#def-input) +A **prediction function** $\predfn$ is a [function](https://morrison-lab.github.io/mds/functions.html#def-function) that takes a value $\predvar$ of the [input](#def-input) and returns a [prediction](#def-prediction) $\predfnf{\predvar}$ of the [outcome](#def-outcome). ::: diff --git a/_subfiles/_exm-prediction-function.qmd b/_subfiles/_exm-prediction-function.qmd index 6a80cfe16..79f728a7a 100644 --- a/_subfiles/_exm-prediction-function.qmd +++ b/_subfiles/_exm-prediction-function.qmd @@ -2,7 +2,7 @@ #### A constant prediction function In @exr-best-predictor, -the function $\predfn_1\paren{\predvar} = 3$ is a [prediction function](#def-prediction-function): +the [function](https://morrison-lab.github.io/mds/functions.html#def-function) $\predfn_1\paren{\predvar} = 3$ is a [prediction function](#def-prediction-function): it returns the [prediction](#def-prediction) $3$ for every value of the [input](#def-input). ::: From 6602e44e98bea5502b06827cb417f7b638eede85 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:32:34 +0000 Subject: [PATCH 03/11] Reword "excess risk" in the reducible-risk definition and link its terms No source uses "excess risk" as a term for this quantity. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_def-reducible-risk.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_subfiles/_def-reducible-risk.qmd b/_subfiles/_def-reducible-risk.qmd index c76279289..251d7ba26 100644 --- a/_subfiles/_def-reducible-risk.qmd +++ b/_subfiles/_def-reducible-risk.qmd @@ -2,7 +2,7 @@ #### Reducible risk In the squared-error risk decomposition of @thm-risk-decomposition, -the excess risk from choosing the [prediction function](#def-prediction-function) $\predfn$ instead of the conditional mean, +the part of the [risk](#def-risk) that comes from choosing the [prediction function](#def-prediction-function) $\predfn$ instead of the [conditional mean](#def-cond-expectation-function), $$\E{\sqf{\E{\Outvar \mid \Predvar} - \predfnf{\Predvar}}} \ge 0$$ From 98a7cb8718a2c76b2e56c260cc0182fbdb2657c1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:36:16 +0000 Subject: [PATCH 04/11] Move each example out of the subfiles this PR touches check-one-div-per-subfile fails a PR that adds a line to a subfile holding more than one div. Move the four examples to their own subfiles and include them after the definition or result they follow. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_def-prediction-error.qmd | 13 ------------- _subfiles/_def-squared-error-risk.qmd | 11 ----------- _subfiles/_exm-cross-term-zero.qmd | 11 +++++++++++ _subfiles/_exm-prediction-error.qmd | 10 ++++++++++ _subfiles/_exm-risk-decomposition.qmd | 9 +++++++++ _subfiles/_exm-squared-error-risk.qmd | 8 ++++++++ _subfiles/_lem-cross-term-zero.qmd | 14 -------------- _subfiles/_thm-risk-decomposition.qmd | 12 ------------ expectation.qmd | 16 ++++++++++++++++ 9 files changed, 54 insertions(+), 50 deletions(-) create mode 100644 _subfiles/_exm-cross-term-zero.qmd create mode 100644 _subfiles/_exm-prediction-error.qmd create mode 100644 _subfiles/_exm-risk-decomposition.qmd create mode 100644 _subfiles/_exm-squared-error-risk.qmd diff --git a/_subfiles/_def-prediction-error.qmd b/_subfiles/_def-prediction-error.qmd index a75998d89..e2d576220 100644 --- a/_subfiles/_def-prediction-error.qmd +++ b/_subfiles/_def-prediction-error.qmd @@ -9,16 +9,3 @@ The **prediction error** of $\predfn$ is the prediction minus that outcome: $$\prederrf{\predfn} \eqdef \predfnf{\Predvar} - \Outvar$$ ::: - -{{< slidebreak >}} - -:::{#exm-prediction-error} -#### Prediction error in the best-predictor exercise - -In @exr-best-predictor, -consider the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. -Its [prediction error](#def-prediction-error) is $\prederrf{\predfn_1} = 3 - \Outvar$. -This is $3$ when $\Outvar = 0$. -It is $-3$ when $\Outvar = 6$. - -::: diff --git a/_subfiles/_def-squared-error-risk.qmd b/_subfiles/_def-squared-error-risk.qmd index 77540546d..402b1d3cd 100644 --- a/_subfiles/_def-squared-error-risk.qmd +++ b/_subfiles/_def-squared-error-risk.qmd @@ -8,14 +8,3 @@ is the expected square of its [prediction error](#def-prediction-error): $$\popriskf{\predfn} \eqdef \E{\sqf{\prederrf{\predfn}}}$$ ::: - -{{< slidebreak >}} - -:::{#exm-squared-error-risk} -#### Squared-error risk in the best-predictor exercise - -In @exr-best-predictor, -consider the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. -Its [squared-error risk](#def-squared-error-risk) is $\popriskf{\predfn_1} = 5$. - -::: diff --git a/_subfiles/_exm-cross-term-zero.qmd b/_subfiles/_exm-cross-term-zero.qmd new file mode 100644 index 000000000..c34f90fb9 --- /dev/null +++ b/_subfiles/_exm-cross-term-zero.qmd @@ -0,0 +1,11 @@ +:::{#exm-cross-term-zero} +#### The vanishing cross term in the best-predictor exercise + +In @exr-best-predictor, take the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. +When $\Predvar = 0$, $\truemeanf{0} = 1$, so $\predfn_1\paren{0} - \truemeanf{0} = 2$, +and $\prederrf{\truemean} = 1 - \Outvar$ is $1$ or $-1$ with equal [probability](#def-probability), +so the product has conditional mean $0$. +The same cancellation happens when $\Predvar = 1$, +so the expectation of the product is $0$. + +::: diff --git a/_subfiles/_exm-prediction-error.qmd b/_subfiles/_exm-prediction-error.qmd new file mode 100644 index 000000000..944ea01bf --- /dev/null +++ b/_subfiles/_exm-prediction-error.qmd @@ -0,0 +1,10 @@ +:::{#exm-prediction-error} +#### Prediction error in the best-predictor exercise + +In @exr-best-predictor, +consider the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. +Its [prediction error](#def-prediction-error) is $\prederrf{\predfn_1} = 3 - \Outvar$. +This is $3$ when $\Outvar = 0$. +It is $-3$ when $\Outvar = 6$. + +::: diff --git a/_subfiles/_exm-risk-decomposition.qmd b/_subfiles/_exm-risk-decomposition.qmd new file mode 100644 index 000000000..e80bc0eee --- /dev/null +++ b/_subfiles/_exm-risk-decomposition.qmd @@ -0,0 +1,9 @@ +:::{#exm-risk-decomposition} +#### The risk decomposition in the best-predictor exercise + +In @exr-best-predictor, +the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$ has [squared-error risk](#def-squared-error-risk) $\popriskf{\predfn_1} = 5$, +which @thm-risk-decomposition splits as $5 = 1 + 4$: +the risk $1$ of the [conditional expectation function](#def-cond-expectation-function) plus the excess $4$ from using $\predfn_1$. + +::: diff --git a/_subfiles/_exm-squared-error-risk.qmd b/_subfiles/_exm-squared-error-risk.qmd new file mode 100644 index 000000000..f264f2076 --- /dev/null +++ b/_subfiles/_exm-squared-error-risk.qmd @@ -0,0 +1,8 @@ +:::{#exm-squared-error-risk} +#### Squared-error risk in the best-predictor exercise + +In @exr-best-predictor, +consider the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. +Its [squared-error risk](#def-squared-error-risk) is $\popriskf{\predfn_1} = 5$. + +::: diff --git a/_subfiles/_lem-cross-term-zero.qmd b/_subfiles/_lem-cross-term-zero.qmd index 73ed0fdff..53a97174d 100644 --- a/_subfiles/_lem-cross-term-zero.qmd +++ b/_subfiles/_lem-cross-term-zero.qmd @@ -44,17 +44,3 @@ $$ $$ ::: - -{{< slidebreak >}} - -:::{#exm-cross-term-zero} -#### The vanishing cross term in the best-predictor exercise - -In @exr-best-predictor, take the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$. -When $\Predvar = 0$, $\truemeanf{0} = 1$, so $\predfn_1\paren{0} - \truemeanf{0} = 2$, -and $\prederrf{\truemean} = 1 - \Outvar$ is $1$ or $-1$ with equal [probability](#def-probability), -so the product has conditional mean $0$. -The same cancellation happens when $\Predvar = 1$, -so the expectation of the product is $0$. - -::: diff --git a/_subfiles/_thm-risk-decomposition.qmd b/_subfiles/_thm-risk-decomposition.qmd index aa1ea5747..b16e99114 100644 --- a/_subfiles/_thm-risk-decomposition.qmd +++ b/_subfiles/_thm-risk-decomposition.qmd @@ -38,15 +38,3 @@ $$ $$ ::: - -{{< slidebreak >}} - -:::{#exm-risk-decomposition} -#### The risk decomposition in the best-predictor exercise - -In @exr-best-predictor, -the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$ has [squared-error risk](#def-squared-error-risk) $\popriskf{\predfn_1} = 5$, -which @thm-risk-decomposition splits as $5 = 1 + 4$: -the risk $1$ of the [conditional expectation function](#def-cond-expectation-function) plus the excess $4$ from using $\predfn_1$. - -::: diff --git a/expectation.qmd b/expectation.qmd index 486ccf95c..a7bdc1935 100644 --- a/expectation.qmd +++ b/expectation.qmd @@ -119,10 +119,18 @@ format: {{< slidebreak >}} +{{< include pds/_subfiles/_exm-prediction-error.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_def-squared-error-risk.qmd >}} {{< slidebreak >}} +{{< include pds/_subfiles/_exm-squared-error-risk.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_rem-squared-error-risk-is-risk.qmd >}} {{< slidebreak >}} @@ -135,10 +143,18 @@ format: {{< slidebreak >}} +{{< include pds/_subfiles/_exm-cross-term-zero.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_thm-risk-decomposition.qmd >}} {{< slidebreak >}} +{{< include pds/_subfiles/_exm-risk-decomposition.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_thm-best-predictor.qmd >}} {{< slidebreak >}} From 457d24a45698d7ccd80dc756e7edaf59087cf19b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:53:35 +0000 Subject: [PATCH 05/11] Define the reducible risk directly, leading with the term Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_def-reducible-risk.qmd | 9 ++++----- _subfiles/_rem-reducible-risk-notes.qmd | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_subfiles/_def-reducible-risk.qmd b/_subfiles/_def-reducible-risk.qmd index 251d7ba26..692aab404 100644 --- a/_subfiles/_def-reducible-risk.qmd +++ b/_subfiles/_def-reducible-risk.qmd @@ -1,11 +1,10 @@ :::{#def-reducible-risk} #### Reducible risk -In the squared-error risk decomposition of @thm-risk-decomposition, -the part of the [risk](#def-risk) that comes from choosing the [prediction function](#def-prediction-function) $\predfn$ instead of the [conditional mean](#def-cond-expectation-function), +The **reducible risk** of a [prediction function](#def-prediction-function) $\predfn$ +is the [expectation](#def-expectation) of the squared difference +between $\predfnf{\Predvar}$ and the [conditional mean](#def-cond-expectation-function) $\truemeanf{\Predvar}$ of the [outcome](#def-outcome): -$$\E{\sqf{\E{\Outvar \mid \Predvar} - \predfnf{\Predvar}}} \ge 0$$ - -is the **reducible risk**. +$$\E{\sqf{\predfnf{\Predvar} - \truemeanf{\Predvar}}}$$ ::: diff --git a/_subfiles/_rem-reducible-risk-notes.qmd b/_subfiles/_rem-reducible-risk-notes.qmd index 6f1a4e125..a4a28f462 100644 --- a/_subfiles/_rem-reducible-risk-notes.qmd +++ b/_subfiles/_rem-reducible-risk-notes.qmd @@ -8,5 +8,6 @@ $$\E{\sqf{\Outvar - \predfnf{\Predvar}}} = \E{\sqf{\Outvar - \E{\Outvar \mid \Pr shows that the total squared-error risk is the sum of the residual risk (@def-irreducible-risk) and the reducible risk (@def-reducible-risk). +[@james2021islr2e, Section 2.1.1, p. 18] calls the squared difference between a prediction and the conditional mean the "reducible error". ::: From 1b68c12d2cfec4b58861f6939472a768a89bc6ff Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:53:45 +0000 Subject: [PATCH 06/11] Link terms in the reducible-risk notes remark Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_rem-reducible-risk-notes.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_subfiles/_rem-reducible-risk-notes.qmd b/_subfiles/_rem-reducible-risk-notes.qmd index a4a28f462..51d8e5862 100644 --- a/_subfiles/_rem-reducible-risk-notes.qmd +++ b/_subfiles/_rem-reducible-risk-notes.qmd @@ -8,6 +8,6 @@ $$\E{\sqf{\Outvar - \predfnf{\Predvar}}} = \E{\sqf{\Outvar - \E{\Outvar \mid \Pr shows that the total squared-error risk is the sum of the residual risk (@def-irreducible-risk) and the reducible risk (@def-reducible-risk). -[@james2021islr2e, Section 2.1.1, p. 18] calls the squared difference between a prediction and the conditional mean the "reducible error". +[@james2021islr2e, Section 2.1.1, p. 18] calls the squared difference between a [prediction](#def-prediction) and the [conditional mean](#def-cond-expectation-function) the "reducible error". ::: From 21f703325fd0fbbab9eeb602e3d87a1ffa08b500 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 22:56:17 +0000 Subject: [PATCH 07/11] Use the narrative citation form and link prediction function in the notes remark Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019xfc9nVFCSNv3sBfesyDpL --- _subfiles/_rem-reducible-risk-notes.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_subfiles/_rem-reducible-risk-notes.qmd b/_subfiles/_rem-reducible-risk-notes.qmd index 51d8e5862..9178c15fa 100644 --- a/_subfiles/_rem-reducible-risk-notes.qmd +++ b/_subfiles/_rem-reducible-risk-notes.qmd @@ -8,6 +8,6 @@ $$\E{\sqf{\Outvar - \predfnf{\Predvar}}} = \E{\sqf{\Outvar - \E{\Outvar \mid \Pr shows that the total squared-error risk is the sum of the residual risk (@def-irreducible-risk) and the reducible risk (@def-reducible-risk). -[@james2021islr2e, Section 2.1.1, p. 18] calls the squared difference between a [prediction](#def-prediction) and the [conditional mean](#def-cond-expectation-function) the "reducible error". +@james2021islr2e [Section 2.1.1, p. 18] calls the squared difference between a [prediction function](#def-prediction-function) and the [conditional mean](#def-cond-expectation-function) the "reducible error". ::: From 8165b50c375d1d0bfcc8038bb17425488a815da4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 01:13:12 +0000 Subject: [PATCH 08/11] Name the prediction function f, not the value f(X), in relinked statements; link its first use in thm-best-predictor Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01FWgYrE7LQ7q9Lw5qkHaNiT --- _subfiles/_def-prediction-error.qmd | 2 +- _subfiles/_def-squared-error-risk.qmd | 2 +- _subfiles/_lem-cross-term-zero.qmd | 2 +- _subfiles/_thm-best-predictor.qmd | 4 ++-- _subfiles/_thm-risk-decomposition.qmd | 2 +- .../cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_subfiles/_def-prediction-error.qmd b/_subfiles/_def-prediction-error.qmd index e2d576220..77458f440 100644 --- a/_subfiles/_def-prediction-error.qmd +++ b/_subfiles/_def-prediction-error.qmd @@ -1,7 +1,7 @@ :::{#def-prediction-error} #### Prediction error -A [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ has as its [estimand](https://morrison-lab.github.io/sds/estimation.html#def-estimand) +A [prediction function](#def-prediction-function) $\predfn$ has as its [estimand](https://morrison-lab.github.io/sds/estimation.html#def-estimand) the observed [outcome](#def-outcome) $\Outvar$ of a [new observation](#def-new-observation) with [input](#def-input) $\Predvar$, not the [conditional mean](#def-cond-expectation-function) of that outcome. The **prediction error** of $\predfn$ is the prediction minus that outcome: diff --git a/_subfiles/_def-squared-error-risk.qmd b/_subfiles/_def-squared-error-risk.qmd index 402b1d3cd..354202090 100644 --- a/_subfiles/_def-squared-error-risk.qmd +++ b/_subfiles/_def-squared-error-risk.qmd @@ -1,7 +1,7 @@ :::{#def-squared-error-risk} #### Squared-error risk (expected prediction error) -The **squared-error risk** of a [prediction function](#def-prediction-function) $\predfnf{\Predvar}$, +The **squared-error risk** of a [prediction function](#def-prediction-function) $\predfn$, also called its **expected prediction error** [@hastie2009elements, p. 18], is the expected square of its [prediction error](#def-prediction-error): diff --git a/_subfiles/_lem-cross-term-zero.qmd b/_subfiles/_lem-cross-term-zero.qmd index 53a97174d..49eb84085 100644 --- a/_subfiles/_lem-cross-term-zero.qmd +++ b/_subfiles/_lem-cross-term-zero.qmd @@ -2,7 +2,7 @@ #### The conditional mean's error is uncorrelated with any function of the input Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. -For any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +For any [prediction function](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\E{\prederrf{\truemean} \cd \paren{\predfnf{\Predvar} - \truemeanf{\Predvar}}} = 0$$ diff --git a/_subfiles/_thm-best-predictor.qmd b/_subfiles/_thm-best-predictor.qmd index 5b7b2652a..ecf781a42 100644 --- a/_subfiles/_thm-best-predictor.qmd +++ b/_subfiles/_thm-best-predictor.qmd @@ -3,8 +3,8 @@ Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. -Write $\bestpredfn \eqdef \truemean$ for the prediction function that uses it. -Then for any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +Write $\bestpredfn \eqdef \truemean$ for the [prediction function](#def-prediction-function) that uses it. +Then for any [prediction function](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\popriskf{\predfn} \ge \popriskf{\bestpredfn}$$ diff --git a/_subfiles/_thm-risk-decomposition.qmd b/_subfiles/_thm-risk-decomposition.qmd index b16e99114..984bef6bd 100644 --- a/_subfiles/_thm-risk-decomposition.qmd +++ b/_subfiles/_thm-risk-decomposition.qmd @@ -2,7 +2,7 @@ #### Squared-error risk decomposition Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. -For any [prediction function](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$: +For any [prediction function](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\popriskf{\predfn} = \popriskf{\truemean} + \E{\sqf{\predfnf{\Predvar} - \truemeanf{\Predvar}}}$$ diff --git a/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd b/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd index 73ed3da46..cf2ea1a52 100644 --- a/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd +++ b/_subfiles/cor-best-predictor-argmin/_cor-best-predictor-argmin.qmd @@ -2,7 +2,7 @@ #### Conditional mean as the minimizer of squared-error risk Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. -Among [prediction functions](#def-prediction-function) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$, +Among [prediction functions](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$, the [conditional expectation function](#def-cond-expectation-function) is a [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer) of the [squared-error risk](#def-squared-error-risk): $$\E{\Outvar \mid \Predvar} \in \argmin_{\predfn} \E{\sqf{\Outvar - \predfnf{\Predvar}}},$$ From 5786fa2c7fc896ef0d12eafe31c70ee645f8e888 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 01:24:13 +0000 Subject: [PATCH 09/11] Name the prediction function f in cor-best-predictor-unique, call f1 a constant prediction function, and avoid a doubled link in thm-best-predictor Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01FWgYrE7LQ7q9Lw5qkHaNiT --- _subfiles/_exm-reducible-risk.qmd | 2 +- _subfiles/_thm-best-predictor.qmd | 2 +- .../cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd | 2 +- .../cor-best-predictor-unique/_cor-best-predictor-unique.qmd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_subfiles/_exm-reducible-risk.qmd b/_subfiles/_exm-reducible-risk.qmd index 8facd6765..a4ff5d34d 100644 --- a/_subfiles/_exm-reducible-risk.qmd +++ b/_subfiles/_exm-reducible-risk.qmd @@ -2,7 +2,7 @@ #### Reducible risk in the best-predictor exercise In @exr-best-predictor, -the constant prediction $\predfn_1\paren{\Predvar} = 3$ has reducible risk $5 - 1 = 4$, +the constant prediction function $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has reducible risk $5 - 1 = 4$, and the prediction $\predfn_2\paren{\Predvar} = 4\Predvar$ has reducible risk $2 - 1 = 1$. ::: diff --git a/_subfiles/_thm-best-predictor.qmd b/_subfiles/_thm-best-predictor.qmd index ecf781a42..9d11521a4 100644 --- a/_subfiles/_thm-best-predictor.qmd +++ b/_subfiles/_thm-best-predictor.qmd @@ -4,7 +4,7 @@ Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. Let $\truemeanf{\Predvar} \eqdef \E{\Outvar \mid \Predvar}$ be the [conditional expectation function](#def-cond-expectation-function) of $\Outvar$ given $\Predvar$. Write $\bestpredfn \eqdef \truemean$ for the [prediction function](#def-prediction-function) that uses it. -Then for any [prediction function](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$: +Then for any prediction function $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$: $$\popriskf{\predfn} \ge \popriskf{\bestpredfn}$$ diff --git a/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd b/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd index 786ae98b1..be12c0732 100644 --- a/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd +++ b/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd @@ -2,7 +2,7 @@ #### The minimizer in the best-predictor exercise In @exr-best-predictor, the [conditional expectation function](#def-cond-expectation-function) $\bestpredfnf{\Predvar}$ has [risk](#def-risk) $1$. -The constant prediction $\predfn_1\paren{\Predvar} = 3$ has risk $5$ and $\predfn_2\paren{\Predvar} = 4\Predvar$ has risk $2$, both larger than $1$. +The constant prediction function $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has risk $5$ and $\predfn_2\paren{\Predvar} = 4\Predvar$ has risk $2$, both larger than $1$. So $\bestpredfn$ is the [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer) among the three. ::: diff --git a/_subfiles/cor-best-predictor-unique/_cor-best-predictor-unique.qmd b/_subfiles/cor-best-predictor-unique/_cor-best-predictor-unique.qmd index 1db240f65..c4ab82294 100644 --- a/_subfiles/cor-best-predictor-unique/_cor-best-predictor-unique.qmd +++ b/_subfiles/cor-best-predictor-unique/_cor-best-predictor-unique.qmd @@ -2,7 +2,7 @@ #### The minimizer of squared-error risk is unique up to probability-1 equality Let $\Predvar$ and $\Outvar$ be [jointly distributed](random-variables.qmd#def-jointly-distributed) random variables with $\E{\Outvar^2} < \infty$. -Every [prediction function](#def-prediction) $\predfnf{\Predvar}$ with $\E{\predfnf{\Predvar}^2} < \infty$ +Every [prediction function](#def-prediction-function) $\predfn$ with $\E{\predfnf{\Predvar}^2} < \infty$ that is a [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer) of the [squared-error risk](#def-squared-error-risk) (see @cor-best-predictor-argmin) satisfies: From 9e430d751b44df2636ad0d35d40316ab3457309c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 01:24:26 +0000 Subject: [PATCH 10/11] Link the first uses of prediction function and reducible risk in the examples Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01FWgYrE7LQ7q9Lw5qkHaNiT --- _subfiles/_exm-reducible-risk.qmd | 2 +- .../cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_subfiles/_exm-reducible-risk.qmd b/_subfiles/_exm-reducible-risk.qmd index a4ff5d34d..79e884834 100644 --- a/_subfiles/_exm-reducible-risk.qmd +++ b/_subfiles/_exm-reducible-risk.qmd @@ -2,7 +2,7 @@ #### Reducible risk in the best-predictor exercise In @exr-best-predictor, -the constant prediction function $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has reducible risk $5 - 1 = 4$, +the constant [prediction function](#def-prediction-function) $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has [reducible risk](#def-reducible-risk) $5 - 1 = 4$, and the prediction $\predfn_2\paren{\Predvar} = 4\Predvar$ has reducible risk $2 - 1 = 1$. ::: diff --git a/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd b/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd index be12c0732..84e506b5e 100644 --- a/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd +++ b/_subfiles/cor-best-predictor-argmin/_exm-best-predictor-argmin.qmd @@ -2,7 +2,7 @@ #### The minimizer in the best-predictor exercise In @exr-best-predictor, the [conditional expectation function](#def-cond-expectation-function) $\bestpredfnf{\Predvar}$ has [risk](#def-risk) $1$. -The constant prediction function $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has risk $5$ and $\predfn_2\paren{\Predvar} = 4\Predvar$ has risk $2$, both larger than $1$. +The constant [prediction function](#def-prediction-function) $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has risk $5$ and $\predfn_2\paren{\Predvar} = 4\Predvar$ has risk $2$, both larger than $1$. So $\bestpredfn$ is the [minimizer](https://morrison-lab.github.io/mds/algebra-basics.html#def-global-minimizer) among the three. ::: From 3f59df201c2877cd392d8105c12a03829ac43917 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 01:30:49 +0000 Subject: [PATCH 11/11] Describe f2 as a prediction function, like f1, in the reducible-risk example Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01FWgYrE7LQ7q9Lw5qkHaNiT --- _subfiles/_exm-reducible-risk.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_subfiles/_exm-reducible-risk.qmd b/_subfiles/_exm-reducible-risk.qmd index 79e884834..e12e1035c 100644 --- a/_subfiles/_exm-reducible-risk.qmd +++ b/_subfiles/_exm-reducible-risk.qmd @@ -3,6 +3,6 @@ In @exr-best-predictor, the constant [prediction function](#def-prediction-function) $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has [reducible risk](#def-reducible-risk) $5 - 1 = 4$, -and the prediction $\predfn_2\paren{\Predvar} = 4\Predvar$ has reducible risk $2 - 1 = 1$. +and the prediction function $\predfn_2$, with $\predfn_2\paren{\Predvar} = 4\Predvar$, has reducible risk $2 - 1 = 1$. :::