R/antibody_models.R
antibody_model_biphasic_cross_reactivity.Rd
Biphasic antibody boosting-waning model with cross-reactivity between strains. This model assumes that for each exposure there is a set of long-term boost, long-term boost waning, short-term boost, and short-term boost waning parameters describing antibody kinetics against the infecting strain (i.e., for exposure_id==biomarker_id). The model loops through each exposure type and reduces the amount of boosting as a function of cross-reactivity, which is determined by a proportion given in the biomarker_map
data frame as the value
variable.
antibody_model_biphasic_cross_reactivity(
i,
t1,
b,
immune_histories,
biomarker_states,
kinetics_parameters,
biomarker_map,
...
)
individual
time
biomarker
An array of immune histories across all individuals, time steps and exposure IDs
An array of biomarker states (biomarker quantities) across all individuals, time steps and biomarker IDs
A tibble of parameters needed for the antibody kinetics model for all biomarkers
A table specifying the relationship between exposure IDs and biomarker IDs
Additional arguments
A biomarker quantity is returned
Other antibody_models:
antibody_model_biphasic_cpp()
,
antibody_model_biphasic()
,
antibody_model_monophasic_cpp()
,
antibody_model_monophasic_cross_reactivity()
,
antibody_model_monophasic()
,
antibody_model_typhoid()
tmp_pars <- list()
## Set up simple model_pars table for this antibody model
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
model_pars_tmp <- example_model_pars_biphasic %>% reformat_biomarker_map() %>%
mutate(biomarker_id = exposure_id)
## Simulate one infection with exposure ID 1 at t=1
tmp_pars[[1]] <- draw_parameters_fixed_fx(1,1,1,NULL, NULL, model_pars_tmp)
## Set up a simple biomarker map for cross-reactivity
biomarker_map = tidyr::expand_grid(exposure_id=1:2, biomarker_id=1:2) %>%
mutate(value = if_else(exposure_id==biomarker_id, 1, 0.5))
antibody_model_biphasic_cross_reactivity(1,1,1,example_immune_histories_wide,
example_biomarker_states_wide, tmp_pars, biomarker_map)
#> [1] 0.75