pyINLA Training

Trainings

Learn Bayesian spatial statistics and pyINLA through structured self-study modules, or book a live one-week intensive course led by the pyINLA team. Tailored for researchers, students, and data teams.

Tutorial 1 • Getting Started

Introduction to Bayesian Inference

Learn the fundamentals: Bayes' theorem, conjugate priors, MCMC sampling, and why INLA is fast. Fit your first Poisson model with pyINLA using the Game of Thrones counting example.

  • Bayes' theorem and posterior distributions
  • Conjugate analysis (Poisson-Gamma)
  • Metropolis-Hastings MCMC
  • pyINLA model fitting and posterior transformation

Slides coming soon 20 slides

Conjugate, MCMC and pyINLA

Conjugate, MCMC and pyINLA

Tutorial 2 • Core Concepts

Regression and Generalized Linear Models

Fit linear regression and Poisson GLMs, compare models with DIC/WAIC/CPO, and work with posterior marginals and sampling.

  • Linear regression with pyINLA
  • Poisson GLM with offsets
  • Model comparison: DIC, WAIC, CPO
  • Marginal utilities and posterior sampling

Slides coming soon 20 slides

Relative risk by county

Relative risk by county

Tutorial 3 • Random Effects

Mixed Effects Models

Add random effects to your models: IID for overdispersion, time series (RW1, AR1), constraints, and generic structures.

  • IID random effects for overdispersion
  • Time series: RW1 and AR1 models
  • Constraints on random effects
  • Generic models: Z and custom precision

Slides coming soon 20 slides

Shrinkage toward the mean

Shrinkage toward the mean

Tutorial 4 • Hierarchical

Multilevel Models

Students in classrooms, patients in hospitals: real data has layers. Learn to model nested and crossed random effects.

  • Crossed effects: Penicillin experiment
  • Longitudinal data: Sleep deprivation study
  • Three-level nesting: Lab quality control
  • Logistic multilevel: Election 1988
  • Poisson multilevel and overdispersion: NYC Stops

Slides coming soon 22 slides

A slope per subject

A slope per subject

Tutorial 5 • Prior Specification

Priors

Choose and customize prior distributions: built-in priors, expression-based custom priors, Penalized Complexity (PC) priors, sensitivity analysis, and model scaling.

  • Built-in priors: loggamma, Gaussian, flat, PC
  • Custom priors with expression: syntax
  • Penalized Complexity (PC) priors
  • Sensitivity analysis across prior choices
  • Scaling intrinsic random effects (RW1, RW2, Besag)

Slides coming soon 20 slides

Six priors, two sample sizes

Six priors, two sample sizes

Tutorial 6 • Spatial

Spatial Models

Areal data, geostatistics, and point patterns: model spatial autocorrelation with lattice models, SPDE, and adjacency structures.

  • Regular lattice: RW2D and Matern2D models
  • Irregular lattice: Besag, BYM, and Leroux models
  • Geostatistics: SPDE with Matern covariance
  • Point patterns: Log-Gaussian Cox processes
  • Model comparison across spatial specifications

Slides coming soon 22 slides

Observed and smoothed risk

Observed and smoothed risk

Tutorial 7 • Temporal

Temporal Models

Model time series and spatio-temporal data: AR(1), RW1, forecasting with NAs, and Kronecker products for space-time interaction.

  • AR(1) and RW1 for climate reconstruction
  • Poisson time series: earthquake counts
  • Forecasting with the NA trick
  • Spatio-temporal: Besag x AR1 Kronecker models
  • Informative priors and model comparison

Slides coming soon 21 slides

Forecasting with the NA trick

Forecasting with the NA trick

Tutorial 8 • Non-parametric

Smoothing

Estimate flexible, data-driven curves with penalized splines: RW1/RW2 random walks, binned covariates, and 1D SPDE for non-parametric regression.

  • Polynomial regression as a baseline
  • Penalized splines: RW1 and RW2 models
  • Binned covariates for computational efficiency
  • Non-Gaussian smoothing: binomial dose-response
  • 1D SPDE with Matern covariance

