Bayesian Modeling with RJAGS
Build Beta-Binomial, Normal and regression models in R with rjags, check the Markov chains, and draw posterior estimates and predictions.
You fit Bayesian models in R with the rjags package, which hands model code to the JAGS (Just Another Gibbs Sampler) engine. The simulated draws combine prior insight about a parameter with what observed data show. The models grow in scope: a Beta-Binomial model for a proportion, a two-parameter Normal model, then Normal regression with categorical and multiple predictors, and Poisson regression for counts. Posterior estimates, hypothesis tests and predictions all come from the Markov chain output.
What You Will Achieve
- Choose a Beta or Normal prior and show how the prior and the data each shape the posterior
- Check Markov chain output with trace plots, density plots and multiple chains before relying on it
- Report regression parameters with posterior means and credible intervals, and test a hypothesis with a posterior probability
- Predict new observations, including counts, from a posterior predictive distribution in R
Program Overview
Beta-Binomial and Normal-Normal Models in RJAGS
Starts with priors, likelihoods and posteriors for a proportion, then moves to a two-parameter Normal model and the Markov chains behind the simulation.
- Beta priors, the likelihood and the posterior for a proportion
- Model setup and simulation in rjags
- Normal-Normal model on sleep study data
- Chain storage, diagnostics, naive standard errors and reproducibility
Posterior Inference and Prediction for Regression
Extends the Normal model to a simple regression on weight and height data and reads estimates, tests and predictions off the simulation output.
- Regression priors and their visualization
- Regression Markov chains
- Point estimates, interval estimates and posterior probabilities
- Predictions for new observations
Categorical, Multivariate and Poisson Regression
Generalizes the Normal regression model with RailTrail data, adding a weekday predictor, a second predictor and a Poisson model for count variables.
- Categorical predictors and their coefficients
- Multivariate regression with two predictors
- Poisson regression and the rate parameter
- Poisson posterior prediction
Certificate Awarded (Paid)
Job Outlook
Bayesian regression and posterior prediction in R are used in statistical analysis, data science and research work where estimates are reported with credible intervals and predictive distributions.
Good for: R users who want to write their own Bayesian models for JAGS and read posterior estimates and predictions straight from the simulation output.
Keep in mind: Every model is written for JAGS through the rjags package, and the examples stay with a few datasets: a sleep study, weight and height measurements, and RailTrail volume.
Bottom line: A hands-on run through four Bayesian model types in rjags that spends real time on checking the Markov chains before using them.
Frequently Asked Questions
What is rjags and what does JAGS do?
rjags is an R package that connects R to JAGS, short for Just Another Gibbs Sampler. In the course you write a model, compile it and simulate it through rjags, then work with the Markov chain samples it returns in R.
What data are the RJAGS models fitted to?
The Normal-Normal model is fitted to sleep study data on sleep deprivation, the simple regression uses weight and height data, and the final chapter works with RailTrail sample data, including inference for volume by weekday.
How are Markov chain results checked in the course?
Chains are stored and inspected with trace plots and density plots, compared across multiple chains, and summarized with naive standard errors. Making the simulations reproducible is part of the same chapter.
Please log in to report a problem with this page.


There are no reviews yet.