Skip to contents

This class represents the SEIR model, showing how populations of susceptible, exposed, infectious and recovered individuals evolve over time. The model considers these populations in two types of communities: rural and urban. This class considers the model where people DO NOT move between communities but can infect people from the other community.

Usage

# S4 method for SEIRD_RU
initial_conditions(object)

# S4 method for SEIRD_RU
initial_cases_deaths(object)

# S4 method for SEIRD_RU
transmission_parameters(object)

# S4 method for SEIRD_RU
contact_rates(object)

# S4 method for SEIRD_RU
country_demog(object)

# S4 method for SEIRD_RU
fraction_rural(object)

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

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

# S4 method for SEIRD_RU
contact_rates(object) <- value

# S4 method for SEIRD_RU
country_demog(object) <- value

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

# S4 method for SEIRD_RU
R0(model)

# S4 method for SEIRD_RU
ode_structure_diagram(model)

Arguments

object

an object of the class SEIRD_RU

value

(list) list of 2 sets of population fractions by age group, or a single value noting the fraction of the population that is rural.

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

Value

object of class SEIRD_RU with initial conditions assigned. object of class SEIRD_RU with transmission parameter values assigned. object of class SEIRD_RU with contact matrices assigned. object of class SEIRD_RU with demographic data assigned. a dataframe with the time steps, time series of S, E, I and R population fractions, and incidence numbers and deaths for both communities in the SEIRD_RU model. the value of R0 An ODE-compartmental structure diagram object of class html

Methods (by generic)

  • initial_conditions: Retrieves initial conditions of SEIRD_RU model.

  • initial_cases_deaths: Retrieves initial cases and deaths of SEIRD_RU model.

  • transmission_parameters: Retrieves transmission parameters of SEIR model.

  • contact_rates: Retrieves contact rates of SEIR model.

  • country_demog: Retrieves age demographics, if provided, of SEIR model.

  • fraction_rural: Retrieves fraction of the population that lives in a rural environment of SEIR model.

  • initial_conditions<-: Setter method for initial conditions (S0, E0, I0 and R0) for both communities in the SEIR 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<-: Setter method for transmission parameters (b, k, g, m and C) of the SEIR model.

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

  • contact_rates<-: Setter method for contact matrices for urban and rural communities in the SEIR model. Matrices must be of type double. NOTE: if inputting matrices, you MUST assign fraction_rural first, and you must input full age demographics, i.e. you cannot only provide the fraction of the population that is rural!

  • country_demog<-: Setter method for demographic data for urban and rural communities in the SEIR model. both vectors together must sum to 1.

  • run: Solves ODEs of the SEIRD_RU specified in object for the time points specified in times and integration method specified in solve_method.

    For the urban community: $$\frac{dS_U(t)}{dt} = - b S_U (I_U + I_Y) N_U C - b S_U/f_urban I_U/f_urban N_U (1-C)$$ $$\frac{dE_U(t)}{dt} = b S_U (I_U + I_Y) N_U C + b S_U/f_urban I_U/f_urban N_U (1-C) -k E_U$$ $$\frac{dI_U(t)}{dt} = k E_U - (g + m) I_U$$ $$\frac{dR_U(t)}{dt} = g I_U$$ $$\frac{dC_U(t)}{dt} = b S_U (I_U + I_Y) N_U C + b S_U/f_urban I_U/f_urban N_U (1-C)$$ $$\frac{dD_U(t)}{dt} = m I_U$$

    For the rural community: $$\frac{dS_Y(t)}{dt} = - b S_Y (I_U + I_Y) N_Y C - b S_Y/f_rural I_Y/f_rural N_Y (1-C)$$ $$\frac{dE_Y(t)}{dt} = b S_Y (I_U + I_Y) N_Y C + b S_Y/f_rural I_Y/f_rural N_Y (1-C) - k E_Y$$ $$\frac{dI_Y(t)}{dt} = k E_Y - (g + m) I_Y$$ $$\frac{dR_Y(t)}{dt} = g I_Y$$ $$\frac{dC_Y(t)}{dt} = b S_Y (I_U + I_Y) N_Y C + b S_Y/f_rural I_Y/f_rural N_Y (1-C)$$ $$\frac{dD_Y(t)}{dt} = m I_Y$$

    This function relies on the package deSolve.

  • R0: Returns the value of R0, the basic reproduction number, for the model with the specified parameter values. R0 is computed using the next generation matrix method as set out in van den Driessche (2017): van den Driessche, P. Reproduction numbers of infectious disease models. Infectious Disease Modelling, 2:288–303, 8 2017.

    In this method, the variables are split into two groups: those that represent infected individuals (in our case the exposed and infectious compartments in both communities), and those that do not (the susceptible, recovered and dead). We only further consider the system of equations consisting of the ODEs describing the variables in the first group, in this case (E_U, E_Y, I_U and I_Y). The differential equations for the variables in the first group are written in the form $$\frac{dx_i}{dt} = F_i - V_i$$ where F_i are the terms describing new cases of infection and V_i the terms describing how individuals move between infected and other compartments. We compute the matrices matF and matV as $$matF = \partial F_i(x_0)/\partial x_j$$ $$matV = \partial V_i(x_0)/\partial x_j$$ where x_j are all the variables representing infected individuals. Finally, R0 is the spectral radius of the matrix FV^(-1). For a more detailed description of this method, see van den Driessche (2017).

  • ode_structure_diagram: Prints a compartmental diagram for the SEIRD_RU model

    Note that gamma is used in place of Y in subscripts for the rural model.

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("S_U0", "E_U0", "I_U0", "R_U0", "S_Y0", "E_Y0", "I_Y0", "R_Y0").

initial_cases_deaths_names

name for initial cases and deaths (characters). Default is list("C_U0", "D_U0", "C_Y0", "D_Y0").

transmission_parameter_names

list of names of transmission parameters (characters). Default is list("b", "k", "g", "m", "C").

initial_conditions

list of values for initial conditions (double).

initial_cases_deaths

list of values for initial cases and deaths. Both set to 0, not to be changed by user (double).

transmission_parameters

list of values for transmission parameters (double).

contact_rates

list of two contact rates, one for urban communities and one for rural communities, with the number of contacts as a fraction of the total population size (double).

contact_rates_names

list of names for two contact rates, one for urban communities and one for rural communities

country_demog

list of two vectors, each describing the age breakdown of the population in the urban and rural communities.

country_demog_names

list of names for two demographic vectors, one for urban communities and one for rural communities

fraction_rural

fraction of the population that lives in a rural environment.