Slides coming soon 20 slides

RW1 and RW2 smooths

RW1 and RW2 smooths

Tutorial 9 • Time-to-Event

Survival Models

Model censored time-to-event data: exponential, Weibull, lognormal, Cox proportional hazards, and frailty models for clustered survival.

  • Exponential, Weibull, and lognormal survival
  • Cox proportional hazards with baseline hazard
  • Accelerated failure time interpretation
  • Frailty models: random effects for clustered data
  • Model comparison across survival specifications

Slides coming soon 20 slides

Kaplan-Meier by treatment

Kaplan-Meier by treatment

Tutorial 10 • Advanced

Advanced Features

Unlock the full power of pyINLA: predictor matrices, linear combinations, multiple likelihoods, shared terms (copy and replicate), and linear constraints.

  • Predictor matrices (A-matrix) for custom designs
  • Linear combinations of latent effects
  • Multiple likelihoods: joint Gaussian + Poisson models
  • Copy and replicate for shared terms
  • Linear constraints (sum-to-zero and beyond)

Slides coming soon 19 slides

A contrast, computed inside the fit

A contrast, computed inside the fit

Tutorial 11 • Missing Data

Missing Data

Handle missing observations: predict missing responses automatically, impute missing covariates with plug-in values, and propagate uncertainty with multiple imputation and INLA within MCMC.

  • Missingness mechanisms: MCAR, MAR, MNAR
  • Predicting missing responses (the NA trick)
  • Plug-in imputation for missing covariates
  • Multiple imputation with Rubin's rules
  • INLA within MCMC for complex imputation

Slides coming soon 20 slides

MCAR, MAR and MNAR

MCAR, MAR and MNAR

Tutorial 12 • Mixtures

Mixture Models

Fit finite mixture models: handle known groups with multiple likelihoods, estimate unknown group assignments with INLA within MCMC, select the number of components, and fit cure rate survival models.

  • Gaussian mixtures with known group assignments
  • INLA within MCMC for unknown allocations
  • Model selection via marginal likelihoods
  • Cure rate models (weibullcure family)
  • Label switching and identifiability

Slides coming soon 20 slides

Two components, known groups

Two components, known groups

Tutorial 13 • Count Data

Zero-inflated and Hurdle Models

Handle excess zeros common in count data: zero-inflated Poisson and negative binomial models, hurdle models, and strategies for choosing among them.

  • Zero-inflation vs. overdispersion: diagnosis and remedies
  • Zero-inflated Poisson (ZIP) and ZINB models
  • Hurdle Poisson and hurdle negative binomial
  • Two-part models with different covariates per component
  • Model comparison via DIC, WAIC, and marginal likelihood

Slides coming soon 20 slides

Where the zeros come from

Where the zeros come from

Tutorial 14 • Longitudinal + Survival

Joint Models

Simultaneously model a longitudinal biomarker trajectory and a time-to-event outcome, linked through shared latent effects. Accounts for informative dropout and measurement error.

  • Motivating example: CD4 counts and AIDS progression
  • Longitudinal sub-model: linear mixed effects with INLA
  • Survival sub-model: Cox hazard with shared random effect
  • Association structures: current value, current slope, cumulative
  • Dynamic predictions and discrimination metrics

Slides coming soon 21 slides

Biomarker and event together

Biomarker and event together

Live Training  Coming Soon

One-Week Intensive pyINLA Course

Want guided, hands-on training instead of self-study? We offer a structured one-week course covering the topics above, with live sessions, exercises on your own data, and direct Q&A with the pyINLA team.

  • Covers key topics: from Bayesian basics to spatial and survival models
  • Available online or in-person
  • Individuals, research groups, and corporate teams welcome
Get Notified →

Further Reading

Some datasets used in these modules are drawn from the following references. Content, code, and explanations are developed for pyINLA in Python, and go beyond what is covered in these books.