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.
| Volume | Examples | |
|---|---|---|
| Volume 1 | 20 | browse |
| Volume 2 | 16 | browse |
| Volume 3 | 14 | browse |
Some examples in the collection use language features JuliaBUGS does not support yet, and are not registered. Their pages are absent rather than broken:
| Example | Blocked by |
|---|---|
| Volume 1, Inhalers | Compiles to a cyclic graph: the logical node group[i] is used as an index into mu[group[i], t] |
| Volume 2, Ice | expr is not an allowed function in @bugs |
| Volume 2, Pigs and Simulating data | The source files in the repository are empty |
| Volume 3, Camel | Partially observed multivariate node (Y[5, 1:2]) |
| Volume 3, Fire | dloglik is not an allowed function in @bugs |
| Volume 3, Jama and St Veit Klinglberg | interp.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
| Example | Model |
|---|---|
| Rats: Normal Hierarchical Model | Normal hierarchical (random-effects linear growth curve) model for the weekly weights of 30 young rats. |
| Pumps: Conjugate Gamma-Poisson Hierarchical Model | Conjugate gamma-Poisson hierarchical model for failure rates of ten power plant pumps |
| Dogs: Loglinear Model for Binary Data | Loglinear model for binary avoidance-learning data from the Solomon-Wynne dog experiment |
| Seeds: Random Effect Logistic Regression | Random-effects logistic regression for a 2×2 factorial seed-germination experiment across 21 plates. |
| Surgical: Institutional Ranking | Independent binomial and hierarchical logistic random-effects models for ranking 12 hospitals by cardiac surgery mortality. |
| Magnesium: Sensitivity to Prior Distributions in Meta-Analysis | Random-effects meta-analysis of eight magnesium trials fit under six alternative priors on the between-study variance. |
| Salm: Extra-Poisson Variation in Dose-Response Study | Log-linear Poisson regression with plate-level normal random effects for salmonella mutagenicity dose-response counts. |
| Equiv: Bioequivalence in a Cross-Over Trial | Normal hierarchical (linear mixed) model assessing bioequivalence of two drug formulations from a two-period cross-over trial. |
| Dyes: Variance Components Model | One-way random effects model separating between-batch and within-batch variation in dyestuff yield. |
| Stacks: Robust Regression | Robust linear regression with outlier detection on Brownlee's stack loss data |
| Epilepsy: Repeated Measures on Poisson Counts | Poisson 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 Trials | Random effects meta-analysis pooling 22 beta-blocker trials of mortality after myocardial infarction. |
| Oxford: Smooth Fit to Log-Odds Ratios | Hierarchical binomial logistic model smoothing the log-odds ratio of childhood cancer versus prenatal X-ray exposure over birth years. |
| LSAT: Item Response | Rasch item response model for 1000 students' answers to a 5-item LSAT section |
| Bones: Latent Trait Model for Multiple Ordered Categorical Responses | Latent trait (graded-response item response) model that estimates children's skeletal ages from 34 ordered categorical maturity indicators. |
| Mice: Weibull Regression | Weibull regression survival model for censored mouse photocarcinogenicity data across four treatment groups |
| Kidney: Weibull Regression with Random Effects | Weibull survival regression with patient-level random effects for censored kidney-infection recurrence times |
| Leuk: Cox Regression | Cox proportional-hazards survival model in counting-process form for censored leukemia remission times |
| LeukFr: Cox Regression with Random Effects | Cox 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.