Agentic Coding · Masterclass · Statistics & data analysis

Bayesian Models with PyMC and Stan: A Masterclass in Modelling with Coding Agents

Get hierarchical models running faster without losing sight of the model: the agent writes model code and diagnostics, you stay in charge of priors, convergence and model criticism.

  • Workshops & trainings since 2014
  • jocapps GmbH · Freiburg, Germany
  • The team behind Mathe-VollLogo
Format
Masterclass
Duration
1 day (7.5 hours)
Delivery
Live online · On-site (in-house) · Hybrid
Group size
4–10 participants
Level
Advanced
Language
German or English

Tools: Claude Code · PyMC · Stan · ArviZ · Jupyter

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

  1. 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.
  2. A working group calibrates an item response model for a diagnostic test and uses simulated data to check whether difficulty parameters are recovered reliably.
  3. 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.

Request dates

What the Bayesian modelling masterclass covers

  1. 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.
  2. Priors with reasonsPrior predictive checks, weakly informative priors and what a model predicts before it sees any data.
  3. When the sampler complainsDivergences, funnel geometry and reparameterisation; the agent proposes variants, you assess the diagnostics.
  4. PyMC and Stan side by sideThe same hierarchical model in both languages, cross-checked results and common translation errors.
  5. Model criticism and comparisonPosterior predictive checks, LOO and tracking down misspecification with ArviZ.
  6. 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

How it works

  1. Request with preferred datesTick the date proposals that suit you or name a period of your own.
  2. Short callWe talk about your goals, prior knowledge and the tools your team already uses.
  3. Agenda for your teamYou receive a plan tailored to your group, with exercises that match your subject and material.
  4. Course and materialsThe course runs online, on-site or hybrid, and you keep the materials afterwards.

Why train with us

  • jocapps GmbH has offered workshops and trainings since 2014. The topics have moved with the technology; today the focus is on agentic coding and prompt engineering.
  • Hands-on rather than slides: you practise on realistic examples from maths and STEM, or on your own tasks, code or prompts if you wish.
  • Online, on-site or hybrid, held in German or English.
  • jocapps GmbH is certified to ISO 27001 (information security) and ISO 9001 (quality management).

Questions about the Bayesian modelling masterclass

Why PyMC and Stan together?

Many teams use one of the two and meet the other in the literature or in collaborations. Implementing the same model in both is also an effective cross-check: if the results differ, the cause is often an error in parameterisation, indexing or priors.

Can the agent decide by itself whether a model has converged?

It can compute diagnostics and flag anomalies, which saves time. Whether a model suits the research question remains a scientific judgement, though. The masterclass shows which checks you can automate and where a person should deliberately take a close look.

Do we need a lot of computing power?

A standard laptop is enough for the practice models. Large hierarchical models or a calibration with many runs take noticeably longer; in that case we discuss how to plan computing time and let the agent work on small sub-problems first.

Is the masterclass held online or on-site, and in which language?

Both are possible: live online, at your premises (in-house) or hybrid. The course is held in German or English; you choose when you send the request.

Can the content be tailored to our team?

Yes. The agenda, examples and emphasis are agreed in the call beforehand, based on your team's prior knowledge, subjects and tools. On request we work with your own exercises, data or code.