Bayesian Modeling Introduction


Bayesian Modeling Introduction

Simon
So Corey, I just watched this talk by Rob Deardon on Bayesian modeling of epidemics, and it's fascinating how these models are built from biological mechanisms rather than being off-the-shelf statistical models.

Corey
Absolutely, Simon. He emphasized that mechanistic models are designed with the disease transmission process in mind, and the parameters are directly interpretable—like the infectious period or contact rate. That's a huge advantage when estimating things during a pandemic.

Simon
Right. And he started with the classic SIR model, where the population is divided into three compartments: susceptible, infectious, and removed. The transition rates—beta for transmission and gamma for removal—determine how people move through those states.

Corey
Yes, and the key point is that in a discrete-time stochastic version, the number of new infections at each time step follows a binomial distribution. That probability depends on the current number of infectious individuals and a transmission rate, which captures both the pathogen's infectiousness and the contact rate in the population.

Simon
Exactly. And one thing I found really interesting is that with a deterministic ODE version you get the same curve every time, but with the stochastic version you see realistic variation—some epidemics die out early, others take off. That's crucial for capturing uncertainty.

Corey
That's why Bayesian inference is so popular in this field. Rob pointed out three big reasons: first, the posterior is directly interpretable without repeated sampling; second, you can handle incomplete data through data augmentation—like imputing unobserved infection times; and third, you can incorporate prior information from previous studies or expert opinion.

Simon
And he gave a concrete example using Nimble, an R package for Bayesian MCMC. He simulated data with a known transmission rate of 0.6 and removal rate of 0.2, set priors—a vague exponential for beta and a slightly informative prior for gamma—and then recovered the true parameters pretty well.

Corey
That's neat. And all that leads to the basic reproduction number R0, which is beta over gamma. It's such a simple formula but gives you the expected number of secondary cases from a single infection in a totally susceptible population. If R0 is above 1, the epidemic tends to grow; below 1, it dies out.

Simon
Right, that threshold behavior is why public health experts were so focused on bringing R0 below 1 during COVID. Rob showed plots where halving the transmission rate slowed the epidemic dramatically, giving time for interventions.

Corey
Then he moved on to extensions. The SEIR model adds an exposed compartment for a latent period before infectiousness. That's important for diseases like measles where you're infected but not yet contagious.

Simon
And you can also let the transmission rate vary over time to capture changes in behavior or policy. Rob showed an example from the Ebola outbreak in Sierra Leone, where after a UN intervention the transmission rate dropped in two stages.

Corey
But then he really dove into individual-level models (ILMs). Those move beyond the homogeneous mixing assumption and allow individual risk factors—like age, genetics, or spatial proximity—to affect susceptibility, transmissibility, and connectivity.

Simon
The infection kernel is key there. In a spatial model, you might use a power law where risk decays with distance. Rob showed a simulated example on a grid where infection spread in a wave-like pattern but with random jumps due to Sparks terms that account for infections from outside the study area.

Corey
And for network models, edges represent contacts—like friendships in a school. Rob mentioned a study on H1N1 in a Pennsylvania elementary school where they used a social network along with covariates like gender and class to model spread.

Simon
The likelihood for ILMs is conceptually simple—a product of Bernoulli probabilities for each susceptible individual and a distribution for infectious periods—but it's computationally heavy for large populations. That's where packages like 'epiILM' in R come in handy.

Corey
Rob also answered some interesting audience questions. One was about multiple strains—you can model partial cross-immunity by adjusting transmission rates. Another was about stochasticity and communication—you can simulate from the posterior to get probabilities like the chance of exceeding a certain case number.

Simon
And someone asked about vaccinated subpopulations. Rob said you could treat them as removed if the vaccine is highly effective, or add separate infectious compartments for vaccinated vs. unvaccinated to allow different transmission rates.

Corey
Overall, I think his message was clear: mechanistic models, even simple ones like SIR, are powerful tools for understanding and predicting epidemic dynamics—especially when combined with Bayesian methods to handle real-world data challenges.

Simon
Absolutely. And for anyone wanting to learn more, he recommended the book 'Epidemics: Models and Data Using R' and the 'epiILM' package. Plus, there are Nimble tutorials online. This was a great primer.

Ask anything
We've read this whole study set, so questions about it get the best answers.