get_categorization_from_exemplar_model: Get categorization from an exemplar model

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

get_categorization_from_exemplar_modelR Documentation

Get categorization from an exemplar model

Description

Categorize a single observation based on an exemplar model. The decision rule can be specified to be either the criterion choice rule, proportional matching (Luce's choice rule), or the sampling-based interpretation of Luce's choice rule.

Usage

get_categorization_from_exemplar_model(
  x,
  model,
  decision_rule,
  noise_treatment = if (decision_rule == "sampling") "sample" else "marginalize",
  lapse_treatment = if (decision_rule == "sampling") "sample" else "marginalize",
  simplify = F
)

Arguments

x

A vector of observations.

model

An exemplar_model object.

decision_rule

Must be one of "criterion", "proportional", or "sampling".

noise_treatment

Determines whether and how multivariate Gaussian noise is considered during categorization. See get_likelihood_from_exemplars. (default: "sample" if decision_rule is "sample"; "marginalize" otherwise).

lapse_treatment

Determines whether and how lapses will be treated. Can be "no_lapses", "sample" or "marginalize". If "sample", whether a trial is lapsing or not will be sampled for each observations. If a trial is sampled to be a lapsing trial the lapse biases are used as the posterior for that trial. If "marginalize", the posterior probability will be adjusted based on the lapse formula lapse_rate * lapse_bias + (1 - lapse_rate) * posterior probability from perceptual model. (default: "sample" if decision_rule is "sample"; "marginalize" otherwise).

simplify

Should the output be simplified, and just the label of the selected category be returned? This option is only available for the criterion and sampling decision rules. (default: 'FALSE')

Value

Either a tibble of observations with posterior probabilities for each category (in long format), or a character vector indicating the chosen category in the same order as the observations in x (if simplify = 'TRUE').

See Also

TBD


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