# Compartmental modelling with stochastic differential equations

[In this module, students will become familiar compartmental modelling with stochastic differential equations]

A good, but more mathematical, introduction to the material discussed here can be found in the paper Construction of Equivalent Stochastic Differential Equation Models by Allen et al (2008).

The content a previous module, formalism for preparing to do stochastic compartmental modelling, is imperative as a precursor to the content of this module.

Stochastic differential equation models can potentially be used for any dynamical system whose evolution can be described by a system of compartmental ODE’s, under certain provisos…

In the module Difference between Markov Chain Monte Carlo, Stochastic Differential Equations, and Agent Based Models, we discussed appropriate applicability of Markov Chain Monte Carlo, SDE’s, and agent based methods.  Both Markov Chain Monte Carlo and SDE’s are applicable to dynamical systems that can be described by compartmental ODE’s.  However, SDE’s are only really applicable when the number of individuals in all compartments are not near the extinction limit (ie; close to zero).  When the number in a compartment, N, is small (say less than 10) at the beginning of a time step, the expected stochastic variation in that compartment during some fixed time step is in the Poisson regime, and the change during that time step is an integer number; N at the end of the time step can only be 0,1,2,…. and so on.  In terms of the simulation, when N is small, it matters very much wrt the next possible steps in the simulation if it goes to 0, or 1, or 2 or some other small number.

However, when lambda=N is large, the Poisson distribution with parameter lambda approaches the Normal distribution, with mean=lambda, and sd=sqrt(lambda).  Say the number in a compartment, N, is large, like 10000.  If there is some change during the next time step to a value like 9993, it doesn’t really matter much to the calculations for the next step if we assume that value is 9993, or 9993.1, or 9992.7 (for example).  This means we can make some nice simplifications; instead of stepping through the simulation in tiny time steps, so tiny that the change in any one the values in the compartments is +/-1, as we do in MCMC, when the number in all the compartments is sufficiently large we can approximate the stochasticity in the change in compartments during some fixed time step by a Normal distribution.

In the module formalism for preparing to do stochastic compartmental modelling, we discussed how to assess a compartmental models for transitions of +/-1 in compartments, and the transition probabilities in a small time step.

g_j,i = lambda_j,i p_j^0.5

Visits: 1546