Learn R Programming

exDE (Extensible Differential Equations for mosquito-borne pathogen modeling)

What is exDE?

exDE provides tools to set up modular ordinary and delay differential equation spatial models for mosquito-borne pathogens, focusing on malaria. Modularity is achieved by method dispatch on parameter lists for each component which is used to compute the full set of differential equations. The function exDE::xDE_diffeqn computes the gradient of all state variables from those modular components and can be used with the excellent solvers in deSolve, or other differential equation solvers in R. exDE can be regarded as the continuous-time companion to the discrete stochastic Micro-MoB framework.

To get started, please consider reading some of the articles in the drop down panels above, at our website. The 3 sections ending in "Component" describe particular models implementing the interface for each of those components (adult mosquitoes, aquatic mosquitoes, and humans), and show a simulation at their equilibrium values.

The section "Articles" has more in-depth examples, including an extended walk through of how to set up and run a model in vignette("ex_534"), a guide on how to contribute, and an example of running a model in exDE with external forcing under a model of ITN (insecticide treated nets) based vector control in vignette("vc_lemenach").

The section "Functions" documents each function exported by the package.

Installation

To install from an R session, run the following lines of code.

library(devtools)
devtools::install_github("dd-harp/exDE")

Contributing

For information about how to contribute to the development of exDE, please read our article on how to contribute at vignette("Contributing")!

Model building in exDE

Models for mosquito borne pathogen transmission systems are naturally modular, structured by vector life stage, host population strata, and by the spatial locations (patches) at which transmission occurs (see figure below).

Models in the exDE framework are constructed from 3 dynamical components:

  • $\mathcal{M}$: adult mosquitoes, whose dynamics are described by $d\mathcal{M}/dt$
  • $\mathcal{L}$: aquatic (immature) mosquitoes, whose dynamics are described by $d\mathcal{L}/dt$
  • $\mathcal{X}$: human population, whose dynamics are described by $d\mathcal{X}/dt$

The combined state from these 3 components is the entire state of the dynamical model, and their combined dynamics described by their differential equations represents the full endogenous dynamics of the system. In addition there are 2 more components which do not directly contribute to the state of the model, but instead modify parameters and compute intermediate quantities to represent external influences on the system. These are:

  • Exogenous forcing: weather, climate, unmodeled populations
  • Vector control: public health and mosquito control interventions which affect the dynamical components

There are also functions which handle the exchange of information (flows) between the dynamical components and which couple their dynamics. Bloodfeeding is the process by which adult mosquitoes seek out and feed on blood hosts, and results in the quantities $EIR$ (entomological inoculation rate) and $\kappa$, the net infectiousness of humans to mosquitoes, which couple the dynamics of $\mathcal{M}$ and $\mathcal{X}$. Likewise emergence of new adults from aquatic habitats and egg laying by adults into habitats couples $\mathcal{M}$ and $\mathcal{L}$.

The function exDE::xDE_diffeqn compute the necessary quantities and returns a vector of derivatives of all state variables which can be used to solve trajectories from a model in exDE. The program flow within this function is summarized by this diagram:

For more information, please read our research article describing the theory behind the model.

Copy Link

Version

Install

install.packages('exDE')

Monthly Downloads

49

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Sean L. Wu

Last Published

November 18th, 2022

Functions in exDE (1.0.0)

F_beta_lag.SIP

Lagged biting distribution matrix
F_alpha

Number of newly emerging adults from each larval habitat
F_kappa.RM_ode

Net infectiousness of human population to mosquitoes
ExogenousForcing.null

Modify parameters due to exogenous forcing
F_beta_lag.SIS

Lagged biting distribution matrix
F_eggs

Number of eggs laid by adult mosquitoes
F_alpha.basic

Number of newly emerging adults from each larval habitat
F_x

Size of effective infectious human population
F_beta

Biting distribution matrix
F_x.SIP

Size of effective infectious human population
F_kappa

Net infectiousness of human population to mosquitoes
ExogenousForcing

Modify parameters due to exogenous forcing
F_tau.RM

Time spent host seeking/feeding and resting/ovipositing
F_x_lag.SIP

Size of lagged effective infectious human population
F_kappa.RM_dde

