Skip to contents

Methods solve the set of ordinary differential equations of the model with a chosen method of numerical integration.

Usage

# S4 method for SEIRDNPIAge
initial_conditions(object)

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

# S4 method for SEIRDNPIAge
transmission_parameters(object)

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

# S4 method for SEIRDNPIAge
interventions(object)

# S4 method for SEIRDNPIAge
interventions(object) <- value

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

# S4 method for SEIRDNPIAge
R0(model)

# S4 method for SEIRDNPIAge
ode_structure_diagram(model)

Arguments

object

An object of the class SEIRDNPIAge.

value

(list) list of NPI parameters: starts, stops

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 SEIRDNPIAge model

Value

Initial conditions of SEIRDNPIAge model. Updated version of the age-structured SEIR model with NPIs Transmission parameters of SEIRDNPIAge model. Updated version of the age-structured SEIR model with NPIs. object of class SEIRDNPIAge with NPI parameters assigned. a data frame containing the time vector and time series of S, R, I 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 with NPIs. 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 SEIR model with NPIs.

  • transmission_parameters<-: Sets the transmission_parameters for an age-structured SEIRD model with NPIs.

    Sets transmission_parameters of an age-structured SEIR model.

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

  • interventions: Retrieves NPI parameters of SEIRDNPIAge model.

  • interventions<-: Setter method for NPI parameters of the SEIRDNPIAge model.

  • run: Method to simulate output using from model.

    Solves a system to ODEs which form an age-structured simple SEIR 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(t) S_i \Sigma_{j}C_{ij}(t) I_j$$ $$\frac{dE_i(t)}{dt} = \beta(t) S_i \Sigma_{j}C{ij}(t) I_j-\kappa E_i$$ $$\frac{dI_i(t)}{dt} = \kappa E_i - (\gamma_i + \mu_i) I_i$$ $$\frac{dR_i(t)}{dt} = \frac{\text{d}R_i}{\text{d}t} = \gamma_i I_i$$ $$\frac{dC(t)}{dt} = \beta_i(t) S_i \Sigma_{j}C_{ij}(t) I_j$$ $$\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). Inter(t) is the value at time t of the NPI protocol defined by the NPI (intervention) parameters. The model encorperates the influence of NPIs which act to reduce the degree of social contact and/or change the transmission parameters beta between individuals. This is done by splitting any simulation of the model into several intervals and utilising a different contact matrix in each interval to simulate the introduction of NPIs through time. This function relies on the package deSolve to numerically integrate the set of equations above.

  • R0: Calculates the basic reproduction number for SEIRDNPIAge model

    To calculate this parameter, we first calculate the next generation matrix G, where G_ij gives the expected number of secondary infections of type i caused by a single infectious individual of type j, assuming that all of type i are susceptible. In the SEIRDNPIAge 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, beta is the non-intervention transmission parameter and C_ij is the non-intervention 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 SEIRDNPIAge model

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.

npi_parameter_names

list of names of NPI parameters (characters). Default is list ("starts", "stops").

initial_conditions

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

transmission_parameters

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

npi_parameters

list of values for NPI parameters (double).

interventions

list of NPI periods

contact_matrix

A square matrices, each 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) in the ist interval of the simulation (normally with no restriction on social contact.

contact_matrix_npi

A list of square matrices, each 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) in the ist interval of the simulation (normally with no restriction on social contact.

n_age_categories

number of age categories.

n_npi

number of NPI periods.

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'.