make_MVG_from_data: Make multivariate Gaussian ideal observer(s) from data.

View source: R/make-objects.R

make_MVG_from_dataR Documentation

Make multivariate Gaussian ideal observer(s) from data.

Description

Constructs an MVG or MVG_ideal_observer object with category information for all categories found in the data. Currently, this functions does nothing fancy. It simply gets the mean and covariance matrix of the cues for each category and group from the data. No cross-validation or other measures against overfitting are implemented, though it is recommended that such methods are applied.

Usage

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

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

Arguments

data

The tibble or data.frame from which to construct the MVG or MVG ideal observer object.

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.

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)

Details

Alternative approaches include the use of 'brms::brm()' to fit a multivariate Normal model to the data. While this approach allows fitting of both the means and variances of each category (including for hierarchically organized grouped data), it currently does not provide a way to model category-specific correlations (or covariances) between cues. Instead, the approach implemented in 'brms' only models correlation at the population-level (residual correlations).

Yet another alternative would be to write a separate 'Stan' program specifically for this purpose. However, while this is relatively straightforward for data from a single talker, a hierarchical model for grouped data essentially requires an extension of the multivariate model approach implemented in 'brms' and described in the preceding paragraph.

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.