Skip to contents

When 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.

Usage

get_posterior2(object, posterior)

Arguments

object

A list object. The AD (automatic differentiation) object created using TMB::MakeADFun, containing the model structure and report function.

posterior

An rstan object created using the tmbstan function, containing MCMC samples from the posterior distribution.

Value

A list of data.frame objects, one for each of the following quantities: lp_lf, lp_af, lp_cpue, lp_tags, lp_aerial, cpue_pred, cpue_resid, aerial_pred, aerial_resid, troll_pred, troll_resid, tag_pred, tag_resid, lf_pred, af_pred, M_a, and spawning_biomass_y.