From deterministic to stochastic dynamics
Up to this point, we have been discussing deterministic systems. In a deterministic system, the future state of the system is completely determined by its current state and the parameters of the system. However, in many real-world scenarios, we want to incorporate randomness into our models to account for biological variability and uncertainty.
This transition to stochastic dynamics will also allow us to model systems where the states are discrete numbers rather than continuous. So instead of the "fraction" of the population that is infectious, we can model the actual number of individuals in each state.
Turns out, once we have a discrete time system, we can easily incorporate randomness into the model. We do this by introducing a transition probability that determines the likelihood of an individual transitioning from one state to another during a time step.
Here's how it works. In the example above, we saw that \(p = 1 - e^{-\lambda dt}\) is the fixed fraction of individuals that transition over a step of length \(dt\). This is deterministic; it's always the same.
To make it stochastic, we can think of \(p\) as a transition probability. Each individual that is currently "at risk" of transitioning has a probability \(p\) of switching states during the time step \(dt\).
Formally, \(p\) is the parameter of a Bernoulli distribution, which is a discrete probability distribution that describes the outcome of a single trial with two possible outcomes (success or failure). In this case, "success" is transitioning to the new state.
This conversion from deterministic to stochastic discrete dynamics works because the expected value of a Bernoulli random variable is equal to the probability of success, \(p\). On each time step, the number of individuals that transition, on average, is what we would get from the deterministic model.
The sum of \(n\) independent Bernoulli random variables with probability \(p\) is a binomial random variable. This means that if we have \(n\) individuals at risk of transitioning, the number of individuals that actually transition during the time step \(dt\) follows a binomial distribution with parameters \(n\) (the number of individuals at risk) and \(p\) (the transition probability).