sir_subpops_model {serosv}R Documentation

SIR Model with Interacting Subpopulations

Description

Refers to section 3.5.1.

Usage

sir_subpops_model(times, state, parameters)

Arguments

times

time sequence.

state

the initial state of the model.

parameters

the parameters of the model.

Details

In state:

- s: Percent susceptible

- i: Percent infected

- r: Percent recovered

In parameters:

- mu: natural death rate (1/L).

- beta: transmission rate w.r.t population (beta tilde)

- nu: recovery rate

- k: number of subpopulations

Value

list of class sir_subpops_model with the following items

parameters

list of parameters used for fitting the model

output

matrix of proportion for each compartment over time

Examples


k <- 2
state <- c(
  s = c(0.8, 0.8),
  i = c(0.2, 0.2),
  r = c(  0,   0)
)
beta_matrix <- c(
  c(0.05, 0.00),
  c(0.00, 0.05)
)
parameters <- list(
  beta = matrix(beta_matrix, nrow=k, ncol=k, byrow=TRUE),
  nu = c(1/30, 1/30),
  mu = 0.001,
  k = k
)
times<-seq(0,10000,by=0.5)
model <- sir_subpops_model(times, state, parameters)
model



[Package serosv version 1.1.0 Index]