Throwback to 2020: Epidemic Model with Vaccination, Mitigation, and Seasonal Effects
This repository implements an extended SIRD epidemic model with:
-
Two infectious groups (unvaccinated and vaccinated infectives)
-
Waning immunity from both vaccinated and recovered compartments
-
Piecewise-constant mitigation measures
-
Piecewise-constant vaccination capacity
-
Seasonal transmissibility (sinusoidal modulation)
-
Scenario comparison plots (mitigation + vaccination vs. none)
It is intended as a lightweight, yet sufficiently complex model to produce qualitatively realistic long-term epidemic dynamics.
The population is divided into the following compartments:
-
S – Susceptible
-
V – Vaccinated (reduced infection probability)
-
I₁ – Infectious (unvaccinated)
-
I₂ – Infectious (vaccinated — reduced infectiousness)
-
R – Recovered (temporary immunity)
-
D – Cumulative deaths
All compartments sum to 1.0 (normalized population).
The model is given by the equations:
where
i.e. the base transmission rate multiplied by the mitigation factor (lockdowns, masks, distancing…) and the seasonal factor (higher/lower transmissibility depending on the time of year). This makes the system non-autonomous (explicitly time-dependent).
The vaccination rate, described by
The model also takes waning immunity into account, both for natural immunity (the recovered group R) and for the vaccinated (V). Although
The other parameters are:
-
$\beta_1$ : infection probability of the unvaccinated (1/day) -
$\beta_2$ : infection probability of the vaccinated (1/day) -
$\kappa$ : reduction factor of the vaccinated getting infected (-) -
$\gamma_1$ : recovery rate of the unvaccinated (1/day) -
$\gamma_2$ : recovery rate of the vaccinated (1/day) -
$\delta_1$ : death rate of the unvaccinated (1/day) -
$\delta_2$ : death rate of the vaccinated (1/day) -
$w_r$ : waning rate of the recovered (1/day) -
$w_v$ : waning rate of the vaccinated (1/day) -
$\rho$ : fraction of R$\rightarrow$ V when immunity wanes (-) -
$v$ : vaccination willingness (-)
The figure shows four different scenarios with both vaccination and mitigation (33% reduction for two years), mitigation only (33% reduction for the whole 4-year period), vaccination only and no measures. Vaccination was assumed to be only 50% effective: the probability of both infecting and getting infected was halved.
As can be seen, combining mitigation and vaccination is far more effective: using only one of the two results in the disease becoming endemic for several years.
- Install dependencies:
pip install numpy scipy matplotlib typing - Run the main
SIRD.pyscript.
