sir_birthsdeaths: SIR model with equal births and deaths for population...

Description Usage Arguments Details Value Examples

Description

A basic SIR mode with equal births and deaths; 3 compartments susceptible, infection and recovery processes solved using ode

Usage

1
sir(pars = NULL, init = NULL, time = NULL)

Arguments

pars

vector of 3 parameters beta, gamma and mu. beta is the transmission rate, gamma is the recovery rate and mu is the per capita death rate, and the population level birth rate.

init

vector of 3 parameters S (Susceptible proportion), I (Infected proportion) and R (Recovered proportion). These values are the starting values.

time

time sequence

Details

S,I,R must be positive and S + I + R <= 1.

Value

listThe list contains 4 arguments.First, second and third are the arguments of the function $pars,$init, $time. The fourth argument results, is a data.frame and S3 element (class type 'sir'). The results for each stage across a specific time-frame are displayed in this dataframe.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Input parameters and initial stages.
parameters <- c(mu = 0.013,
                beta = 1, gamma = 0.35)
initials <- c(S = 0.1, I = 1 - 1e-4, R = 1 - 0.1 - 1e-4)
times <- 0:365

# Solve
sir.birthsdeaths <- sir_birthsdeaths(pars = parameters, init = initials, time = times)

#Plot
plot(sir.birthsdeaths$results)

NicolasPhysentzides/popdyn documentation built on Sept. 11, 2020, 2:26 p.m.