Net infectiousness of human population to mosquitoes
F_alpha.trace

Number of newly emerging adults from each larval habitat
F_beta_lag

Lagged biting distribution matrix
F_x_lag.hMoI

Size of lagged effective infectious human population
dMYZdt.RM_ode

Derivatives for adult mosquitoes
dLdt.trace

Derivatives for aquatic stage mosquitoes
F_beta_lag.hMoI

Lagged biting distribution matrix
approx_equal

Check if two numeric values are approximately equal
make_index_L.trace

Add indices for aquatic stage mosquitoes to parameter list
F_x_lag.SIS

Size of lagged effective infectious human population
F_tau

Time spent host seeking/feeding and resting/ovipositing
dMYZdt

Derivatives for adult mosquitoes
VectorControl

Modify baseline values due to vector control
F_x_lag

Size of lagged effective infectious human population
make_index_MYZ.RM

Add indices for adult mosquitoes to parameter list
F_x.SIS

Size of effective infectious human population
F_beta.hMoI

Biting distribution matrix
dLdt

Derivatives for aquatic stage mosquitoes
F_x.hMoI

Size of effective infectious human population
make_index_MYZ

Add indices for adult mosquitoes to parameter list
F_eggs.RM

Number of eggs laid by adult mosquitoes
VectorControl.null

Modify baseline values due to vector control
make_index_X

Add indices for human population to parameter list
MosquitoBehavior.RM

Compute bloodfeeding and mortality rates
dLdt.basic

Derivatives for aquatic stage mosquitoes
make_index_L

Add indices for aquatic stage mosquitoes to parameter list
dXdt.SIS

Derivatives for human population
dMYZdt.RM_dde

Derivatives for adult mosquitoes
make_index_L.basic

Add indices for aquatic stage mosquitoes to parameter list
make_index_X.hMoI

Add indices for human population to parameter list
diag_inverse

Invert a diagonal matrix
metric_calV

Parasite dispersal by mosquitoes
VectorControl.lemenach

Modify baseline values due to vector control
dXdt

Derivatives for human population
dXdt.SIP

Derivatives for human population
make_parameters_vc_lemenach

Make parameters for Le Menach ITN model of vector control
make_index_X.SIS

Add indices for human population to parameter list
make_indices

Set indices for generalized spatial model
make_index_X.SIP

Add indices for human population to parameter list
metric_calD

Parasite dispersal by humans
make_parameters_vc_null

Make parameters for the null model of vector control (do nothing)
dXdt.hMoI

Derivatives for human population
make_parameters_X_SIP

Make parameters for SIP human model
make_parameters_X_SIS

Make parameters for SIS human model
make_Omega

Make the mosquito demography matrix
make_parameters_exogenous_null

Make parameters for the null model of exogenous forcing (do nothing)
MosquitoBehavior

Compute bloodfeeding and mortality rates
make_parameters_X_hMoI

Make parameters for hybrid MoI human model
make_parameters_L_basic

Make parameters for basic competition aquatic mosquito model
metric_calZ

Parasite Dispersal through one Parasite Generation (Mosquitoes)
metric_calR

Parasite Dispersal through one Parasite Generation (Humans)
make_parameters_MYZ_RM_ode

Make parameters for generalized RM ODE adult mosquito model
xDE_diffeqn

Generalized spatial differential equation model
make_parameters_MYZ_RM_dde

Make parameters for generalized RM DDE adult mosquito model
make_parameters_L_trace

Make parameters for trace aquatic mosquito model
xDE_diffeqn_mosy

Generalized spatial differential equation model (mosquito only)
F_EIR.SIS

Entomological inoculation rate on human strata
F_EIR

Entomological inoculation rate on human strata
F_Z

Density of infectious mosquitoes
F_EIR.hMoI

Entomological inoculation rate on human strata
F_Z_lag

Density of lagged infectious mosquitoes
F_Z_lag.RM

Density of lagged infectious mosquitoes
F_Z.RM

Density of infectious mosquitoes
F_EIR.SIP

Entomological inoculation rate on human strata
F_beta.SIS

Biting distribution matrix
F_beta.SIP

Biting distribution matrix