Description Usage Arguments Value
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.
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)
|
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 |
Either a data.frame of infection time simulations for each family matched to sample times or a Kaplan-Meier object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.