Repository navigation
Port worthwhile Bayes and MSE derivation work from rme#1194 and rme#1196 - #94
d-morrison wants to merge 4 commits into
Conversation
rme#1234 deletes rme's statistics appendices now that sds hosts them, so the open rme PRs that edited those appendices (#1194 and #1196) would lose their work. This commit carries over the parts that add something sds lacks, rewritten to sds's style: - A continuous-prior posterior example (uniform prior, one head), computing the marginal likelihood as an integral (from rme#1194). - The normal-normal likelihood and posterior derivations split into one operation per line (from rme#1194's step-by-step derivations). - A continuous-state Markov chain example (first-order autoregressive), with its stationary distribution derived as an exercise and checked by simulation, rather than asserted (from rme#1194). - A reading of the Beta(56, 37) credible interval as a probability statement about the parameter (from rme#1194), with the interval computed rather than hard-coded. - The cancel step in the squared-bias-plus-variance solution split into its reorder, group, a - a = 0 and a + 0 = a steps, in the spirit of rme#1196's fully annotated MSE derivation. Items sds already covers as well or better (the annotated bias proof, the DIC and burn-in examples, which sds bases on real draws) and pure wording churn were not ported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPxetNyfUNvZoA23DwYCUg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Record the AR(1) stationary distribution as a theorem whose proof cites the exercise, per the exercise -> solution -> theorem -> proof pattern. - Show the 0.9^2 substitution instead of a hard-coded 0.81. - Say the credible-interval probability is approximately 0.95, since the printed endpoints are rounded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPxetNyfUNvZoA23DwYCUg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
check-dois failed because publisher DOI endpoints didn't respond: Generated by Claude Code |
ai-config's AGENTS.md asks for a label on every display equation, so each new one gets a number and a stable URL. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPxetNyfUNvZoA23DwYCUg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPxetNyfUNvZoA23DwYCUg
|
Claude finished review — View run Commit What I checked
VerdictReady for merge Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "66292168a7c578216b9bd2248895bef42048f645",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "The changed line in _exr-ar1-stationary.qmd uses inline R for 0.9^2 and 1-0.9^2, which render as 0.81 and 0.19, matching the prior hardcoded text.",
"holistic_assessment": "The commit is a one-line, scoped follow-up that leaves the earlier clean verdict intact, with no regression, integration or build-artifact concerns."
}Reviewed commit: 6629216 |
|
Cross-model adversarial review (OpenCode harness, GPT-6 Luna model) at head 6629216: ALL CLEAR, after fixes for the "approximately 0.95" credible-interval wording, a theorem and proof recording the AR(1) stationary distribution, labelled display equations, and inline-computed intermediate values. The reviewer's suggestion to move the Casella and Berger citation into a Source callout was declined, because it supports one factual step rather than crediting adapted content. Posted by Claude Code (AI agent) --- not written by a human. Generated by Claude Code |
Built to branch |
Requested by Ezra · project thread
Before: rme#1234 deletes rme's statistics appendices now that sds hosts them. Two open rme PRs, rme#1194 (Bayesian inference subfiles) and rme#1196 (
estimation.qmdandproof-mse-bias-variance.qmd), edited those appendices. Their work would be lost along with the files.After: The parts of those PRs that add something sds lacked are now in sds, rewritten to sds's style (one operation per line with a reason, exercise and solution for derivations, semantic macros, computed rather than hard-coded values). Everything else was checked against sds's current content and left out for the reasons listed under "Skipped".
How
Ported from rme#1194:
#exm-marginal-likelihood-uniforminbayesian-inference.qmd, after#exm-marginal-likelihood. It works out the marginal likelihood as an integral, then the posterior2θand its mean 2/3, one step per line. It doesn't name the Beta family, because the Beta family is introduced later on the page.#exm-normal-normal. The combined "expanding the square; Σxᵢ = n x̄" step and the combined "adding exponents" and "factoring; definition of m" steps are now split into single operations. The skeptical-prior derivation in sds already had the rme PR's level of detail, so it is unchanged.#exm-ar1-chain(states the chain and shows the Markov property) and#exr-ar1-stationary/#sol-ar1-stationaryinmcmc.qmd, after#exm-two-state-chain. The rme PR stated the stationary distribution N(0, σ²/(1−ρ²)) without proof. Here it is derived, and the solution shows that no N(0, v) is stationary when |ρ| ≥ 1. A simulation checks the result. The solution adds a\arcoefmacro to_macros-sds.qmd.#exm-beta-bernoulli. The endpoints are computed inline: [0.501, 0.699].Ported in the spirit of rme#1196 (full annotation of the MSE = bias² + variance derivation):
#sol-bias-sq-plus-var: the single "cancel" step is split into reorder, group, a − a = 0 and a + 0 = a.Skipped:
#sol-bias-exprsalready has the same annotated steps.#exm-dic-bernoullialready computes DIC from real posterior draws.#exm-burninalready shows burn-in with simulated chains.\eqdefchanges. sds's parent pages already place the slidebreaks. The\eqdefin rme#1194's Markov-chain definition was wrong anyway (see below).Errors found in the source PRs:
\eqdefin the Markov-chain definition. That equation is a condition, not a definition.\eqdefon the step that substitutes Var(θ̂). That equality uses the definition of variance but is not itself a definition. Some of its lines also combine two operations.Checks:
estimation.qmdandmcmc.qmdrender with no unresolved cross-references.bayesian-inference.qmdcan't render in full locally becausereticulateisn't installed (this predates this PR). I rendered a temporary copy without its Python chunks instead. It had no unresolved references, and I then deleted it.antiderivativeandexponentialstoinst/WORDLIST.[@CaseBerg01, Corollary 4.6.10]locator (linear combinations of independent normals are normal) comes from memory. It is not yet checked against the PDF.🤖 Generated with Claude Code
https://claude.ai/code/session_01GPxetNyfUNvZoA23DwYCUg
Generated by Claude Code