The stats::simulate() method for CEATTLE fits: draws nsim
replicate data sets from the fitted observation model, and optionally from
the process model as well.
Usage
# S3 method for class 'Rceattle'
simulate(object, nsim = 1, seed = NULL, process = FALSE, ...)Arguments
- object
An object of class
"Rceattle"returned byfit_mod().- nsim
Number of replicate data sets to draw. Default 1.
- seed
Optional seed. The caller's random state is restored afterwards, per
stats::simulate(). Recorded asattr(, "seed").- process
Which process error to redraw alongside the observations.
FALSE(default) keeps the fitted deviations, so replicates differ only in observation error. Seesim_mod()for the alternatives.- ...
Currently unused.
Value
A list of nsim data_list objects, always a list, including at
nsim = 1, so callers do not have to special-case the length. When
process redrew something, each element holds the deviations that
generated it as attr(, "process_sim"): a named list of whichever of
rec_dev, init_dev, log_M1_dev and beta_linkage_re were drawn, each
with a _drawn logical of the same shape marking the cells the draw
touched. Compare estimates against those rather than against object,
see sim_mod().
Details
A wrapper on sim_mod(), which documents the observation model in full. For
expected values rather than draws, call sim_mod(simulate = FALSE).
Draws are taken by the TMB model, so simulate() needs a live $obj: a
model loaded from disk has one, a model_average() result does not, see
sim_mod().
See also
sim_mod() for the observation model and the process options,
self_test() for simulating and refitting in one step.