
Parametric Monte Carlo draws from a TMB fit's asymptotic posterior
Source:R/tmb-parametric-draws.R
dot-tmb_parametric_draws.RdDraws R samples of the internal-scale fixed-effect parameter vector from
the joint asymptotic Gaussian posterior \(N(\hat\beta, \hat\Sigma)\), where
\(\hat\beta\) is object$model$coefficients and \(\hat\Sigma\) is
vcov(object) (the TMB sdreport fixed-effect covariance,
sdr$cov.fixed). The mean vector and covariance are positionally
aligned because both derive from the optimizer's opt$par.
Value
Numeric matrix of dimension R x p, with columns named after
the internal coefficient vector (names(object$model$coefficients)).
Details
This is the shared primitive behind
confint(object, method = "simulate") and is intended for reuse by
derived-metric bootstrap helpers. Draws are fixed-effect-only on the internal
scale; callers transform to the natural scale or evaluate derived metrics as
needed.
The symmetric matrix square root is formed via an eigendecomposition with
negative eigenvalues clamped to zero, matching MASS::mvrnorm's
robustness to a near-semidefinite covariance without taking a dependency.