Skip to contents

The SEIRD connected model implements a model where all agents are connected. This is equivalent to a compartmental model (wiki).

Usage

ModelSEIRDCONN(
  name,
  n,
  prevalence,
  contact_rate,
  transmission_rate,
  incubation_days,
  recovery_rate,
  death_rate
)

# S3 method for class 'epiworld_seirdconn'
plot(x, main = get_name(x), ...)

Arguments

name

String. Name of the virus.

n

Number of individuals in the population.

prevalence

Initial proportion of individuals with the virus.

contact_rate

Numeric scalar. Average number of contacts per step.

transmission_rate

Numeric scalar between 0 and 1. Probability of transmission.

incubation_days

Numeric scalar greater than 0. Average number of incubation days.

recovery_rate

Numeric scalar between 0 and 1. Probability of recovery_rate.

death_rate

Numeric scalar between 0 and 1. Probability of death.

x

Object of class SEIRCONN.

main

Title of the plot.

...

Currently ignore.

Value

The plot function returns a plot of the SEIRDCONN model of class epiworld_model.

Details

The initial_states function allows the user to set the initial state of the model. The user must provide a vector of proportions indicating the following values: (1) Proportion of exposed agents who are infected, (2) proportion of non-infected agents already removed, and (3) proportion of non-ifected agents already deceased.

Examples

# An example with COVID-19
model_seirdconn <- ModelSEIRDCONN(
  name                = "COVID-19",
  prevalence          = 0.01,
  n                   = 10000,
  contact_rate        = 2,
  incubation_days     = 7,
  transmission_rate   = 0.5,
  recovery_rate       = 0.3,
  death_rate          = 0.01
)

# Running and printing
run(model_seirdconn, ndays = 100, seed = 1912)
#> _________________________________________________________________________
#> Running the model...
#> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| done.
#>  done.
model_seirdconn
#> ________________________________________________________________________________
#> Susceptible-Exposed-Infected-Removed-Deceased (SEIRD) (connected)
#> It features 10000 agents, 1 virus(es), and 0 tool(s).
#> The model has 5 states.
#> The final distribution is: 490 Susceptible, 2 Exposed, 1 Infected, 9280 Removed, and 227 Deceased.

plot(model_seirdconn)


# Adding the flu
flu <- virus(
  "Flu", prob_infecting = .3, recovery_rate = 1 / 7,
  prob_death = 0.001,
  prevalence = 0.001, as_proportion = TRUE
)
add_virus(model = model_seirdconn, virus = flu)

#' # Running and printing
run(model_seirdconn, ndays = 100, seed = 1912)
#> _________________________________________________________________________
#> Running the model...
#> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| done.
#>  done.
model_seirdconn
#> ________________________________________________________________________________
#> Susceptible-Exposed-Infected-Removed-Deceased (SEIRD) (connected)
#> It features 10000 agents, 2 virus(es), and 0 tool(s).
#> The model has 5 states.
#> The final distribution is: 449 Susceptible, 8 Exposed, 8 Infected, 9331 Removed, and 204 Deceased.

plot(model_seirdconn)