View source: R/get-info-from-NIW-IA-stanfit.R
get_expected_category_statistic_from_stanfit | R Documentation |
Returns the expected value of posterior marginal distribution over category means mu and/or category covariance matrix Sigma, marginalized over all MCMC samples.
get_expected_category_statistic_from_stanfit(
x,
categories = get_category_levels_from_stanfit(x),
groups = get_group_levels_from_stanfit(x, include_prior = TRUE),
statistic = c("mu", "Sigma"),
untransform_cues = TRUE
)
get_expected_mu_from_stanfit(x, ...)
get_expected_sigma_from_stanfit(x, ...)
x |
An |
categories |
Character vector with categories for which category statistics are to be returned. (default: all categories) |
groups |
Character vector with groups for which category statistics are to be returned. (default: all groups) |
statistic |
Which category statistic should be returned? 'mu' for category mean or 'Sigma' for category covariance matrix, or 'c("mu", "Sigma")' for both. (default: both) |
untransform_cues |
Should m_0 and S_0 be transformed back into the original cue space? (default: 'TRUE') |
Each MCMC samples' expected value for the category mean E[mu] = m_n
(i.e, the posterior/updated mean of the multivariate Normal over category means mu
).
Marginalizing across all MCMC samples (representing uncertainty in the true value of
m_n
), we get E[E[mu]] = mean(m_n)
.
Each MCMC samples' expected value for the category covariance matrix
E[Sigma] = S_n / (nu_n - D - 1)
, where S_n
is the posterior/updated scatter matrix,
nu_n
is the posterior/updated pseudocount representing the strength of the posterior/updated
beliefs over category covariance matrices sigma (i.e., the inverse-Wishart), and D
is
the dimension of the multivariate Normal. Marginalizing across all MCMC samples
(representing uncertainty in the true value of S_n
), we get
E[E[Sigma]] = mean(S_n / (nu_n - D - 1))
.
If just one group and category was requested, a vector (for the mean) or matrix (for the covariance matrix). If more than one group or category was requested, a tibble with one row for each unique combination of group and category.
murphy2012MVBeliefUpdatr
TBD
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.