Skip to contents

Defines an age-structured SEIRD model and solves the set of ordinary differential equations of the model with a chosen method of numerical integration.

Usage

# S4 method for SEIRDAge
initial_conditions(object)

# S4 method for SEIRDAge
initial_conditions(object) <- value

# S4 method for SEIRDAge
transmission_parameters(object)

# S4 method for SEIRDAge
transmission_parameters(object) <- value

# S4 method for SEIRDAge
run(object, times, solve_method = "lsoda")

# S4 method for SEIRDAge
R0(model, population_fractions)

# S4 method for SEIRDAge
ode_structure_diagram(model)

Arguments

object

An object of the class SEIRDAge.

value

a named list of form list(b=, k=, g=, mu=)

Here b is the rate of infection (S->I); k is the rate of transitioning from the infected to infectious compartment (E->I); g is the rate of recovery (I->R). The parameters b and k are numbers. The death rate mu and recovery rate g can either be a single number, in which case all ages are assumed to have the same rate; or it can be a vector of length equal to the number of age classes.

times

(vector) time sequence over which to solve the model. Must be of the form seq(t_start,t_end,by=t_step). Default time series is seq(0, 100, by = 1).

solve_method

A string indicating the 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 SEIRDAge model

population_fractions

the fraction of the population in each age group

Value

Initial conditions of SEIRDAge model. Updated version of the age-structured SEIRD model. Transmission parameters of SEIRDAge model. Updated version of the age-structured SEIRD model. data frame containing the time vector and time series of S, E, I, R and D population fractions for each age group outputs with incidence numbers for each age group. an R0 value An ODE-compartmental structure diagram object of class html

Methods (by generic)

  • initial_conditions: Retrieves initial_conditions for an age-structured SEIRD model.

  • initial_conditions<-: Sets initial_conditions of an age-structured SEIRD model.

    If the initial conditions provided to do not sum to 1 or of different sizes compared to the number of age groups, an error is thrown.

  • transmission_parameters: Retrieves transmission_parameters for an age-structured SEIRD model.

  • transmission_parameters<-: Sets transmission_parameters of an age-structured SEIRD model.

    If the transmission parameters provided to are not 1-dimensional an error is thrown.

  • run: Method to simulate output using from model.

    Solves a system of ODEs which form an age-structured SEIRD model. The system of equations for the time evolution of population fractions in Susceptible (S), Exposed (E), Infected (I), Recovered (R) and Dead (D) groups in a given age group indexed by i is given by

    $$\frac{dS_i(t)}{dt} = - \beta S_i(t) \Sigma_{j}C_{ij} I_j(t)$$ $$\frac{dE_i(t)}{dt} = \beta S_i(t) \Sigma_{j}C_{ij} I_j(t) - \kappa E_i(t)$$ $$\frac{dI_i(t)}{dt} = \kappa E_i(t) - \gamma I_i(t) - \mu_i I_i(t)$$ $$\frac{dR_i(t)}{dt} = \gamma I_i(t)$$ $$\frac{dD_i(t)}{dt} = \mu_i I_i(t)$$ where C is a contact matrix whose elements represents the contact between different age groups (rows) with age groups of people they come in contact with (columns). This function relies on the package deSolve to numerically integrate the set of equations above.

  • R0: Calculates basic reproduction number for SEIRDAge model

    To calculate this parameter, we first calculate the next generation matrix G, where G_ij gives the expected number of infections of type i caused by a single infectious individual of type j, assuming that all of type i are susceptible. In the SEIRDAge model, the number of contacts resulting in infection per unit time in age group i is beta N_i C_ij, where N_i corresponds to the proportion of the population in that age group and C_ij is the contact matrix element. The average duration of infection is 1 / (mu_j + gamma_j) for an individual in age group j. This means the average number of secondary infections of type i caused by an infectious individual of type j is g_ij = beta N_i C_ij / (mu_i + gamma_i). R0 is then given by the dominant eigenvalue of the G matrix.

  • ode_structure_diagram: Prints a compartmental diagram for the SEIRDAge model

    This plot supposes the model comprises two age classes only.

Slots

output_names

names of the compartments which are used by the model.

initial_condition_names

names of the initial conditions used by the model.

transmission_parameter_names

names of the transmission parameters used by the model.

initial_conditions

named list containing the initial conditions of the model. Initial values for each compartment, S0, E0, I0, R0, D0.

transmission_parameters

named list containing the transmission parameters of the model. Transmission parameters b, k, g represent the rates of changes between the compartments.

contact_matrix

A square matrix with dimension equal to n_age_categories x n_age_categories. This matrix represents the contact between different age groups (rows) with age groups of people they come in contact with (columns)

n_age_categories

number of age categories.

age_ranges

list of string characters representing the range of ages of people in each age category. This object must have length n_age_categories (otherwise an error is returned) and each element must be formatted as 'age1-age2'.