Skip to content

Commit

Permalink
Update bednet and lsm
Browse files Browse the repository at this point in the history
  • Loading branch information
smitdave committed Feb 1, 2024
1 parent 365f671 commit d9d474b
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 12 deletions.
1 change: 1 addition & 0 deletions R/bednet-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ BedNetEffects <- function(t, pars, s) {
#' @description This method dispatches on the type of `pars$ITNefsz`.
#' @param t current simulation time
#' @param pars a [list]
#' @param s the vector species index
#' @return a [list]
#' @export
BedNetEffectSizes <- function(t, pars, s) {
Expand Down
2 changes: 1 addition & 1 deletion R/bednet-lemenach.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ BedNetEffectSizes.lemenach <- function(t, pars, s){
#' in host seeking/bloodfeeding and resting/oviposition
#' @param r probability of mosquito being repelled upon contact with ITN
#' @param s probability of mosquito successfully feeding upon contact with ITN
#' @param phi a [function] that takes a single argument `t` and returns the level of ITN coverage at that time
#' @param F_phi a [function] that takes as argument `t` and `pars` and returns the level of ITN coverage at that time
#' @return none
#' @export
setup_itn_lemenach <- function(pars, tau0_frac = c(0.68/3, 2.32/3), r = 0.56, s = 0.03, F_phi = function(t, pars){.8} ) {
Expand Down
2 changes: 0 additions & 2 deletions R/lsm-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ TreatHabitats <- function(t, pars) {
#' @title Modify effects of LSM
#' @description This method dispatches on the type of `pars$LSM`.
#' @param t current simulation time
#' @param y the state of the system
#' @param pars a [list]
#' @return a [list]
#' @export
Expand All @@ -25,7 +24,6 @@ LSM_Effects <- function(t, pars) {
#' @title Compute effect sizes of LSM
#' @description This method dispatches on the type of `pars$LSM`.
#' @param t current simulation time
#' @param y the state of the system
#' @param pars a [list]
#' @return a [list]
#' @export
Expand Down
2 changes: 2 additions & 0 deletions man/BedNetEffectSizes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/BedNetEffectSizes.lemenach.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/BedNetEffectSizes.null.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/BedNetEffects.lemenach.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/LSM_EffectSizes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/LSM_Effects.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/setup_itn_lemenach.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 59 additions & 2 deletions vignettes/environmental_heterogeneity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,67 @@ knitr::opts_chunk$set(
)
```

Heterogeneous blood feeding is a basic feature of malaria transmission (see [Heterogeneous Transmission](heterogeneous_transmission.html)). In `exDE` the term **environmental heterogeneity** is used to describe the distribution of the expected number of bites within a homogenous human population stratum: biting is extremely heterogeneous even for individuals who have the same expectation. The approach is motivated by a study of heterogeneous exposure by (Cooper L, *et al.*, 2019)^[Cooper L, Kang SY, *et al.* (2019). Pareto rules for malaria super-spreaders and super-spreading. Nat Commun 10, 3939, https://doi.org/10.1038/s41467-019-11861-y].
Heterogeneous blood feeding is a basic feature of malaria transmission (see [Heterogeneous Transmission](heterogeneous_transmission.html)). In `exDE` the term **environmental heterogeneity** is used to describe the distribution of the expected number of bites within a homogenous human population stratum: biting is extremely heterogeneous even for individuals who have the same expectation. The approach is motivated by a study of heterogeneous exposure by (Cooper L, *et al.*, 2019)^[Cooper L, Kang SY, *et al.* (2019). Pareto rules for malaria super-spreaders and super-spreading. Nat Commun 10, 3939, https://doi.org/10.1038/s41467-019-11861-y].

## The Force of Infection and Attack Rates
In the following, we derive formulas for the force of infection (FoI) from the model for the attack rate (AR) under the Poisson and .

## Attack Rates and the Force of Infection

In mechanistic models of malaria, the hazard rate for exposure is generally assumed to be a linear function of the entomological inoculation rate. In the following, we assume that the number of bites per person over a day (or over some longer interval, $\tau$), is a random variable, and we formulate approximating models for attack rates and hazard rates.

### Poisson Hazard Rates

We let $E$ denote the EIR, the expected number of bites per person over a day. If we assume that the distribution of the daily EIR is Poisson, and if a fraction $b$ of infective bites cause an infection, then the relationship between the between EIR and the FoI is a Poisson compounded with a binomial, which is also Poisson:

$$
Z \sim F_E(z) = \mbox{Poisson}(z, \mbox{mu} = bE(t))
$$

Over a day, the daily attack rate, $\alpha$, is the fraction of individuals who received at least one infection, or:

$$
\begin{array}{rl}
\alpha &= 1-F_E(0) \\ &= 1-\mbox{Poisson}(0, \mbox{mu} = bE(t)) \\
&= 1- e^{-bE(t)} \\
\end{array}
$$

The daily FoI, $h$, is given by a generic formula:

$$
\alpha = 1 - e^{-h} \mbox{ or equivalently } h = -\ln (1-\alpha)
$$

In this case, the relationship between the FoI and the EIR is:

$$
h(t) = b E(t)
$$

It is highly mathematically convenient that the relationship is invariant with respect to the sampling period.

### Negative Binomial Daily Hazards

If we assume the number of infective bites, per person, per day, has a Gamma distribution in a population, then we could model the number of infective bites as a Gamma - Poisson mixture process, or a negative binomial distribution. Under this model, the counts for bites by sporozoite positive mosquitoes over one day, $Z$, would be a negative binomial random variable with mean $E$:

$$
Z \sim F_E(z) = \mbox{NB}(z, \mbox{mu} = bE(t), \mbox{size} = 1/\phi)
$$

Assuming an infectious bite causes an infection with probability $b$, the daily attack rate is:

$$
\begin{array}{rl}
\alpha &= 1-F_E(0) \\ &= 1-\mbox{NB}(0, \mbox{mu} = b E(t), \mbox{size} = 1/\phi) \\
&= 1- \left(1+b E(t)\phi \right)^{-1/\phi}
\end{array}
$$

This is consistent with a formula that has a continuous daily FoI:

$$
h = \frac{\ln \left(1 + bE(t)\phi \right)} {\phi}
$$



Expand Down
4 changes: 2 additions & 2 deletions vignettes/vc_lemenach.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ knitr::opts_chunk$set(
In this vignette we demonstrate how to set up a model incorporating the Le Menach model of ITN based vector control (see [this paper](https://malariajournal.biomedcentral.com/articles/10.1186/1475-2875-6-10)). We use the Ross-Macdonald model of adult mosquito dynamics, the SIS model of human population dynamics, and the basic competition model of aquatic mosquito dynamics to fill the dynamical components $\mathcal{M}, \mathcal{X}, \mathcal{L}$.

```{r, message=FALSE, warning=FALSE}
#library(exDE)
library(exDE)
library(MASS)
library(expm)
library(deSolve)
Expand All @@ -28,7 +28,7 @@ library(ggplot2)


```{r, echo=FALSE}
devtools::load_all()
#devtools::load_all()
```

## Parameters
Expand Down

0 comments on commit d9d474b

Please sign in to comment.