Check model elements for compatibility with the population in an epidemic model, returning compatible dummy values when model elements are not applied, and erroring appropriately when model elements are not compatible with the population characteristics.
Usage
.cross_check_intervention(x, population, allowed_targets)
.cross_check_vaccination(x, population, doses)
.cross_check_timedep(x, allowed_targets)
.cross_check_popchange(x, population)Arguments
- x
Model input to be checked. The expected value of
xdepends on the function:.cross_check_intervention(): A named list of<intervention>objects;.cross_check_vaccination(): A<vaccination>object;.cross_check_timedep(): A named list of functions with two arguments,timeandx, typically returningxas a function oftime;.cross_check_popchange(): A named list with two elements,timeandvalues, describing the times and values by which the number of susceptibles changes in an epidemic model.
- population
An object of the
populationclass, which holds a population contact matrix, a demography vector, and the initial conditions of each demographic group. Seepopulation().- allowed_targets
The model components, or infection parameters, that the model input
xaffects.- doses
The expected number of vaccination doses.
Value
.cross_check_intervention()returns a named list with at least the elements "contacts" describing a<contacts_intervention>onpopulation(if this is among the allowed targets), and a<rate_intervention>on the transmission rate parameter. If these are present inx, they are returned as is, or substituted if missing. Any other interventions are also returned. IfxisNULL, dummy contact and rate interventions are returned in a list..cross_check_vaccination()returnsxafter checking that it is suitable forpopulation, or a dummy vaccination regime withdosesnumber of doses for each age group..cross_check_timedep()returnsxifxis notNULL, otherwise returns a dummy function operating on the transmission rate parameter by default; see.no_time_dependence();.cross_check_popchange()returnsxafter checks againstpopulationifxis notNULL, otherwise returns a dummy list with no population change; see.no_population_change().