Example Gallery

The classic BUGS examples, rewritten as JuliaBUGS pages. Each page states the model, shows the data, and points at the published reference results, so you can read the model and reproduce the numbers in one place. If you know these examples from WinBUGS, OpenBUGS, or JAGS they should feel familiar; the original write-ups live on the MultiBUGS examples pages for Volume 1, Volume 2, and Volume 3.

Every example ships inside the package, so you do not need to retype anything. Each one is available as JuliaBUGS.BUGSExamples.VOLUME_N.<key>, bundling the model definition, the original BUGS program, the data, two sets of initial values, and, where they were published, reference results to compare against. JuliaBUGS.BUGSExamples.list() prints the lot.

VolumeExamples
Volume 120browse
Volume 216browse
Volume 314browse

Some examples in the collection use language features JuliaBUGS does not support yet, and are not registered. Their pages are absent rather than broken:

ExampleBlocked by
Volume 1, InhalersCompiles to a cyclic graph: the logical node group[i] is used as an index into mu[group[i], t]
Volume 2, Iceexpr is not an allowed function in @bugs
Volume 2, Pigs and Simulating dataThe source files in the repository are empty
Volume 3, CamelPartially observed multivariate node (Y[5, 1:2])
Volume 3, Firedloglik is not an allowed function in @bugs
Volume 3, Jama and St Veit Klinglberginterp.lin is not an allowed function in @bugs

Volume 4 is not covered: of its examples, only Methadone exists in the repository, and its data file holds 240,776 observations, which is too large to load eagerly at package load time. The model is in the source tree at src/BUGSExamples/Volume_4/.

Volume 1

ExampleModel
Rats: Normal Hierarchical ModelNormal hierarchical (random-effects linear growth curve) model for the weekly weights of 30 young rats.
Pumps: Conjugate Gamma-Poisson Hierarchical ModelConjugate gamma-Poisson hierarchical model for failure rates of ten power plant pumps
Dogs: Loglinear Model for Binary DataLoglinear model for binary avoidance-learning data from the Solomon-Wynne dog experiment
Seeds: Random Effect Logistic RegressionRandom-effects logistic regression for a 2×2 factorial seed-germination experiment across 21 plates.
Surgical: Institutional RankingIndependent binomial and hierarchical logistic random-effects models for ranking 12 hospitals by cardiac surgery mortality.
Magnesium: Sensitivity to Prior Distributions in Meta-AnalysisRandom-effects meta-analysis of eight magnesium trials fit under six alternative priors on the between-study variance.
Salm: Extra-Poisson Variation in Dose-Response StudyLog-linear Poisson regression with plate-level normal random effects for salmonella mutagenicity dose-response counts.
Equiv: Bioequivalence in a Cross-Over TrialNormal hierarchical (linear mixed) model assessing bioequivalence of two drug formulations from a two-period cross-over trial.
Dyes: Variance Components ModelOne-way random effects model separating between-batch and within-batch variation in dyestuff yield.
Stacks: Robust RegressionRobust linear regression with outlier detection on Brownlee's stack loss data
Epilepsy: Repeated Measures on Poisson CountsPoisson generalized linear mixed model for repeated seizure counts in a randomized epilepsy trial, with subject and subject-by-visit random effects.
Blockers: Random Effects Meta-Analysis of Clinical TrialsRandom effects meta-analysis pooling 22 beta-blocker trials of mortality after myocardial infarction.
Oxford: Smooth Fit to Log-Odds RatiosHierarchical binomial logistic model smoothing the log-odds ratio of childhood cancer versus prenatal X-ray exposure over birth years.
LSAT: Item ResponseRasch item response model for 1000 students' answers to a 5-item LSAT section
Bones: Latent Trait Model for Multiple Ordered Categorical ResponsesLatent trait (graded-response item response) model that estimates children's skeletal ages from 34 ordered categorical maturity indicators.
Mice: Weibull RegressionWeibull regression survival model for censored mouse photocarcinogenicity data across four treatment groups
Kidney: Weibull Regression with Random EffectsWeibull survival regression with patient-level random effects for censored kidney-infection recurrence times
Leuk: Cox RegressionCox proportional-hazards survival model in counting-process form for censored leukemia remission times
LeukFr: Cox Regression with Random EffectsCox proportional-hazards survival model with a normal pair-level frailty (random effect) for the Freireich leukaemia remission data.

New to the workflow these pages assume? See Getting Started for the model-to-samples walkthrough that every example page follows.

Adding an example? The Volume 2 and 3 pages share one structure, and the script that produced it is kept in issue #533 rather than in the repository, since the pages are written and maintained by hand from here.