View source: R/get-info-from-NIW-IA-stanfit.R
add_ibbu_stanfit_draws | R Documentation |
Add MCMC draws of all parameters from incremental Bayesian belief-updating (IBBU) to a tibble. Both wide ('wide=TRUE') or long format ('wide=FALSE') can be chosen as output. By default all post-warmup draws are returned, but if 'summarize=TRUE' then just the mean of each parameter is returned instead.
add_ibbu_stanfit_draws(
fit,
categories = get_category_levels_from_stanfit(fit),
groups = get_group_levels_from_stanfit(fit, include_prior = TRUE),
which = if ("prior" %in% groups) {
if (length(groups) > 1)
"both"
else "prior"
} else "posterior",
ndraws = NULL,
untransform_cues = TRUE,
summarize = FALSE,
wide = FALSE,
nest = TRUE,
seed = if (!is.null(ndraws)) runif(1, -1e+06, 1e+06) else NULL
)
fit |
|
categories |
Character vector of categories for which draws are to be returned. (default: all categories) |
groups |
Character vector of groups for which draws are to be returned. (default: all groups) |
which |
DEPRECATED. Use 'groups' instead. Should parameters for the prior, posterior, or both be added? (default: '"posterior"') |
ndraws |
Number of random draws or 'NULL' if all draws are to be returned. Only 'draws' or 'ndraws' should be non-zero. (default: 'NULL') |
untransform_cues |
Should m_0 and S_0 be transformed back into the original cue space? (default: 'TRUE') |
summarize |
Should the mean of the draws be returned instead of all of the draws? (default: 'FALSE') |
wide |
Should all parameters be returned in one row? (default: 'FALSE') |
nest |
Should the category mean vectors and scatter matrices be nested into one cell each, or should each element be stored in a separate cell? (default: 'TRUE') |
seed |
A seed to use when subsampling draws (i.e. when ndraws is not NULL). |
By default, the category means and scatter matrices are nested, rather than each of their elements being stored separately ('nest=TRUE').
tibble with post-warmup (posterior) MCMC draws of the prior/posterior parameters of the IBBU model
(kappa, nu, m, S, lapse_rate
). kappa
and nu
are the pseudocounts that determine the strength of the beliefs
into the mean and covariance matrix, respectively. m
is the mean of the multivariate normal distribution over category
means mu. S
is the scatter matrix that determines both the covariance of the category means mu, and the
Inverse Wishart distribution over category covariance matrices Sigma.
The expected value of the category mean mu is m
. The expected value of the category covariance matrix Sigma
is S / (nu - D - 1)
, where D
is the dimension of the multivariate Gaussian category. For details,
\insertCite@see @murphy2012 p. 134;textualMVBeliefUpdatr.
murphy2012MVBeliefUpdatr
TBD
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.