A discretized stochastic and deterministic model of temperature and photoperiod driven culex dynamics with movement of adults based on the mathematical model(s) presented in:
- Paper: Uncovering mechanisms behind mosquito seasonality by integrating mathematical models and daily empirical population data: Culex pipiens in the UK here, Code repo: here
- Paper: Modelling the effect of temperature on the seasonal population dynamics of temperate mosquitoes here, Code repo: here
- Paper: A novel approach for predicting risk of vector-borne disease establishment in marginal temperate environments under climate change: West Nile virus in the UK here, Code repo: here
The models in this package are run in discrete time, but the size of the time step (dt
in code) may be arbitrarily small. The package implements deterministic and stochastic lifecycle models, as well as models with SEI infection dynamics in mosquitoes, where the force of infection upon mosquitoes (decomposed into f
, q
, and kappa
; feeding rate, proportion of bloodmeals on each host species, and net infectiousness of each host species, respectively) is input from an external model. The use case is for this model of mosquito dynamics to be embedded in a larger simulation framework, perhaps including humans, birds, or other host species for the pathogen of interest. These models also implement movement of adult mosquitoes between patches based on a dispersal matrix.
Rates are converted into probabilities by an exponential CDF, which are interpreted as proportions of the population moving between states in the deterministic models and probabilities for Binomial draws of movement between states in the stochastic models.
Installing this package requires RcppArmadillo to be installed on the users machine, which provides fast linear algebra. If you are having issues on MacOS, please read this guide "R Compiler Tools for Rcpp on macOS".
You can install it either by cloning this repo and building from within RStudio, or directly via:
library(remotes)
remotes::install_github(repo = "dd-harp/culex-sim", dependencies = TRUE)
To transform the delay differential equations into discrete time models, we note that the backward looking delays can be transformed into forward looking queues of completion times by first integrating the ordinary differential equations for delay duration.
These ODEs are of the form:
Where dt
,
and subtract
The solutions to the delays are shown below, for the egg (E), larval (L), pupae (P), and extrinsic incubation period (EIP) stages.
Using these trajectories as inputs, new arrivials to a stage can be queued to complete it after an appropriate number of time steps has passed (assuming they survive). Below we show a comparison of 50 stochastic trajectories sampled from the discrete time model compared to the solution of the original delay differential equation model (dashed line). Due to the large population size, the stochastic trajectories cluster around the deterministic solution. When populations are smaller, significant deviations from the deterministic model (extinction) are expected.
There are several vignettes in the package demonstrating use of the models.