diff --git a/_subfiles/_def-prediction-error.qmd b/_subfiles/_def-prediction-error.qmd index 77458f44..118cabef 100644 --- a/_subfiles/_def-prediction-error.qmd +++ b/_subfiles/_def-prediction-error.qmd @@ -1,11 +1,9 @@ :::{#def-prediction-error} #### Prediction error -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: +The **prediction error** of a [prediction](#def-prediction) $\est{\Outvar}$ of an [outcome](#def-outcome) $\Outvar$ +is the prediction minus the outcome: -$$\prederrf{\predfn} \eqdef \predfnf{\Predvar} - \Outvar$$ +$$\prederrf{\est{\Outvar}} \eqdef \est{\Outvar} - \Outvar$$ ::: diff --git a/_subfiles/_exm-prediction-error-split.qmd b/_subfiles/_exm-prediction-error-split.qmd new file mode 100644 index 00000000..6946f6e5 --- /dev/null +++ b/_subfiles/_exm-prediction-error-split.qmd @@ -0,0 +1,11 @@ +:::{#exm-prediction-error-split} +#### The split in the best-predictor exercise + +In @exr-best-predictor, +when $\Predvar = 0$ and $\Outvar = 0$, +the constant [prediction function](#def-prediction-function) $\predfn_1$, with $\predfn_1\paren{\Predvar} = 3$, has [prediction error](#def-prediction-error) $\prederrf{\predfn_1} = 3$. +The conditional mean is $\truemeanf{0} = 1$, +so $\prederrf{\truemean} = 1$ and $\devof{\predfn_1\paren{0}}{\truemeanf{0}} = 2$, +and $3 = 1 + 2$. + +::: diff --git a/_subfiles/_lem-prediction-error-split.qmd b/_subfiles/_lem-prediction-error-split.qmd index 036d8aaf..98daa71f 100644 --- a/_subfiles/_lem-prediction-error-split.qmd +++ b/_subfiles/_lem-prediction-error-split.qmd @@ -2,39 +2,28 @@ #### Prediction error splits at the conditional mean 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}$, -the [prediction error](#def-prediction-error) splits as: +For any [prediction function](#def-prediction-function) $\predfn$, +the [prediction error](#def-prediction-error) of $\predfn$ is the prediction error of $\truemean$ +plus the difference $\devof{\predfnf{\Predvar}}{\truemeanf{\Predvar}}$ between the [prediction](#def-prediction) $\predfnf{\Predvar}$ and $\truemeanf{\Predvar}$: -$$\prederrf{\predfn} = \prederrf{\truemean} + \paren{\predfnf{\Predvar} - \truemeanf{\Predvar}}$$ +$$\prederrf{\predfn} = \prederrf{\truemean} + \devof{\predfnf{\Predvar}}{\truemeanf{\Predvar}}$$ ::: ::: proof +The notation $\prederrf{\predfn}$ is introduced in @rem-prediction-error. + $$ \ba \prederrf{\predfn} &= \predfnf{\Predvar} - \Outvar -&& \text{(definition of } \prederrf{\predfn} \text{)} \\ -&= \paren{\truemeanf{\Predvar} - \Outvar} + \paren{\predfnf{\Predvar} - \truemeanf{\Predvar}} +&& \text{(prediction error notation)} \\ +&= \paren{\truemeanf{\Predvar} - \Outvar} + \devof{\predfnf{\Predvar}}{\truemeanf{\Predvar}} && \text{(add and subtract } \truemeanf{\Predvar} \text{)} \\ -&= \prederrf{\truemean} + \paren{\predfnf{\Predvar} - \truemeanf{\Predvar}} -&& \text{(definition of } \prederrf{\truemean} \text{)} +&= \prederrf{\truemean} + \devof{\predfnf{\Predvar}}{\truemeanf{\Predvar}} +&& \text{(prediction error notation)} \ea $$ ::: - -{{< slidebreak >}} - -:::{#exm-prediction-error-split} -#### The split in the best-predictor exercise - -In @exr-best-predictor, -when $\Predvar = 0$ and $\Outvar = 0$, -the constant [prediction](#def-prediction) $\predfn_1\paren{\Predvar} = 3$ has [prediction error](#def-prediction-error) $\prederrf{\predfn_1} = 3$. -The conditional mean is $\truemeanf{0} = 1$, -so $\prederrf{\truemean} = 1$ and $\predfn_1\paren{0} - \truemeanf{0} = 2$, -and $3 = 1 + 2$. - -::: diff --git a/_subfiles/_rem-irreducible-risk.qmd b/_subfiles/_rem-irreducible-risk.qmd index 821b91fd..51281ba3 100644 --- a/_subfiles/_rem-irreducible-risk.qmd +++ b/_subfiles/_rem-irreducible-risk.qmd @@ -4,7 +4,7 @@ The [residual risk](#def-irreducible-risk) depends only on the [joint distribution](random-variables.qmd#def-joint-distribution) of $(\Predvar, \Outvar)$ and not on the prediction function $\predfn$, so no choice of $\predfn$ can achieve a smaller risk. -It is the minimum only among [prediction functions](#def-prediction) of the given $\Predvar$: +It is the minimum only among [prediction functions](#def-prediction-function) of the given $\Predvar$: the [outcome](#def-outcome) may also depend on variables that $\Predvar$ leaves out, and those variables are part of the unexplained variation $\Outvar - \E{\Outvar \mid \Predvar}$. Measuring one of them and adding it to the variables in $\Predvar$ can lower the residual risk, diff --git a/_subfiles/_rem-prediction-error.qmd b/_subfiles/_rem-prediction-error.qmd new file mode 100644 index 00000000..3a253ca4 --- /dev/null +++ b/_subfiles/_rem-prediction-error.qmd @@ -0,0 +1,15 @@ +:::{#rem-prediction-error} +#### The prediction error of a prediction function + +A [prediction function](#def-prediction-function) $\predfn$ makes the [prediction](#def-prediction) $\predfnf{\Predvar}$ +for the [outcome](#def-outcome) $\Outvar$ of a [new observation](#def-new-observation) with [input](#def-input) $\Predvar$. +We write $\prederrf{\predfn}$ for the [prediction error](#def-prediction-error) of that prediction, +meaning $\prederrf{\predfnf{\Predvar}}$. +It is + +$$\prederrf{\predfn} = \predfnf{\Predvar} - \Outvar$$ + +The reference value in a prediction error is the observed outcome $\Outvar$, +not the [conditional mean](#def-cond-expectation-function) of that outcome. + +::: diff --git a/_subfiles/_rem-reducible-risk.qmd b/_subfiles/_rem-reducible-risk.qmd index 62a5ed7d..4a792f39 100644 --- a/_subfiles/_rem-reducible-risk.qmd +++ b/_subfiles/_rem-reducible-risk.qmd @@ -1,7 +1,7 @@ ::: {#rem-reducible-risk} #### When the reducible risk is zero -The [reducible risk](#def-reducible-risk) is zero if and only if the [prediction function](#def-prediction) $\predfn$ equals the [conditional expectation function](#def-cond-expectation-function) with [probability](probability-basics.qmd#def-probability) 1. +The [reducible risk](#def-reducible-risk) is zero if and only if the [prediction function](#def-prediction-function) $\predfn$ equals the [conditional expectation function](#def-cond-expectation-function) with [probability](probability-basics.qmd#def-probability) 1. $$ \E{\sqf{\E{\Outvar \mid \Predvar} - \predfnf{\Predvar}}} = 0 diff --git a/expectation.qmd b/expectation.qmd index a7bdc193..3b22bffd 100644 --- a/expectation.qmd +++ b/expectation.qmd @@ -123,6 +123,10 @@ format: {{< slidebreak >}} +{{< include pds/_subfiles/_rem-prediction-error.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_def-squared-error-risk.qmd >}} {{< slidebreak >}} @@ -139,6 +143,10 @@ format: {{< slidebreak >}} +{{< include pds/_subfiles/_exm-prediction-error-split.qmd >}} + +{{< slidebreak >}} + {{< include pds/_subfiles/_lem-cross-term-zero.qmd >}} {{< slidebreak >}}