get_NIW_posterior_predictive: Get posterior predictive

View source: R/get-info-from-NIW-belief.R

get_NIW_posterior_predictiveR Documentation

Get posterior predictive

Description

Get posterior predictive of observations x given the NIW parameters m, S, kappa, and nu. This is the density of a multivariate Student-T distribution \insertCite@see @murphy2012 p. 134MVBeliefUpdatr.

Usage

get_NIW_posterior_predictive(
  x,
  m,
  S,
  kappa,
  nu,
  Sigma_noise = NULL,
  noise_treatment = if (is.null(Sigma_noise)) "no_noise" else "marginalize",
  log = T
)

get_NIW_posterior_predictive.pmap(x, m, S, kappa, nu, ...)

get_posterior_predictive_from_NIW_belief(
  x,
  model,
  noise_treatment = if (is.NIW_ideal_adaptor(model)) {
     if
    (!is.null(first(model$Sigma_noise))) 
         "marginalize"
     else "no_noise"
 }
    else "no_noise",
  log = T,
  category = "category",
  category.label = NULL,
  wide = FALSE
)

Arguments

x

Observation(s). Can be a vector with k elements for a single observation or a matrix with k columns and n rows, in which case each row of the matrix is taken to be one observation. If x is a tibble with k columns or a list of vectors of length k, it is reduced into a matrix with k columns.

m

The mean of the multivariate Normal distribution of the category mean mu. Should be a matrix or vector of length k.

S

The scatter matrix of the inverse-Wishart distribution over the category covariance matrix Sigma. Should be a square k x k matrix.

kappa

The strength of the beliefs over the category mean (pseudocounts).

nu

The strength of the beliefs over the category covariance matrix (pseudocounts).

Sigma_noise

Optionally, a covariance matrix describing the perceptual noise to be applied while calculating the posterior predictive. (default: 'NULL')

noise_treatment

Determines whether perceptual noise is considered during categorization, and how. Can be "no_noise", "sample", or "marginalize". If "no_noise", no noise will be applied to the input, and no noise will be assumed during categorization. If "marginalize", average noise (i.e., no noise) will be added to the stimulus, and 'Sigma_noise' is added to Sigma when calculating the likelihood. This simulates the expected consequences for perceptual noise on categorization *in the limit*, i.e, if the input was categorized infinitely many times. If "sample", then noise is sampled and applied to the input, and 'Sigma_noise' is added to Sigma when calculating the likelihood. This simulates the consequence of perceptual noise *on a particular observation*. If "sample" or "marginalize" are chosen, 'Sigma_noise' must be a covariance matrix of appropriate dimensions. (default: "no_noise" if Sigma_noise is NULL, "marginalize" otherwise).

log

Should the log-transformed density be returned ('TRUE')? (default: 'TRUE')

References

\insertRef

murphy2012MVBeliefUpdatr

See Also

TBD


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