generate.SIR.model: function to generate a simple SIR...

View source: R/covid19_models.R

generate.SIR.modelR Documentation

function to generate a simple SIR (Susceptible-Infected-Recovered) model based on the actual data of the coivd19 cases

Description

function to generate a simple SIR (Susceptible-Infected-Recovered) model based on the actual data of the coivd19 cases

Usage

generate.SIR.model(
  data = NULL,
  geo.loc = "Hubei",
  t0 = NULL,
  t1 = NULL,
  deltaT = NULL,
  tfinal = 90,
  fatality.rate = 0.02,
  tot.population = 1.4e+09,
  staticPlt = TRUE,
  interactiveFig = FALSE,
  add.extras = FALSE
)

Arguments

data

time series dataset to consider

geo.loc

country/region to analyze

t0

initial period of time for data consideration

t1

final period of time for data consideration

deltaT

interval period of time from t0, ie. number of days to consider since t0

tfinal

total number of days

fatality.rate

rate of causality, deafault value of 2 percent

tot.population

total population of the country/region

staticPlt

optional flag to activate/deactive plotting of the data and the SIR model generated

interactiveFig

optional flag to activate/deactive the generation of an interactive plot of the data and the SIR model generated

add.extras

boolean flag to add extra indicators, such as, the "force of infection" and time derivatives

Examples

data <- covid19.data("ts-confirmed")
generate.SIR.model(data,"Hubei", t0=1,t1=15)
generate.SIR.model(data,"Germany",tot.population=83149300)
generate.SIR.model(data,"Uruguay", tot.population=3500000)
generate.SIR.model(data,"Canada", tot.population=37590000, add.extras=TRUE)


covid19.analytics documentation built on Oct. 16, 2023, 1:06 a.m.