
Obtain samples from the posterior distribution of reported quantities
Source:R/get-posterior.R
get_posterior2.RdWhen samples from the posterior distribution are obtained using tmbstan,
only the model parameters can be accessed directly from the stanfit
object (i.e., derived quantities such as par_B0 or M_a cannot be accessed
directly). Accessing derived quantities must be done using this function.
This function extracts a predefined set of model diagnostics and predictions.
Arguments
- object
A
listobject. The AD (automatic differentiation) object created usingTMB::MakeADFun, containing the model structure and report function.- posterior
An
rstanobject created using thetmbstanfunction, containing MCMC samples from the posterior distribution.