Stochastic models and the state-space view
An SIR model fitted to Tristan da Cunha. Too small, too late, too few.
The parameters are not the problem. Two changes to the SIR model:
They are independent. This session makes each in turn.
We want to find out two things:
We want to do this on the basis of observations (data), .
In a deterministic model the state is a function of the parameters: one , one trajectory, and is not something that needs to be separately inferred.
In a stochastic model the same gives a different trajectory every time, so the state has a distribution, .
That extra layer, between the parameters and the data, is what the rest of this session is about.
Parameters, then states, then observations: each layer depends on the one above. When the states form a time series, a model with this structure is called a state-space model.

Applying the chain rule to those three pieces gives
Set to the data we observe, and the joint probability gives the posterior
which factorises as
The first factor gives us parameter fitting, the second state estimation.
In a deterministic model, every leads to one possible . In that case
In general we cannot write down a formula for . But we can sample from it.
284 people, one ship every few months.
T is temporary immunity, and only a fraction goes on to L, long-term immunity. The rest return to susceptible and can drive a second wave.
Model structure — how many compartments, and what flows between them.
Deterministic or stochastic — whether transitions are continuous flows or discrete random events.
These are separate decisions. You can simulate SEITL either way, and the practical does both so you can see the difference.
With 284 people, random events play a relatively large role.
Demographic noise scales roughly as .
The deterministic version solves an ODE. The stochastic version simulates events one at a time.
Exact, but slow. Every infection and recovery is an individual event.
A single T compartment means the waiting time in it is exponential, so the most likely thing is to leave immediately.
That is a strange claim about immunity.
Chaining four compartments, each at four times the rate, gives an Erlang waiting time: same mean, but a peak away from zero. Most people stay immune for roughly the average duration.

In the practical you will
Structure and stochasticity