Skip to content

Use the true mean function in the squared-error risk decomposition - #210

Merged
d-morrison merged 3 commits into
mainfrom
claude/true-mean-fn-risk-decomposition
Oct 18, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/true-mean-fn-risk-decomposition

Conversation

@d-morrison

@d-morrison d-morrison commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Important

Stacked on #209, which has to land first. Merge with a merge commit, not a squash.

Before: #thm-risk-decomposition and its two lemmas wrote the conditional mean $\E{Y \mid X}$ as $g^*$.

After: they write it as the true mean function $\mu(X)$, matching sds#326.
#thm-best-predictor now says $g^* \eqdef \mu$, so the corollaries and the exercise keep $g^*$ where they state the risk-minimizing property.

How: the latex-macros submodule is bumped to Morrison-Lab/macros c14884b, which adds \truemean and \truemeanf (macros#225); the long names \truemeanfn and \truemeanfnf are deprecated, so this PR uses the short ones.
\bestpredfn becomes \truemean and \bestpredfnf becomes \truemeanf in _thm-risk-decomposition.qmd, _lem-cross-term-zero.qmd and _lem-prediction-error-split.qmd.
The bump from the old pin also renamed \X1n, \Xx1n and \prodi1n to \Xin, \Xxin and \prodin; _def-independence.qmd and _def-pdf-pmf-cdf.qmd use the new names. Those three were the only removed macros that pds uses.
Checked in Chromium on the preview of the earlier commit: 0 MathJax errors on the Expectation and Independence pages.

🤖 Generated with Claude Code

https://claude.ai/code/session_014bhxtsGQ75Wr4yqcz23NqE

Bump latex-macros to a commit that defines \truemeanfn, and use it where the
conditional mean is introduced as the true mean function: the decomposition
and its two lemmas. Keep \bestpredfn in the best-predictor results.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014bhxtsGQ75Wr4yqcz23NqE
@d-morrison d-morrison self-assigned this Oct 18, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

\X1n, \Xx1n and \prodi1n became \Xin, \Xxin and \prodin in Morrison-Lab/macros.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014bhxtsGQ75Wr4yqcz23NqE

Copy link
Copy Markdown
Contributor Author

The build / build check failed on 8b6c992: the PDF of the independence page stopped on Undefined control sequence \X1n. The latex-macros bump in this PR renamed \X1n, \Xx1n and \prodi1n to \Xin, \Xxin and \prodin, and _def-independence.qmd and _def-pdf-pmf-cdf.qmd still used the old names. 66d8f25 renames them. I compared the macro definitions at the old and new pins, and those three are the only removed names that pds uses. The independence PDF now renders locally.


Posted by Claude Code (AI agent), not written by a human.
Generated by Claude Code


Generated by Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Bump latex-macros to the commit that adds \truemean and \truemeanf, and use
them in place of the deprecated \truemeanfn and \truemeanfnf.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014bhxtsGQ75Wr4yqcz23NqE
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


The new macros \truemean and \truemeanf are defined in the bumped submodule at latex-macros/macros.qmd:198-199. No instance of the old \truemeanfn or \truemeanfnf remains in the four edited files. That also covers the \bestpredfn \eqdef \truemean alias in _subfiles/_thm-best-predictor.qmd:6, which still expands to μ. I did not render the site.

Review of eaeaf8e ("Use the short true mean macros")

The commit renames \truemeanfn to \truemean and \truemeanfnf to \truemeanf in _lem-cross-term-zero, _lem-prediction-error-split, _thm-best-predictor and _thm-risk-decomposition. It also bumps the latex-macros submodule to c14884b.

  • Macros exist: \truemean and \truemeanf resolve to the same μ and μ(·) as the long forms. The long forms are still defined, so any remaining use elsewhere would not break.
  • Math unchanged: only the macro names changed. The proof steps, example numbers and \prederr_{\truemean} subscripts read as before.
  • Anchors: no #ids or links were touched.

My earlier suggestion about mixed μ and g* notation still applies and is still non-blocking. \bestpredfn and \bestpredfnf remain in _exr-best-predictor, _sol-best-predictor, _cor-best-predictor-argmin, _cor-best-predictor-unique and the rest of _thm-best-predictor. The alias line at _subfiles/_thm-best-predictor.qmd:6 links the two notations only inside that theorem.

The prior verdict, Ready for merge (comment of 2026-10-18T07:43:54Z), still stands.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "eaeaf8ef3600c541e24e297a08fca63e4c69c136",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked the truemean and truemeanf replacements in four subfiles against the bumped submodule macros at lines 198-199; all are defined and no long-form names remain in the edited files.",
  "holistic_assessment": "The commit is a mechanical rename matching the submodule bump, with no changed anchors, no math changes, and only the earlier optional notation-consistency suggestion remaining."
}

Reviewed commit: eaeaf8e

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.1903 (review) — run

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-10-18 18:27 UTC

Base automatically changed from claude/project-thread-mj8yjt to main October 18, 2026 18:26
@d-morrison
d-morrison merged commit f2d9e75 into main Oct 18, 2026
19 checks passed
@d-morrison
d-morrison deleted the claude/true-mean-fn-risk-decomposition branch October 18, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants