# Epidemic models¶

The following compartmental models are provided by epifx:

Note

The behaviour of these models can be modified by providing specific lookup tables. See the documentation for each model, below, for further details.

## Deterministic compartment models¶

class epifx.det.SEIR(*args: Any, **kwargs: Any)

An SEIR compartment model for a single circulating influenza strain, under the assumption that recovered individuals are completely protected against reinfection.

$\begin{split}\frac{dS}{dt} &= - \beta S^\eta I \\[0.5em] \frac{dE}{dt} &= \beta S^\eta I - \sigma E \\[0.5em] \frac{dI}{dt} &= \sigma E - \gamma I \\[0.5em] \frac{dR}{dt} &= \gamma I \\[0.5em] \beta &= R_0 \cdot \gamma \\[0.5em] E(0) &= \frac{1}{N}\end{split}$

Parameter

Meaning

$$R_0$$

Basic reproduction number

$$\sigma$$

Inverse of the incubation period (day -1)

$$\gamma$$

Inverse of the infectious period (day -1)

$$\eta$$

Inhomogeneous social mixing coefficient

$$\alpha$$

Temporal forcing coefficient

$$t_0$$

The time at which the epidemic begins

The force of infection can be subject to temporal forcing $$F(t)$$, as mediated by $$\alpha$$:

$\beta(t) = \beta \cdot \left[1 + \alpha \cdot F(t)\right]$

Note that this requires the forcing time-series to be stored in the lookup table 'R0_forcing'.

Note

The population size $$N$$ must be defined for each scenario:

[model]
population_size = 1000


Initialise the model instance.

stat_Reff(hist)

Calculate the effective reproduction number $$R_\mathrm{eff}$$ for every particle.

Parameters

hist – The particle history matrix, or a subset thereof.

class epifx.det.SEEIIR(*args: Any, **kwargs: Any)

An SEEIIR compartment model for a single circulating influenza strain, under the assumption that recovered individuals are completely protected against reinfection.

$\begin{split}\frac{dS}{dt} &= - \beta S^\eta (I_1 + I_2) \\[0.5em] \frac{dE_1}{dt} &= \beta S^\eta (I_1 + I_2) - 2 \sigma E_1 \\[0.5em] \frac{dE_2}{dt} &= 2 \sigma E_1 - 2 \sigma E_2 \\[0.5em] \frac{dI_1}{dt} &= 2 \sigma E_2 - 2 \gamma I_1 \\[0.5em] \frac{dI_2}{dt} &= 2 \gamma I_1 - 2 \gamma I_2 \\[0.5em] \frac{dR}{dt} &= 2 \gamma I_2 \\[0.5em] \beta &= R_0 \cdot \gamma \\[0.5em] E_1(0) &= \frac{1}{N}\end{split}$

Parameter

Meaning

$$R_0$$

Basic reproduction number

$$\sigma$$

Inverse of the incubation period (day -1)

$$\gamma$$

Inverse of the infectious period (day -1)

$$\eta$$

Inhomogeneous social mixing coefficient

$$\alpha$$

Temporal forcing coefficient

$$t_0$$

The time at which the epidemic begins

The force of infection can be subject to temporal forcing $$F(t)$$, as mediated by $$\alpha$$:

$\beta(t) = \beta \cdot \left[1 + \alpha \cdot F(t)\right]$

Note that this requires the forcing time-series to be stored in the lookup table 'R0_forcing'.

Note

The population size $$N$$ must be defined for each scenario:

[model]
population_size = 1000

stat_Reff(hist)

Calculate the effective reproduction number $$R_\mathrm{eff}$$ for every particle.

Parameters

hist – The particle history matrix, or a subset thereof.

class epifx.det.NoEpidemic(*args: Any, **kwargs: Any)

A model that assumes there will be no epidemic activity.

This may be a useful hypothesis against which to evaluate other models.

## Stochastic compartment models¶

class epifx.stoch.SEEIIR(*args: Any, **kwargs: Any)

A stochastic SEEIIR compartment model.

The mean rates are defined by the following equations:

$\begin{split}\frac{dS}{dt} &= - \beta \frac{S}{N} (I_1 + I_2) \\[0.5em] \frac{dE_1}{dt} &= \beta \frac{S}{N} (I_1 + I_2) - 2 \sigma E_1 \\[0.5em] \frac{dE_2}{dt} &= 2 \sigma E_1 - 2 \sigma E_2 \\[0.5em] \frac{dI_1}{dt} &= 2 \sigma E_2 - 2 \gamma I_1 \\[0.5em] \frac{dI_2}{dt} &= 2 \gamma I_1 - 2 \gamma I_2 \\[0.5em] \frac{dR}{dt} &= 2 \gamma I_2 \\[0.5em] \beta &= R_0 \cdot \gamma \\[0.5em] E_1(0) &= 10\end{split}$

Parameter

Meaning

$$R_0$$

Basic reproduction number

$$\sigma$$

Inverse of the incubation period (day -1)

$$\gamma$$

Inverse of the infectious period (day -1)

$$t_0$$

The time at which the epidemic begins

The basic reproduction number $$R_0$$ can be sampled from the lookup table 'R0', in which case each particle is associated with a specific $$R_0$$ trajectory 'R0_ix'. In this case, there must be prior samples for 'R0_ix'. Note that this allows $$R_0$$ to vary over time.

External exposures can be injected into the model from the lookup table 'external_exposures'. These exposures $$e_\mathrm{ext}(t)$$ have the following effect on the model equations:

$\begin{split}\frac{dS}{dt} &= - \beta \frac{S}{N} (I_1 + I_2) - e_\mathrm{ext}(t) \\[0.5em] \frac{dE_1}{dt} &= \beta \frac{S}{N} (I_1 + I_2) + e_\mathrm{ext}(t) - 2 \sigma E_1\end{split}$

Note

The population size $$N$$ must be defined for each scenario:

[model]
population_size = 1000

stat_generation_interval(hist)

Calculate the mean generation interval for each particle.

Parameters

hist – The particle history matrix, or a subset thereof.