Build an intervention object from efficacy parameters
Source:R/interventions.R
build_intervention.RdConstructs an intervention effects object from user-supplied initial efficacy values (deterrency, pre-prandial killing, post-prandial killing) and a parametric attrition decay function. The three columns of each effects matrix correspond to: (1) protected humans, (2) unprotected humans, (3) animals.
Two model structures are supported and are mutually exclusive:
Standard (3-host): uses
Deterrency,PrePrandial, andPostPrandial.Dummy-host (4-host): uses
Deterrency,KillingDuringHostSeekingAbsolute, andPostPrandial. A fourth dummy-host column is added to all effects matrices. Do not supplyPrePrandialtogether withKillingDuringHostSeekingAbsolute.
Usage
build_intervention(
efficacy,
halflife_attrition = NULL,
shape_attrition = NULL,
decay_attrition = "weibull",
duration_years = 3,
model_p = NULL,
name = NULL,
mode = NULL,
halflife_insecticide = NULL,
component_decay = NULL,
insecticide_decay = TRUE
)Arguments
- efficacy
Non-empty numeric vector with unique component names and finite, non-missing values, using any subset of the following efficacy parameters:
"Deterrency"in[0,1]— reduces host availability (alphai) for protected humans; deterred mosquitoes keep searching."PrePrandial"in[0,1]— pre-prandial killing: reduces the probability that a mosquito that has found a protected human bites and survives (PBi); mosquitoes failing this stage die. Standard model only."PostPrandial"in[0,1]— post-prandial killing: reduces the probability of surviving after feeding on a protected human to find a resting place (PCi)."KillingDuringHostSeekingAbsolute"\(\geq 0\) — killing during host-seeking via a dummy-host mechanism. Dummy-host model only. An absolute rate, not a probability: it is used directly as the availability of the dummy host (one per protected person), in the same units as the host availabilitiesalphai. Values from experimental hut fits that are relative to the control availabilityalpha_0(KillingDuringHostSeekingRelative) must first be multiplied byalpha_0(get_ITN_params()does this).
Note on time units: the experimental hut model has no time scale (its rates are per hut-night), whereas the rates of this package are per day, with
tdthe duration of host seeking. By convention, a hut-night is treated as a day:KillingDuringHostSeekingAbsoluteis used directly as a per-day rate, without dividing bytd. This is provisional, until the experimental hut fitting model is improved. With this convention, the field impacts of the dummy-host parameterisations are of the same order as those of the standard parameterisations of the same trials, whereas dividing bytdgives systematically higher impacts (the standard model is not a validated benchmark either).- halflife_attrition
Attrition decay parameter
L(days): the half-life for Weibull / exponential / Hill, the time to zero for linear / step / smooth-compact (seedecay_function()).- shape_attrition
Shape parameter
kappaof the attrition decay function (for Weibull / Hill / smooth-compact; set toNULLotherwise).- decay_attrition
Attrition decay function:
"weibull","exponential","hill","linear","step","smooth-compact"or"none"(seedecay_function()). Default"weibull".- duration_years
Single finite positive duration in years. One interpolation point per day is used, with at least one point:
npoints = max(round(365 * duration_years), 1). Default 3 years.- model_p
Model object from
build_model_obj().- name
Optional label for the intervention.
- mode
Optional character;
"standard"or"dummy_host". When supplied, overrides auto-detection from the names ofefficacy. The object returned byget_ITN_params()includes amodefield that can be passed here directly.- halflife_insecticide
Optional named numeric vector (years), using the same names as
efficacy, triggering an additional per-component linear insecticide decay on top of the main attrition: the efficacy of a component is multiplied by \(1 - t / (365 \cdot hl)\). Despite its name, \(hl\) is the time at which the effect reaches zero (the effect halves at \(hl / 2\)). This is the convention of the Champagne et al. (2025) parameterisations returned byget_ITN_params(), where \(hl = a / (1 - Washed / Unwashed)\), with \(a\) the aging time of the trial's washed arm (3 years, 2 for Sovegnon), so that efficacy after \(a\) years equals the washed (20x) value. Negative values (washed efficacy higher than unwashed) make the effect increase linearly over time;Infmeans no insecticide decay. Zero andNaNvalues are invalid;NAmeans unspecified. For other decay shapes, usecomponent_decay.- component_decay
Optional named list specifying an independent decay function for each efficacy component, using the same names as
efficacy. Each element is a list with fieldsdecay(string),L(days; meaning depends on the shape, seedecay_function()), and optionallykappa. An explicit shape always overrideshalflife_insecticidefor the same component. Constant shapes ("none","constant") need noLorkappa; other shapes require a positiveLand, where applicable, a positivekappa. Incomplete specifications raise an error instead of falling back to linear or constant decay.- insecticide_decay
Logical (default
TRUE). IfFALSE,halflife_insecticideandcomponent_decayare ignored: the efficacies keep their initial (e.g. unwashed) values throughout and only attrition decays. IfTRUE, the per-component insecticide decay is applied and, in addition, a Weibull decay is fitted for each efficacy component to the product attrition \(\times\) insecticide decay (see Value).
Value
A list of length 1 containing the intervention specification, ready
to pass to calculate_impact(). Standard model: 3-column effects
matrices. Dummy-host model: 4-column effects matrices.
When insecticide_decay = TRUE, the element fitted_decay is a
data frame with one row per efficacy component and columns
component, L (Weibull half-life, days), kappa and
rmse: the single Weibull per component (starting at 1) that best
approximates attrition \(\times\) insecticide decay over the
intervention duration (as used for OpenMalaria GVI parameterisations).
The model itself always uses the exact (unfitted) decay.
The element settings keeps the inputs (efficacy, mode, attrition and
per-component decays, insecticide_decay), used by
get_OM_GVI_snippet(). The element param_set is the same
intervention as a one-row param_sets table of
run_interventions(), which calculate_impact() evaluates.
Several interventions are combined with c().