get_likelihood_from_exemplars: Get likelihood

View source: R/get-info-from-exemplar-model.R

get_likelihood_from_exemplarsR Documentation

Get likelihood

Description

Get likelihood of observation(s) x given the exemplar model.

Usage

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

Arguments

x

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

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

See Also

TBD


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