From e031f9662143be5c0bfaf065965cf0118ed95bd1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 05:34:46 +0000 Subject: [PATCH 1/2] Write the change in the predictor vector as \diffvpredvar Moves the latex-macros pin to Morrison-Lab/macros#426, which adds \diffvpredvar, and uses it in the odds-multiplier results in place of the hand-written \diff \vpredvar, as rme uses \diffvx (sds#617). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019xfc9qrViJfWgYsyX5QcEX --- .../_cor-logistic-odds-ratio.qmd | 6 +++--- .../_def-odds-multiplier.qmd | 6 +++--- .../_exm-not-odds-multiplier.qmd | 2 +- .../_exm-odds-multiplier.qmd | 2 +- .../_exm-thm-odds-multiplier.qmd | 4 ++-- .../_thm-odds-multiplier.qmd | 18 +++++++++--------- latex-macros | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/_subfiles/logistic-inference/_cor-logistic-odds-ratio.qmd b/_subfiles/logistic-inference/_cor-logistic-odds-ratio.qmd index 5402fee2f..b9617fc21 100644 --- a/_subfiles/logistic-inference/_cor-logistic-odds-ratio.qmd +++ b/_subfiles/logistic-inference/_cor-logistic-odds-ratio.qmd @@ -12,7 +12,7 @@ $$ ::: proof -Let $\diff \vpredvar \eqdef \vpredvar' - \vpredvar$, so that $\vpredvar' = \vpredvar + \diff \vpredvar$, and the first entry of $\diff \vpredvar$ is $1 - 1 = 0$. +Let $\diffvpredvar \eqdef \vpredvar' - \vpredvar$, so that $\vpredvar' = \vpredvar + \diffvpredvar$, and the first entry of $\diffvpredvar$ is $1 - 1 = 0$. $$ \ba @@ -20,10 +20,10 @@ $$ &= \frac{\oddsf{\vpredvar'}}{\oddsf{\vpredvar}} && \text{(definition of the odds ratio)} \\ -&= \frac{\oddsf{\vpredvar} \, \oddsfactorf{\diff \vpredvar}}{\oddsf{\vpredvar}} +&= \frac{\oddsf{\vpredvar} \, \oddsfactorf{\diffvpredvar}}{\oddsf{\vpredvar}} && \text{(odds multiplier theorem)} \\ -&= \oddsfactorf{\diff \vpredvar}. +&= \oddsfactorf{\diffvpredvar}. && \text{(divide numerator and denominator by } \oddsf{\vpredvar} > 0 \text{)} \ea $$ diff --git a/_subfiles/logistic-inference/_def-odds-multiplier.qmd b/_subfiles/logistic-inference/_def-odds-multiplier.qmd index 1bf3b1671..68329c9a8 100644 --- a/_subfiles/logistic-inference/_def-odds-multiplier.qmd +++ b/_subfiles/logistic-inference/_def-odds-multiplier.qmd @@ -4,12 +4,12 @@ Let: - $\vcoef$ be the coefficient vector of a [logistic regression model](#def-logistic-regression). -- $\diff \vpredvar$ be a change in the [predictor](https://morrison-lab.github.io/pds/expectation.html#def-input) vector, whose first entry is $0$, because every predictor vector has first entry $1$. +- $\diffvpredvar$ be a change in the [predictor](https://morrison-lab.github.io/pds/expectation.html#def-input) vector, whose first entry is $0$, because every predictor vector has first entry $1$. -The **odds multiplier** of $\diff \vpredvar$ is the [exponential](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-exponential-function) of the [dot product](https://morrison-lab.github.io/mds/linear-algebra-vectors.html#def-dot-product) of $\vcoef$ with $\diff \vpredvar$: +The **odds multiplier** of $\diffvpredvar$ is the [exponential](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-exponential-function) of the [dot product](https://morrison-lab.github.io/mds/linear-algebra-vectors.html#def-dot-product) of $\vcoef$ with $\diffvpredvar$: $$ -\oddsfactorf{\diff \vpredvar} \eqdef \e{\dprod{\vcoef}{\diff \vpredvar}}. +\oddsfactorf{\diffvpredvar} \eqdef \e{\dprod{\vcoef}{\diffvpredvar}}. $$ ::: diff --git a/_subfiles/logistic-inference/_exm-not-odds-multiplier.qmd b/_subfiles/logistic-inference/_exm-not-odds-multiplier.qmd index 61e57381e..b207f2cfe 100644 --- a/_subfiles/logistic-inference/_exm-not-odds-multiplier.qmd +++ b/_subfiles/logistic-inference/_exm-not-odds-multiplier.qmd @@ -4,7 +4,7 @@ In the [six-patient trial](#exm-logistic-regression), the [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) of recovery under the [maximum likelihood fit](intro-MLEs.qmd#def-mle) is $2/3$ in the treatment group and $1/3$ in the control group. The code computes the [risk ratio](categorical-tests.qmd#def-risk-ratio) of treatment against control, -and shows beside it the [odds multiplier](#def-odds-multiplier) of the change $\diff \vpredvar = \tp{\paren{0, 2}}$ from @exm-odds-multiplier. +and shows beside it the [odds multiplier](#def-odds-multiplier) of the change $\diffvpredvar = \tp{\paren{0, 2}}$ from @exm-odds-multiplier. ```{r} #| code-fold: false diff --git a/_subfiles/logistic-inference/_exm-odds-multiplier.qmd b/_subfiles/logistic-inference/_exm-odds-multiplier.qmd index d092591c9..f06563c88 100644 --- a/_subfiles/logistic-inference/_exm-odds-multiplier.qmd +++ b/_subfiles/logistic-inference/_exm-odds-multiplier.qmd @@ -2,7 +2,7 @@ #### The odds multiplier of moving from control to treatment -In the [six-patient trial](#exm-logistic-regression), moving a patient from the control group ($\predvar = -1$) to the treatment group ($\predvar = +1$) changes the predictor vector by $\diff \vpredvar = \tp{\paren{0, 2}}$. +In the [six-patient trial](#exm-logistic-regression), moving a patient from the control group ($\predvar = -1$) to the treatment group ($\predvar = +1$) changes the predictor vector by $\diffvpredvar = \tp{\paren{0, 2}}$. The code computes the [odds multiplier](#def-odds-multiplier) of that change under the [maximum likelihood fit](intro-MLEs.qmd#def-mle). ```{r} diff --git a/_subfiles/logistic-inference/_exm-thm-odds-multiplier.qmd b/_subfiles/logistic-inference/_exm-thm-odds-multiplier.qmd index c92b11e3d..2bae40c81 100644 --- a/_subfiles/logistic-inference/_exm-thm-odds-multiplier.qmd +++ b/_subfiles/logistic-inference/_exm-thm-odds-multiplier.qmd @@ -2,9 +2,9 @@ #### The treated odds from the control odds -In the [six-patient trial](#exm-logistic-regression), take $\vpredvar = \tp{\paren{1, -1}}$, a control patient, and $\diff \vpredvar = \tp{\paren{0, 2}}$, so that $\vpredvar' = \tp{\paren{1, 1}}$ is a treated patient. +In the [six-patient trial](#exm-logistic-regression), take $\vpredvar = \tp{\paren{1, -1}}$, a control patient, and $\diffvpredvar = \tp{\paren{0, 2}}$, so that $\vpredvar' = \tp{\paren{1, 1}}$ is a treated patient. Under the [maximum likelihood fit](intro-MLEs.qmd#def-mle), the code computes the [odds](https://morrison-lab.github.io/pds/probability-basics.html#def-odds) of recovery at both [predictor](https://morrison-lab.github.io/pds/expectation.html#def-input) vectors, -and the control odds times the [odds multiplier](#def-odds-multiplier) of $\diff \vpredvar$. +and the control odds times the [odds multiplier](#def-odds-multiplier) of $\diffvpredvar$. ```{r} #| code-fold: false diff --git a/_subfiles/logistic-inference/_thm-odds-multiplier.qmd b/_subfiles/logistic-inference/_thm-odds-multiplier.qmd index 7e04de776..c4d786082 100644 --- a/_subfiles/logistic-inference/_thm-odds-multiplier.qmd +++ b/_subfiles/logistic-inference/_thm-odds-multiplier.qmd @@ -4,13 +4,13 @@ Let: - $\vpredvar$ be a [predictor](https://morrison-lab.github.io/pds/expectation.html#def-input) vector in the [logistic regression model](#def-logistic-regression) of @eq-logistic-model. -- $\diff \vpredvar$ be a change in the predictor vector, with first entry $0$. -- $\vpredvar' \eqdef \vpredvar + \diff \vpredvar$. +- $\diffvpredvar$ be a change in the predictor vector, with first entry $0$. +- $\vpredvar' \eqdef \vpredvar + \diffvpredvar$. -Then the [odds](https://morrison-lab.github.io/pds/probability-basics.html#def-odds) of $\Outvar = 1$ at $\vpredvar'$ are the odds at $\vpredvar$ times the [odds multiplier](#def-odds-multiplier) of $\diff \vpredvar$: +Then the [odds](https://morrison-lab.github.io/pds/probability-basics.html#def-odds) of $\Outvar = 1$ at $\vpredvar'$ are the odds at $\vpredvar$ times the [odds multiplier](#def-odds-multiplier) of $\diffvpredvar$: $$ -\oddsf{\vpredvar'} = \oddsf{\vpredvar} \, \oddsfactorf{\diff \vpredvar}. +\oddsf{\vpredvar'} = \oddsf{\vpredvar} \, \oddsfactorf{\diffvpredvar}. $$ ::: @@ -27,19 +27,19 @@ $$ &= \e{\dprod{\vcoef}{\vpredvar'}} && \text{(log-odds of the model at } \vpredvar' \text{)} \\ -&= \e{\dprod{\vcoef}{\paren{\vpredvar + \diff \vpredvar}}} +&= \e{\dprod{\vcoef}{\paren{\vpredvar + \diffvpredvar}}} && \text{(definition of } \vpredvar' \text{)} \\ -&= \e{\dprod{\vcoef}{\vpredvar} + \dprod{\vcoef}{\diff \vpredvar}} +&= \e{\dprod{\vcoef}{\vpredvar} + \dprod{\vcoef}{\diffvpredvar}} && \text{(the dot product is linear in each slot)} \\ -&= \e{\dprod{\vcoef}{\vpredvar}} \, \e{\dprod{\vcoef}{\diff \vpredvar}} +&= \e{\dprod{\vcoef}{\vpredvar}} \, \e{\dprod{\vcoef}{\diffvpredvar}} && \text{(} \e{a + b} = \e{a} \e{b} \text{)} \\ -&= \oddsf{\vpredvar} \, \e{\dprod{\vcoef}{\diff \vpredvar}} +&= \oddsf{\vpredvar} \, \e{\dprod{\vcoef}{\diffvpredvar}} && \text{(log-odds of the model at } \vpredvar \text{)} \\ -&= \oddsf{\vpredvar} \, \oddsfactorf{\diff \vpredvar}. +&= \oddsf{\vpredvar} \, \oddsfactorf{\diffvpredvar}. && \text{(definition of the odds multiplier)} \ea $$ diff --git a/latex-macros b/latex-macros index e44512574..ae1d822fc 160000 --- a/latex-macros +++ b/latex-macros @@ -1 +1 @@ -Subproject commit e445125749808ed743c93ef1b2b20824ec067e1e +Subproject commit ae1d822fca56e2df2fe1c8d44adaae0d81e879b2 From 96783418993df47632213ceb2e2421b3ce7363d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 06:00:21 +0000 Subject: [PATCH 2/2] Brace the interval in the uniform example title so the PDF compiles Quarto puts a theorem-type title in the optional argument of \begin{example}[...], so the "]" of $[0, \highend]$ closed that argument early and pdflatex stopped with "Extra }, or forgotten $" on exponential-families.qmd. Every Quarto Publish run on main has failed this way since 2026-11-12 04:25 UTC, so the site has not republished. Bracing the math keeps the "]" inside a group; the output is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019xfc9qrViJfWgYsyX5QcEX --- .../_exm-uniform-not-exponential-family.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_subfiles/exponential-families/_exm-uniform-not-exponential-family.qmd b/_subfiles/exponential-families/_exm-uniform-not-exponential-family.qmd index 285fd8344..f868c4154 100644 --- a/_subfiles/exponential-families/_exm-uniform-not-exponential-family.qmd +++ b/_subfiles/exponential-families/_exm-uniform-not-exponential-family.qmd @@ -1,5 +1,5 @@ :::{#exm-uniform-not-exponential-family} -#### The uniform distribution on $[0, \highend]$ is not an exponential family +#### The uniform distribution on ${[0, \highend]}$ is not an exponential family