simrabid: Simulate a spatially-explicit, individual-based model of...

Description Usage Arguments Value

View source: R/simulate.R

Description

This function simulates the rabies IBM at the specified scale. Inputs much match between the setup_sim and setup_space functions in terms of the space and timesteps being simulated.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
simrabid(
  start_up,
  start_vacc,
  I_seeds,
  vacc_dt,
  params = c(list(R0 = 1.2, k = 1, iota = 4), param_defaults),
  days_in_step = 7,
  observe_fun = beta_detect_monthly,
  serial_fun = serial_lognorm,
  dispersal_fun = steps_weibull,
  secondary_fun = nbinom_constrained,
  incursion_fun = sim_incursions_pois,
  movement_fun = sim_movement_continuous,
  sequential = TRUE,
  allow_invalid = TRUE,
  leave_bounds = TRUE,
  max_tries = 100,
  summary_fun = return_env,
  track = TRUE,
  weights = NULL,
  row_probs = NULL,
  coverage = FALSE,
  break_threshold = 0.8,
  by_admin = FALSE,
  extra_pars = NULL,
  routine_vacc = 0
)

Arguments

start_up

objects for start up generated setup_sim

start_vacc

numeric vector 0, 1, starting proportion vaccinated either length 1 or length of cells being tracked

I_seeds

integer, initial number of infections to seed randomly

vacc_dt

data.table with three columns: vacc_times (the timestep of vaccination, should correspond to the same timesteps as being simulated), vacc_ests (either coverage or number vaccinated), and vacc_locs (the location id corresponding to the shapefile)

params

parameter list, should include all parameters for simulation functions (i.e. serial_, dispersal_, secondary_, incursion_, etc.)

days_in_step

integer, the number of days in each time step being simulated (i.e. 7 for weekly, 1 for daily)

observe_fun

function for simulating observation/detection, should take two parameters: I_dt (the line list of cases generated in simrabid) and params (the list of params that will be passed through the param)

serial_fun

function for drawing the serial interval between cases

dispersal_fun

function for drawing the dispersal distance/step length

secondary_fun

function for generating secondary cases

incursion_fun

function for seeding incursions

movement_fun

function for simulating movement, current options are sim_movement_continuous and sim_movement_prob

sequential

boolean, whether movements should be sequential or drawn as a kernel

allow_invalid

boolean, whether movements to invalid locations should be kept or movements should be resampled (i.e. then transmission events can fail due to movement into an unihabited patch

leave_bounds

boolean, whether movements to locations outside the bounds of the area being simulated should be kept or those movements should be resampled (i.e. transmission events can fail due to movement outside of the district

max_tries

the maximum number of times to resample invalid movements if either or both allow_invalid and leave_bounds is false.

summary_fun

function for summarizing simulation, should take two parameters a character vector of object names from the simrabid environment that you need for use in the function.

track

boolean, whether to track failed transmission events in the line list of cases (I_dt), i.e. invalid movements, contacts with V/E/I individuals

weights

numeric vector of the length of the number of cells (both tracked and untracked) in the raster being simulated (for use with sim_movement_prob

row_probs

numeric vector of the length of the number of tracked cells for allocating vaccinations by (i.e. if you except vaccinations to be more likely in certain grid cells vs. others)

coverage

boolean, are the vaccination estimates number of individuals (FALSE) or the proportion vaccinated (TRUE)

break_threshold

numeric 0, 1, whether to cut-off the simulation if population declines to below this threshold (to stop run-away simulations)

by_admin

boolean, whether simulation is being aggregated to the grid cell or administrative (or arbitrary unit) based on the shapefile

extra_pars

list, additional parameters that you might need for the summary or any other custom functions

routine_vacc

proportion of new born dogs vaccinated, defaults to zero

Value

output from function passed to summary_fun


mrajeev08/simrabid documentation built on May 7, 2021, 11:47 a.m.