get_expected_category_statistic_from_stanfit: Get expected category mean mu or covariance matrix sigma

View source: R/get-info-from-NIW-IA-stanfit.R

get_expected_category_statistic_from_stanfitR Documentation

Get expected category mean mu or covariance matrix sigma

Description

Returns the expected value of posterior marginal distribution over category means mu and/or category covariance matrix Sigma, marginalized over all MCMC samples.

Usage

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, ...)

Arguments

x

An mv_ibbu_stanfit object.

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')

Details

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

Value

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.

References

\insertRef

murphy2012MVBeliefUpdatr

See Also

TBD


hlplab/MVBeliefUpdatr documentation built on March 29, 2025, 10:42 p.m.