Analytical solutions of SIR models

These notes were written in the early stage of the COVID19 pandemic and they explore general properties of compartmental transmission (SIR-type) models.
The models below make no specific predictions, instead I am only looking at their general mathematical properties.

SIR models

Let’s start with the simplest epidemic model, ie. the SIR compartmental model, where we have:

It is more convenient to work with fractions of a population (and not absolute numbers), so that we have the conservation . We need to keep in mind that this is a mean field ODE model and has many limitations. It assumes complete homogeneity of transmission events, ie. that they depend only on the fraction of the population susceptible and infected and that for given values of these fractions we have the same rate of transmissions. This also means that any small nonzero values for the infected population will lead to transmissions, whereas in reality a very small fraction can mean so few infected individuals that the epidemic can just die out. Also, in reality transmission events (very probably) do not occur homogeneously, proportionally to the infected (and susceptible) fraction of the entire population, but are much more clustered, local and occurring in certain environments, in burst-like (‘superspreader’) events. For these reasons it is important to stress that these SIR models should be interpreted very cautiously and we must keep in mind their assumptions that are not entirely correct. Nevertheless, they can give us a first idea of some general properties of epidemic dynamics and that’s what I want to do here. For predictions and planning more advanced models that take into account local environments, stochasticity, rare spreading events etc should be used, and it can also be useful to use very simple but probabilistic models.

In the SIR framework it is clear that , since this variable has first-order (linear) decay, so any nonzero value in this compartment eventually ‘leaks out’ into . Therefore the equilibrium of the system is and due to the conservation . So to characterize the stationary behavior of the system all we need to calculate is .

Of course this can be done by numerically integrating the ODEs in \ref{SIR_odes} and indeed half the internet is full of SIR-models now. But how about an exact solution?
In this very clear paper in Nature Medicine (and probably others before) the authors explicitly derive the stationary solution for a more complicated model of 8 variables they abbreviate as the ‘SIDARTHE’ model. Despite the apparent complexity this model is basically identical to the simple SIR model. The only difference is that 1) the variable is split into several sub-variables (I: infected, a-/presymptomatic, undetected, D: diagnosed (asymptomatic infected, detected); A: ailing (symptomatic infected, undetected); R: recognized (symptomatic infected, detected); T: threatened (infected with life-threatening symptoms, detected)) 2) the sink variable R of the SIR model is split into two sinks (H: healed (recovered); E: extinct (dead)). However the ‘module’ (the five state variables representing different stages of infection) has the same basic property as I, namely that in they decay to 0, and only S, H, E can have nonzero values.

For the simple SIR model defined of \ref{SIR_odes} the solution for the stationary value of is less complicated than in the latter model, ie. it is given by the implicit expression:

This can be solved by an efficient algebraic solver such as in MATLAB. Let us do a parameter sweep in the ratio and the initial value of , and look at the stationary solution of R, ie. the fraction of the population that went through infection (ie. is now immune, if there is long-term immunity). Let us also check if the algebraic formula is the same as integrating the ODEs of \ref{SIR_odes} for a long time span: _config.yml Figure 1: Stationary solutions of SIR model calculated by simulations (left) and exact calculations (right)

Fortunately the analytical solutions from \ref{SIR_S_stationary} are identical with the numerical solutions of the ODEs, so we didn’t make a mistake in \ref{SIR_S_stationary}.
What do we see from this plot? The ratio is the famous , the basic reproduction parameter, and logically, the larger this ratio is, the more of the population will go through infection (again, in the framework of this extremely simplified model not meant to be realistic). It is also intuitive that if is smaller because of a larger initial infected population , then will be larger.

Now, let us make the model one step more refined, and split R into two variables, H(ealed) and E(xtinct , ie. deceased), as:

_config.yml Figure 2: ‘SIHE’ version of the SIR model where R(recovered) is split into H and E

The I(nfected) variable now has two outcomes. It is clear intuitively that this will not change how the stationary solution of is calculated, as the sink nodes do not interact with S, except that now I has two outgoing flows, so it is the ratio that will define as:

Moreover we can give the formulas for as a function of and the initial infected population . It is reasonable to assume are 0. Downstream of I the dynamics is completely linear: what flows out from S into I (ie. ), as well as the initial concentration of will be partitioned into the sink variables proportionally to the rate constants and . Specifically, we’ll have:

The ratio is the infection fatality (IFR) rate. It is clear from \ref{SIHE_statsol_S} that the IFR does not affect if the sum is kept constant, it is instead the ratio of (rate constant of new infections) to these two parameters that determine at what level of total infections the epidemic stops. To check if the formulas are correct, let us again compare the exact solution to the numerical solution of the ODEs, and plot the stationary solutions of at different IFR values: _config.yml Figure 3: stationary solutions of SIHE model at S(0)=0.99 and four different values of the IFR

Circles show the results from numerical integration of the ODEs, confirming they are identical with the analytical solutions (lines). The fraction of the population that has not been infected throughout the epidemic () goes down with , but is independent of the IFR as the sum was kept constant here. The ratio expresses how fast subjects exit the infectious state relative to the rate constant of generating new infections. A higher ratio means more of the population is infected, which is . In contrast, if both and are equally scaled then this quantity does not change.
How the infected fraction of the population is partitioned between the two sink states () obviously depends on the IFR (note the logarithmic scale), as stated in \ref{SIHE_statsol_S}. Note that while the IFR is ‘hard-wired’ in the parameter ratio , how much of the population gets infected and dies depends on and therefore , the rate constant for transmission. This is where physical distancing measures would intervene to choke off the flow .

Let us go now one step further and allow for a pre-symptomatic state, defining I as a variable of the infectious but pre-symptomatic state and adding a variable A(iling) that is the infectious and symptomatic state. Now the compartments of this ‘SIAHE’ model and the flows between them are:

_config.yml Figure 4: ‘SIAHE’ SIR model with presymptomatic (I) and symptomatic (A) infectious state and two outcomes

By highlighting the flow in red I want to indicate that this is the (only) nonlinear term, and now this flow has two parameters as the ODE for S is:

These two bilinear terms are positive feedbacks on the otherwise linear system. If it wasn’t for these terms the system would have an equilibrium where only the terminal vertices () of its graph can have nonzero value, just like with the equilibrium we have for the state transition graph of a stochastic Boolean model. Because of this nonlinear feedback however S can (and usually does) also have a nonzero value in steady state, so the equilibrium of SIAHE is .

Let us again get the formula for . Ff we have this, the rest of the system has linear kinetics, so the stationary values of H and E will follow easily from the kinetic matrix of the IAHE variables. I follow here the derivation from the Nature Medicine article, except that it is for a simpler (5 variables) model.

We need to introduce some notation:

Then the ODE for and is:

Since we can substitute this in and get:

Then integrating (and changing to ), for the left side:

…and on the right hand side we have:

so then we have:

Now if we pre-multiply by (a [1x2] vector) to get rid of F and to turn both sides into scalars we get:

From the ODE of we can substitute into :

Then after a rearrangement we have the solution for in the same form as for the ‘SIHE’ model in \ref{SIHE_statsol_S}:

is the of this version of the model, so rewriting with :

Explicitly, is:

is linearly increasing in the contagion rates and , while decreasing in the rate constants of the outgoing flows of I and A, ie. . has a more complicated effect as it decreases the first term, but increases the second. This makes sense too, since this is the rate constant between the two contagious states I and A.

Written on April 18, 2020
[ epidemics  complex-systems  covid19  ]