get_NIW_categorization_function: Get NIW categorization function

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

get_NIW_categorization_functionR Documentation

Get NIW categorization function

Description

Returns a categorization function for the first category, based on a set of parameters for the Normal-Inverse-Wishart (NIW) distribution. ms, Ss, kappas, nus, and priors are assumed to be of the same length and sorted the same way, so that the first element of ms is corresponding to the same category as the first element of Ss, kappas, nus, and priors, etc.

Usage

get_NIW_categorization_function(
  ms,
  Ss,
  kappas,
  nus,
  priors = rep(1/length(ms), length(ms)),
  lapse_rate = 0,
  lapse_biases = rep(1/length(ms), length(ms)),
  Sigma_noise = NULL,
  noise_treatment = infer_default_noise_treatment(Sigma_noise),
  lapse_treatment = if (lapse_rate > 0) "marginalize" else "no_lapses"
)

get_categorization_function_from_NIW_ideal_adaptor(model, ...)

Arguments

ms

Means of the multivariate normal distributions over category means.

Ss

Scatter matrices of the inverse Wishart distribution over category covariance matrices.

kappas

Strength of the beliefs into the distribution over category means.

nus

Strength of the beliefs into the distribution over category covariance matrices.

priors

Vector of categories' prior probabilities. (default: uniform prior over categories)

lapse_rate

A lapse rate for the categorization responses.

lapse_biases

A lapse bias for the categorization responses. (default: uniform bias over categories)

Sigma_noise

A noise matrix. (default: a 0-matrix)

noise_treatment

How should the noise specified in Sigma_noise be considered in the categorization function? For details, see get_NIW_posterior_predictive. Note though that "sample" would likely result in rather counter-intuitive behavior of the categorization function and is thus not recommended.

lapse_treatment

Should the consequences of attentional lapses be included in the categorization function ("marginalize") or not ("no_lapses")? (default: "marginalize")

Value

A function that takes as input cue values and returns posterior probabilities of the first category, based on the posterior predictive of the cues given the (IBBU-derived parameters for the) categories' m, S, kappa, nu, and prior, as well as the lapse rate. The function will accept the following arguments:

  • 'target_category':The index of the category for which categorization should be shown. (default: '1')

  • 'logit':Should the function return log-odds (TRUE) or probabilities (FALSE)? (default: FALSE)

See Also

TBD


hlplab/MVBeliefUpdatr documentation built on July 5, 2025, 6:42 a.m.