Simulate multiple data sets
Usage
sim.cs.multi(
nclus = 10,
lambdas = c(0.05, 0.1, 0.15, 0.2, 0.3),
num_cores = max(1, parallel::detectCores() - 1),
rng_seed = 1234,
renew.params = TRUE,
add.noise = TRUE,
verbose = FALSE,
...
)Arguments
- nclus
number of clusters
- lambdas
#incidence rate, in events/person*year
- num_cores
number of cores to use for parallel computations
- rng_seed
starting seed for random number generator, passed to
rngtools::RNGseq()- renew.params
whether to generate a new parameter set for each infection
renew.params = TRUEgenerates a new parameter set for each infectionrenew.params = FALSEkeeps the one selected at birth, but updates baseline y0
- add.noise
a
logical()indicating whether to add biological and measurement noise- verbose
whether to report verbose information
- ...
Arguments passed on to
sim.cslambdaa
numeric()scalar indicating the incidence rate (in events per person-years)n.smplnumber of samples to simulate
age.rngage range of sampled individuals, in years
age.fxspecify the curve parameters to use by age (does nothing at present?)
antigen_isosCharacter vector with one or more antibody names. Values must match
curve_params.n.mchow many MCMC samples to use:
when
n.mcis in1:4000a fixed posterior sample is usedwhen
n.mc=0, a random sample is chosen
noise_limitsbiologic noise distribution parameters
formata
character()variable, containing either:"long"(one measurement per row) or"wide"(one serum sample per row)
curve_paramsa
data.frame()containing MCMC samples of parameters from the Bayesian posterior distribution of a longitudinal decay curve model. The parameter columns must be named:antigen_iso: acharacter()vector indicating antigen-isotype combinationsiter: aninteger()vector indicating MCMC sampling iterationsy0: baseline antibody level at $t=0$ ($y(t=0)$)y1: antibody peak level (ELISA units)t1: duration of infectionalpha: antibody decay rate (1/days for the current longitudinal parameter sets)r: shape factor of antibody decay