Fundamentals of Bayesian Data Analysis in R
Learn how Bayesian inference works in R by building models with priors, updating them with data, and modeling continuous data with the Normal distribution.
Bayesian data analysis offers a single framework for building models that fit a particular problem and using them for statistical inference as well as prediction. You learn how it works by simulating data in R, expressing uncertainty with priors and updating it with observations. Worked examples include coin flips, website visits, a zombie drug experiment and the water temperature of a lake.
What You Will Achieve
- Simulate data from a model in R and condition on what was observed to estimate an unknown quantity such as a site’s visitor count
- Pick a prior that reflects what is already known and see how it changes the estimate
- Compare two datasets with posterior samples and use the result to weigh a decision
- Model continuous measurements with the Normal distribution and predict the next observation
Program Overview
Bayesian Data Analysis and Inference Foundations
Opens with first Bayesian analyses run through simulation, then breaks inference into its parts: a generative model, priors that represent uncertainty, and conditioning on data.
- First models with prop_model on coin flips and zombie drug data
- Samples and posterior summaries
- Generative models and the binomial distribution
- Priors, conditioning and updating a model with website visitor data
Priors, Contrasts and Decision Analysis
Works through four strengths of the Bayesian approach using informative priors, comparisons between groups and decision analysis, and extends the model to counts per day.
- The Beta distribution as an informative prior
- Contrasts and posterior differences between datasets
- Small decision analyses
- The Poisson distribution for clicks per day
Bayes’ Theorem, the Normal Distribution and BEST
Builds Bayesian inference from probability rules and Bayes’ theorem, then models continuous data with the Normal distribution and introduces a practical tool for analysis in R.
- Sum and product rules, likelihoods and dbinom
- Joint distributions, conditioning and Bayes’ theorem
- Normal models of water temperature and zombie IQ
- The BEST tool and its robustness
Certificate Awarded (Paid)
Job Outlook
Bayesian modeling in R supports data analysis work that estimates uncertain quantities, compares groups in experiments such as ad or website tests, and turns posterior results into decisions.
Good for: R users who want to build Bayesian intuition through simulation and small worked examples before meeting the formulas behind them.
Keep in mind: Despite its intermediate label, the material starts at the beginning and leans on simulation and playful examples more than on heavy mathematics.
Bottom line: A simulation-first route into Bayesian inference in R that closes with the BEST tool for applying the ideas to real data.
Frequently Asked Questions
What is prop_model used for in the lessons?
prop_model is the function used in the opening chapter to run first Bayesian analyses on coin flips and a zombie drug experiment. Learners then look at the samples it returns and summarize the results of the drug experiment.
Which probability distributions come up along the way?
Four distributions run through the lessons: the binomial inside a generative model, the Beta as a prior, the Poisson for clicks per day, and the Normal for continuous data such as lake temperatures, newborn weights and zombie IQ.
Where does Bayes' theorem itself come in?
It arrives in the fourth chapter, after the simulation-based chapters. The lessons build it from the sum and product rules using playing cards, calculate likelihoods with dbinom, work out a joint distribution and condition on the data before stating the theorem.
What is BEST and how is it used?
BEST is the practical tool for Bayesian analysis in R introduced in the final chapter. Learners apply BEST models to a zombies-on-a-diet example and see how the tool holds up as a robust method.


There are no reviews yet.