This class represents the SEmIRD model, showing how populations of susceptible, exposed, infectious and recovered individuals evolve over time. Here, there are multiple exposed compartments
Usage
# S4 method for SEmIRD
initial_conditions(object)
# S4 method for SEmIRD
transmission_parameters(object)
# S4 method for SEmIRD
initial_conditions(object) <- value
# S4 method for SEmIRD
transmission_parameters(object) <- value
# S4 method for SEmIRD
run(object, times, solve_method = "lsoda")
# S4 method for SEmIRD
R0(model)
# S4 method for SEmIRD
ode_structure_diagram(model)
Arguments
- object
an object of the class SEmIRD
- value
(list) list of values for beta, kappa, gamma, mu, respectively.
- times
(double) a sequence of time points at which the solution to the system of ODEs should be returned. Must be of the form seq(t_start, t_end, by=t_step). Default time series is seq(0, 100, by = 1).
- solve_method
(string) a string of chosen numerical integration method for solving the ode system. Default is lsoda which is also the default for the ode function in the deSolve package used in this function.
- model
an SEmIRD model
Value
object of class SEmIRD with initial conditions assigned. object of class SEmIRD with transmission parameter values assigned. two dataframes: one with the time steps, age range, time series of S, E1, E2, ..., En, I and R population fractions, and one with the time steps, age range, time series of incidences and deaths population fraction. an R0 value An ODE-compartmental structure diagram object of class html
Methods (by generic)
initial_conditions
: Retrieves initial conditions of SEmIRD model.transmission_parameters
: Retrieves transmission parameters of SEmIRD model.initial_conditions<-
: Setter method for initial conditions (S0, E0, I0 and R0) of the SEmIRD model.All initial conditions must sum up to 1. If the initial conditions provided to do not sum to 1, an error is thrown.
transmission_parameters<-
: Set transmission parameters (beta, kappa, gamma and mu) of the SEmIRD model.If the transmission parameters provided to are not 1-dimensional an error is thrown.
run
: Solves ODEs of the SEmIRD specified in object for the time points specified in times and integration method specified in solve_method.$$\frac{dS(t)}{dt} = - beta S(t) I(t)$$ $$\frac{dE_i(t)}{dt} = beta S(t) I(t) - kappa E_i(t), (if i=1)$$ $$\frac{dEi(t)}{dt} = kappa E_{i-1}(t) - kappa E_i(t), (if i>1)$$ $$\frac{dI(t)}{dt} = kappa E_n(t) - (gamma + mu) I(t)$$ $$\frac{dR(t)}{dt} = gamma I(t)$$ $$\frac{dC(t)}{dt} = beta S(t) I(t)$$ $$\frac{dD(t)}{dt} = mu I(t)$$
This function relies on the package deSolve.
R0
: Calculates basic reproduction number for SEmIRD modelThe R0 parameter is given by: $$R_0 = \beta/(\gamma + \mu)$$
ode_structure_diagram
: Prints a compartmental diagram for the SEmIRD modelThe diagram is shown for the n=3 exposed compartments case
Slots
output_names
list of compartments name which are used by the model and incidence.
initial_condition_names
list of names of initial conditions (characters). Default is list("S0", "E0", "I0", R0").
transmission_parameter_names
list of names of transmission parameters (characters). Default is list("beta", "kappa", "gamma", "mu").
initial_conditions
list of values for initial conditions (double).
transmission_parameters
list of values for transmission parameters (double).