A coding agent writes a PyMC or Stan model in minutes, but the code does not tell you whether it is the right model. Typical problems are ill-suited priors, divergences, poorly mixing chains and models that converge yet fail to describe the data. For Bayesian models with PyMC and Stan, this masterclass sets out a workflow in which the agent produces model variants, simulations and diagnostics while you decide at fixed checkpoints. You practise on hierarchical models for class and school effects and on a simple item response model.
Who the Bayesian modelling masterclass is for
Statisticians, researchers in education, psychology and the natural sciences, and data science teams who already know Bayesian modelling and want to develop models with coding agents more productively and verifiably.
What you'll walk away with
- Have the agent generate prior predictive checks and adjust priors with domain reasoning
- Interpret divergences, R-hat and effective sample size and request reparameterisations deliberately
- Implement a hierarchical model in both PyMC and Stan and reconcile the results
- Make posterior predictive checks and LOO model comparison a fixed step in the workflow
- Use simulation-based calibration to check whether a model recovers known parameters
Typical scenarios
- An education research team estimates school effects on maths attainment with a hierarchical model and has the agent test a non-centred parameterisation when divergences appear.
- A working group calibrates an item response model for a diagnostic test and uses simulated data to check whether difficulty parameters are recovered reliably.
- A lab replaces a classical regression on a handful of measurements with a Bayesian model using informative priors from pilot runs and documents the choice transparently.
Does this fit your team?
Pick a few dates that suit you. The request is non-binding, and the agenda is tailored in a short call beforehand.
What the Bayesian modelling masterclass covers
- A workflow, not a single modelThe Bayesian workflow as a series of checkpoints, and how to record it in an instruction file for the agent.
- Priors with reasonsPrior predictive checks, weakly informative priors and what a model predicts before it sees any data.
- When the sampler complainsDivergences, funnel geometry and reparameterisation; the agent proposes variants, you assess the diagnostics.
- PyMC and Stan side by sideThe same hierarchical model in both languages, cross-checked results and common translation errors.
- Model criticism and comparisonPosterior predictive checks, LOO and tracking down misspecification with ArviZ.
- Calibration by simulationSimulation-based calibration as a test of whether model and code really fit together.
Before the Bayesian modelling masterclass: prerequisites
- Experience with Bayesian statistics and at least one probabilistic programming language
- Python skills and a local environment with PyMC; installation notes for Stan are sent in advance
- Optionally, a model of your own that is causing trouble
Materials you keep
- An instruction file for coding agents that encodes your Bayesian workflow
- Notebook templates with prior, posterior and calibration checks
- A diagnostics checklist with typical causes and remedies