make_exemplars_from_data: Make exemplar models from data.

View source: R/make-objects.R

make_exemplars_from_dataR Documentation

Make exemplar models from data.

Description

Constructs an exemplar model for all categories found in the data.

Usage

make_exemplars_from_data(
  data,
  group = NULL,
  category = "category",
  cues,
  sim_function = NULL,
  verbose = F
)

make_exemplar_model_from_data(
  data,
  group = NULL,
  category = "category",
  cues,
  sim_function = NULL,
  ...,
  verbose = F
)

Arguments

data

The tibble or data.frame from which to construct the exemplar model.

group

Optionally, a vector of one or more grouping variables. If group is not NULL, one MVG or ideal observers will be derived for each level of group. (default: 'NULL')

category

Name of variable in data that contains the category information. (default: "category")

cues

Name(s) of variables in data that contain the cue information.

sim_function

Similarity function that is used to calculate exemplar-to-exemplar similarity. If NULL, defaults to function(x, y, weights = w, distance_metric = 2, distance_decay_factor = 1) distance <- sum(weights * abs(x - y)^distance_metric)^(1/distance_metric); similarity <- exp(-distance^distance_decay_factor), where each cue's weight w is the inverse of the cues SD^distance_metric. Except for the setting of the weights, this general formula follows \insertCiteapfelbaum-mcmurray2015MVBeliefUpdatr, who cite \insertCitenosofsky1986MVBeliefUpdatr.

verbose

If true provides more information. (default: 'FALSE')

prior

Optionally specify a prior probability for each category (in each group). (default: a uniform prior over all categories).

lapse_rate

Optionally specify a lapse rate. (default: 'NA')

lapse_bias

Optionally specify a lapse bias. (default: 'NA')

Sigma_noise

Optionally specify a (multivariate Gaussian) covariance matrix of perceptual noise. This argument will be ignored if NULL. (default: 'NULL')

Value

A tibble that is an MVG or MVG ideal observer object.

References

\insertAllCited

See Also

TBD


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