Repository navigation
Add a discrete-prior Bayes example to the Bayesian inference chapter - #109
Conversation
Restores the grid-prior, 8 successes in 10 trials example (rme's posterior_interval_example.Rmd) as an executed worked example after the credible-interval definition. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013vVJoNUjq7DoadV7U1d6XY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013vVJoNUjq7DoadV7U1d6XY
|
The Posted by Claude Code (AI agent) --- not written by a human. Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013vVJoNUjq7DoadV7U1d6XY
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Claude finished review — View run Prior review: Ready for merge on 4e8d1f6. That verdict still stands, and the one commit since then doesn't change it. The new commit is
Nothing else in the file changed, and no R or prose semantics changed. I re-read the whole example and found no new issues:
VerdictReady for merge Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "026cda47ea8ae6e38c9bf45c753943bd0fd8b99d",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "Commit 026cda4 only wraps the fig-cap and fig-alt chunk options in _exm-discrete-prior.qmd; the YAML continuation and paste0 string pieces concatenate to identical text.",
"holistic_assessment": "The change is a formatting-only lint fix within the original scope, so the prior Ready-for-merge verdict on 4e8d1f6 still holds with no regression or build-artifact concerns."
}Reviewed commit: 026cda4 |
2026-10-11 07:38 UTC |
Before.
bayesian-inference.qmdhad beta-Bernoulli, logistic, survival and random-effects examples but no worked example where the prior lives on a discrete grid. The only copy wasposterior_interval_example.Rmd, an unreferenced file in rme (prior on 0, 0.1, ..., 1; 8 successes in 10 trials; posterior and interval).After. A new example,
exm-discrete-prior, sits right after the credible-interval definition and its examples, before the conjugate-prior section. It builds the posterior column by column (prior, likelihood, product, posterior) with a table and a bar-chart figure with alt text. It then computes the one-sided 95% credible interval, (0.4, 1], with every number coming from the executed R chunks. Fixes to the source: the source's references to "2.5.x" are gone,dbinomreplaces the hand-written binomial, theconflicted/slice_tailstep is replaced by a plainmax(), and the text now says that a discrete posterior cannot hit 0.95 exactly. It reads the chapter'sdef-credible-intervalas "at least 1 - alpha" on a grid, so the interval is conservative (actual probability 0.9866).How. New subfile
_subfiles/bayesian-inference/_exm-discrete-prior.qmd, plus one include and slide break inbayesian-inference.qmd. No epi204 material used. The rme file is the maintainer's own, so no Source callout.Verified: the example rendered to HTML in isolation (R chunks ran; table, figure and inline values checked against the prose);
typosis clean apart from the existing@thm-cross-reference pattern. Not verified: a full-page render ofbayesian-inference.qmdfailed in this container because the installedreticulatelackspy_require, so the cross-references (thm-bayes-posterior,def-credible-interval,def-marginal-likelihood) were checked by id only. The repo's.lintr.Rwould not load here (lintr version), so lint ran with default settings (only line-length notes on chunk-option comments, as in existing subfiles).🤖 Generated with Claude Code
https://claude.ai/code/session_013vVJoNUjq7DoadV7U1d6XY
Generated by Claude Code