Modular functions for the disease simulator for performing a transformation of a population across stages and disease compartments (and optionally carrying capacity) at a specified time step via a user-defined function.
disease_transformation(params)Abundance (and capacity) transformation function:
function(r, tm, carrying_capacity, segment_abundance,
occupied_indices), where:
rSimulation replicate.
tmSimulation time step.
carrying_capacityArray of carrying capacity values for each population at time step.
segment_abundanceMatrix of abundance for each stage-compartment combo (rows) and population (columns) at time step.
occupied_indicesArray of indices for populations occupied at time step.
returnsList with transformed stage abundance matrix (and optionally carrying capacity).
A list of parameters, which must contain all of the below,
except name, which is optional:
replicatesNumber of replicate simulation runs.
time_stepsNumber of simulation time steps.
years_per_stepNumber of years per time step.
populationsNumber of populations.
seasonsNumber of seasons per year.
stagesNumber of life cycle stages.
compartmentsNumber of disease compartments (e.g., 3 for a SIR model).
demographic_stochasticityBoolean for optionally choosing demographic stochasticity for the transformation.
density_stagesArray of booleans or numeric (0,1) for each stage to indicate which stages are affected by density.
abundance_thresholdA quasi-extinction threshold at which a population becomes extinct.
mortalityA vector of mortality rates, one for each combination of stages and compartments.
mortality_unitA vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.
fecundityA vector of fecundity rates, one for each combination of stages and compartments for which fecundity applies.
fecundity_unitA vector indicating whether fecundity rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.
fecundity_maskA vector indicating which stages and compartments reproduce.
transmissionA vector of transmission rates, one for each
combination of stages and compartment for which transmission applies (see
transmission_mask below.
transmission_unitA vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.
transmission_maskA vector indicating which stages and compartments are subject to transmission (i.e., classes susceptible to infection.)
recoveryA vector of recovery rates, one for each
combination of stages and compartment for which recovery applies (see
recovery_mask below.)
recovery_unitA vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.
recovery_maskA vector indicating which compartments are subject to recovery (i.e., infected classes that can recover.)
transformationA user-defined function (optionally nested in a list
with additional attributes) for performing transformation using params as
arguments.
simulatorpoems::SimulatorReference object with
dynamically accessible attached and results lists.
nameOptional name for the transformation function.
additional attributesAdditional attributes when the transformation is optionally nested in a list.