
Immunity model for infection with biomarker-quantity-mediated protection
Source:R/immunity_models.R
immunity_model_ifxn_biomarker_prot.Rd
This immunity model should only be used for infection events. The probability of a successful exposure event is dependent on the individual’s biomarker quantity at the time of exposure. User specified biomarker_prot_midpoint
and biomarker_prot_width
within model_pars
is used to calculate biomarker-mediated protection.
Usage
immunity_model_ifxn_biomarker_prot(
i,
t,
x,
exposure_histories,
biomarker_states,
demography,
biomarker_map,
model_pars,
max_events,
cross_reactivity_table = NULL,
...
)
Arguments
- i
integer for the individual ID
- t
integer for the time period
- x
integer for the exposure ID
- exposure_histories
a 3D array of exposure histories for all individuals, time steps and exposure IDs
- biomarker_states
an 3D array of biomarker states (biomarker quantities) for all individuals, time steps and biomarker IDs
- demography
a tibble of demographic information for each individual in the simulation
- biomarker_map
a table specifying the relationship between exposure IDs and biomarker IDs
- model_pars
a tibble of parameters needed for the immunity model
- max_events
a vector of the maximum number of successful exposure events possible for each exposure ID
- cross_reactivity_table
an optional table which indicates cross-reactivity between exposure and biomarker quantities. Here users can specify whether other biomarker quantities are also protective against successful exposure. Defaults to NULL.
- ...
Additional arguments
Examples
tmp_exposure_history <- array(0, dim=c(1, 10, 1))
## Toy example: individual has 1 prior exposure
tmp_exposure_history[1,1,1] <- 1
## Set all biomarker states to 3 for sake of example
tmp_biomarker_states <- array(0, dim=c(1,10,1))
tmp_biomarker_states[1,,1] <- 3
tmp_pars <- reformat_biomarker_map(example_model_pars_biphasic)
## Probability of successful exposure (i.e., infection) depends on the biomarker quantity
immunity_model_ifxn_biomarker_prot(1,8,1,exposure_histories=tmp_exposure_history,
biomarker_states=tmp_biomarker_states, demography=NULL,
biomarker_map=example_biomarker_map_numeric, model_pars=tmp_pars, max_events=c(3,5))
#> [1] 0.4273919