gs_quant.timeseries.statistics.SIRModel

class SIRModel(beta=None, gamma=None, s=None, i=None, r=None, n=None, fit=True, fit_period=None)[source]

SIR Compartmental model for transmission of infectious disease

Parameters:
  • beta (Optional[float]) – transmission rate of the infection

  • gamma (Optional[float]) – recovery rate of the infection

  • s (Union[Series, float, None]) – number of susceptible individuals in population

  • i (Union[Series, float, None]) – number of infectious individuals in population

  • r (Union[Series, float, None]) – number of recovered individuals in population

  • n (Union[Series, float, None]) – total population size

  • end_date – end date for the evolution of the model

  • fit (bool) – whether to fit the model to the data

  • fit_period (Optional[int]) – on how many days back to fit the model

Usage

Fit SIR Model based on the population in each compartment over a given time period.

The SIR models the movement of individuals between three compartments: susceptible (S), infected (I), and resistant (R). The model calibrates parameters :

Parameter

Description

S0

initial susceptible individuals

I0

initial infected individuals

R0

initial recovered individuals

beta

Transmission rate from susceptible to infected

gamma

Immunity rate from infected to resistant

The parameters beta and gamma model how fast people move from being susceptible to infected (beta), and subsequently from infected to resistant (gamma). This model can be used to forecast the populations of each compartment once calibrated

Methods

beta()

Model calibration for transmission rate (susceptible to infected)

gamma()

Model calibration for immunity (infected to resistant)

i0()

Model calibration for initial infectious individuals

predict_i()

Model calibration for infected individuals through time

predict_r()

Model calibration for recovered individuals through time

predict_s()

Model calibration for susceptible individuals through time

r0()

Model calibration for initial recovered individuals

s0()

Model calibration for initial susceptible individuals