add intro to mcmc techniques for Bayesian inference#837
add intro to mcmc techniques for Bayesian inference#837github-actions[bot] wants to merge 5 commits into
Conversation
Adapts content from Dobson & Barnett 4e Chapter 13. Covers Monte Carlo integration, the Metropolis-Hastings algorithm, the Gibbs sampler, burn-in, convergence diagnostics (trace plots, ACF, Gelman-Rubin), and posterior inference from MCMC samples, with worked R examples using the Bernoulli model. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @d-morrison's task in 3m 41s —— View job Code Review — PR #837: Intro to MCMC Techniques
SummaryThe new Critical1.
Every occurrence of Significant2.
The trace plot chunk should be restructured as: :::{#exm-trace-plot}
## Trace plot for MH chain
:::{#fig-trace-mh}
```{r}
#| code-fold: show
library(ggplot2)
burnin <- 500L
df_chain <- data.frame(iteration = seq_along(mh_chain), pi = mh_chain)
ggplot(df_chain, aes(x = iteration, y = pi)) +
geom_line(linewidth = 0.2, alpha = 0.7) +
geom_vline(xintercept = burnin, linetype = "dashed", colour = "red") +
labs(x = "Iteration", y = expression(pi)) +
theme_bw()MH chain trace plot; dashed line marks end of burn-in. ::: The length of the burn-in period is chosen by inspection of trace plots JAGS (Just Another Gibbs Sampler) automates this approach for a wide class of models; and removes the blank line that preceded the JAGS section. This integration is correct: the section heading is in the parent (not the subfile), satisfying the subfile convention. No issues here beyond the forward reference noted in item 4 above. VerdictThis PR should not be merged in its current state due to the undefined |
|
@claude address review comments |
|
👀 Picked up by workflow run #26543221524. R/Quarto/renv setup runs first (~3-5 min); Claude itself responds after that. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude review |
|
👀 Picked up by workflow run #26553161091. R/Quarto/renv setup runs first (~3-5 min); Claude itself responds after that. |
|
Claude finished @d-morrison's task in 2m 37s —— View job Code Review — PR #837 (re-review after fixes)
What Was FixedCommit
Remaining IssuesSignificant 1. Trace plot figure has no caption and no div wrapper The
The trace plot currently renders as an unlabeled, uncaptioned plot inside an example div — not suitable for a textbook. The chunk at :::{#fig-trace-mh}
```{r}
#| code-fold: show
burnin <- 500L
df_chain <- data.frame(iteration = seq_along(mh_chain), pi = mh_chain)
ggplot(df_chain, aes(x = iteration, y = pi)) +
geom_line(linewidth = 0.2, alpha = 0.7) +
geom_vline(xintercept = burnin, linetype = "dashed", colour = "red") +
labs(x = "Iteration", y = expression(pi)) +
theme_bw()MH chain trace plot; dashed line marks end of burn-in. |
|
@claude iterate |
|
👀 Picked up by workflow run #26641130635. R/Quarto/renv setup runs first (~3-5 min); Claude itself responds after that. |
|
Claude finished @d-morrison's task in 2m 11s —— View job Code Review — PR #837 (post-iterate, round 3)
What Was Fixed by the Iterate CommitsCommits
One Remaining Minor Nit
Structural Note (no action required)
VerdictAll critical and significant issues from prior reviews are resolved. The only remaining item is the low-priority |
Built to branch |
Draft PR opened by
@claudeto address #836.Triggered by workflow run.
Addresses #836.