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 = function(x, y) {
     j <- 2
     k <- 1
     distance <- (x - y)^j
    
    similarity <- exp(-distance * k)
 },
  verbose = F
)

make_exemplar_model_from_data(
  data,
  group = NULL,
  category = "category",
  cues,
  sim_function = function(x, y) {
     j <- 2
     k <- 1
     distance <- (x - y)^j
    
    similarity <- exp(-distance * k)
 },
  ...,
  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-examplar similarity. Defaults to exp(-(x - y)^2).

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.

See Also

TBD


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