run_simulations: Runs multiple simulations for infection time by ID

Description Usage Arguments Value

Description

This function takes data of multiple subjects with repeated exposure data and runs mulitple stochastic simulations estimating infection time The simulation function (written in cpp) slowly crawls through all time points, the infection times are mapped to sample times after use TBD.

Usage

1
2
3
run_simulations(nsims = 100, raw_exposure_data, raw_sample_times,
  exposure_rate, hazard_risk, clr = 2, lag = 0, return_KM = F,
  parallel = F)

Arguments

raw_exposure_data

The data.frame time containing series of all possible exposures (must include a day and count name) for all subjects (FamilyID)

raw_sample_times

The sampling days that infection would actually be observed for each subject

exposure_rate

The rate of exposures to be sampled from raw_exposure_data

hazard_risk

The per time hazard risk for the hazard function

clr

The exponential pathogen clearance rate

lag

The minimum amount of time between infection and when it could be detected (lag = 0 means infection is instantly detectable)

return_KM

return the Kaplan-Meier estimates from all the runs (if false, just returns raw data)

parallel,

Use parallel computation for simulations across nsim

nsim

The amount of simulations to run

Value

Either a data.frame of infection time simulations for each family matched to sample times or a Kaplan-Meier object


bryanmayer/multdr documentation built on May 13, 2019, 8:11 a.m.