disease_transformation {epizootic}R Documentation

Nested functions for a user-defined transformation of a population affected by a disease outbreak.

Description

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.

Usage

disease_transformation(params)

Arguments

params

A list of parameters, which must contain all of the below, except name, which is optional:

replicates

Number of replicate simulation runs.

time_steps

Number of simulation time steps.

years_per_step

Number of years per time step.

populations

Number of populations.

seasons

Number of seasons per year.

stages

Number of life cycle stages.

compartments

Number of disease compartments (e.g., 3 for a SIR model).

demographic_stochasticity

Boolean for optionally choosing demographic stochasticity for the transformation.

density_stages

Array of booleans or numeric (0,1) for each stage to indicate which stages are affected by density.

abundance_threshold

A quasi-extinction threshold at which a population becomes extinct.

mortality

A vector of mortality rates, one for each combination of stages and compartments.

mortality_unit

A vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.

fecundity

A vector of fecundity rates, one for each combination of stages and compartments for which fecundity applies.

fecundity_unit

A vector indicating whether fecundity rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.

fecundity_mask

A vector indicating which stages and compartments reproduce.

transmission

A vector of transmission rates, one for each combination of stages and compartment for which transmission applies (see transmission_mask below.

transmission_unit

A vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.

transmission_mask

A vector indicating which stages and compartments are subject to transmission (i.e., classes susceptible to infection.)

recovery

A vector of recovery rates, one for each combination of stages and compartment for which recovery applies (see recovery_mask below.)

recovery_unit

A vector indicating whether mortality rates are daily or seasonal. 1 indicates seasonal, 0 indicates daily.

recovery_mask

A vector indicating which compartments are subject to recovery (i.e., infected classes that can recover.)

transformation

A user-defined function (optionally nested in a list with additional attributes) for performing transformation using params as arguments.

simulator

poems::SimulatorReference object with dynamically accessible attached and results lists.

name

Optional name for the transformation function.

additional attributes

Additional attributes when the transformation is optionally nested in a list.

Value

Abundance (and capacity) transformation function: function(r, tm, carrying_capacity, segment_abundance, occupied_indices), where:

r

Simulation replicate.

tm

Simulation time step.

carrying_capacity

Array of carrying capacity values for each population at time step.

segment_abundance

Matrix of abundance for each stage-compartment combo (rows) and population (columns) at time step.

occupied_indices

Array of indices for populations occupied at time step.

returns

List with transformed stage abundance matrix (and optionally carrying capacity).


[Package epizootic version 1.0.0 Index]