
Simulate new responses from a fitted gllvmTMB_multi
Source: R/methods-gllvmTMB.R
simulate.gllvmTMB_multi.RdConditional on the fitted parameters and posterior modes of the random
effects, draws nsim new response vectors. Each draw uses the same
linear predictor (fit$report$eta) and adds Gaussian residual noise
with sd = exp(log_sigma_eps).
Usage
# S3 method for class 'gllvmTMB_multi'
simulate(
object,
nsim = 1,
seed = NULL,
newdata = NULL,
condition_on_RE = FALSE,
...
)Arguments
- object
A
gllvmTMB_multifit.- nsim
Number of replicate response vectors to draw. Default 1.
- seed
Optional RNG seed.
- newdata
Optional new data frame; if supplied, predictions are computed at
newdataand noise is drawn around them. The newdata must contain enough columns to rebuild the fixed-effects design and any random-effect grouping that was active.- condition_on_RE
Logical (default
FALSE). WhenFALSE(the default), random effects are redrawn from the fitted covariance at every tier (rr_B,diag_B,rr_W,diag_W,phylo,spde) — the unconditional simulation appropriate for parametric bootstrap. WhenTRUE, the existing fitted RE modes are reused (the older glmmTMB-style conditional simulation that only adds Gaussian noise on top offit$report$eta). Forced toTRUEwhennewdatais supplied (RE modes for unseen levels cannot be redrawn).- ...
Currently unused.