Reading and understanding Kruschke diagrams
This tool shows you the
graphical model structure of Bayesian regression models β live, interactive, in simple examples:
Β·
β open circles = unknown parameters that need
priors (Ξ±, Ξ², Ο)
Β·
β‘ rectangle = observed data y
Β·
β’ dot = deterministic node (ΞΌα΅’) β no prior, computed from inputs
Β·
Arrows show the generative direction: Prior β Parameter β Data
Β·
Plates (dashed frames) mark repeated units (i = 1β¦N observations; j = 1β¦J groups)
In the
hierarchical model, each group j receives a deviation from the global intercept:
uββ±Ό ~ Normal(0, Οβ). Οβ controls the degree of
partial pooling β small Οβ = strong
shrinkage. In McElreath (Ch. 14, p. 441 ff.) this parameter is called
Ο_Ξ±.
Random Slopes are implemented here only for the first predictor. Once they're active, uββ±Ό and uββ±Ό are NOT drawn independently anymore β jointly,
[uββ±Ό,uββ±Ό] ~ MVNormal(0, Ξ£), with an additional correlation Ο between the intercept and slope deviations (brms default).
For the full model scope:
⬑ brms Model Builder β 15
likelihoods, polynomials, interactions, distributional parameters,
random effects, prior predictive check β directly executable brms code.
β brms Model Builder β
Further Reading
Kruschke (2014) β template for the diagram notation
McElreath (2020) β model notation, hierarchical models (Ch. 14)
Finch & Bolin (2024) β multilevel models in R
BΓΌrkner (2018) β advanced multilevel features in brms
Gelman et al. (2020) β Bayesian workflow