MVBeliefUpdatr-package | R Documentation |
A package to model and visualize incremental Bayesian categorization and belief-updating for multivariate Gaussian categories.
This package provides convenience functions to model Bayesian ideal observers with multivariate Gaussian categories and incremental Bayesian belief-updating for multivariate Gaussian categories. This includes conjugate belief-updating from a Normal-Inverse-Wishart (NIW) prior based on exposure data. Users can specify priors manually or based on existing data, prepare exposure data, update NIW beliefs under a variety of assumptions (noise-free, noise added, etc.) both for labeled and unlabeled exposure data. Expected categories, categorization functions, and categorizations under various decisions rules (e.g., criterion, proportional matching, sampling) can be obtained and visualized.
Additionally, the package provides a number of Stan programs that try to infer NIW priors for multiple categories from behavioral test responses. These functions use participants' categorization responses during test and, for example, the sufficient statistics of the exposure data to infer a posterior distribution of the parameters of NIW priors for each category. Users can either infer the strength of prior beliefs given a specified m and S parameter, or infer all four NIW parameters together, although the latter requires test responses from multiple different exposure conditions. Functions are provided to interact with stan through rstan, to (1) prepare data as input for the stan program that implements the multivariate Bayesian belief-updating, and to (2) to summarize and visualize the prior and posterior beliefs represented by the resulting fit.
The package defines a number of new classes that are essentially tibbles with certain information.
MVG
: one or more multivariate Gaussian categories, by default in long format with one category per row.
Each row contains the mean mu and covariance matrix Sigma of the multivariate Gaussian.
MVG_ideal_observer
: an ideal observer with multivariate Gaussian categories, by default in long format
with one category per row. In addition to the Gaussian categories the ideal observer contains the prior probability of
each category and, optionally, a lapse rate, lapse bias, and/or perceptual noise matrix.
NIW_belief
: one or more Normal-Inverse-Wishart beliefs, by default in long format with one belief per row.
A Normal-Inverse-Wishart belief specifies *uncertainty* about the about the location (i.e., mean mu) and shape (i.e.,
covariance matrix Sigma) of a multivariate Gaussian. It does so in a specific way that makes assumptions about the
way that the covariance of cues within a category relates to the covariance of the category means across contexts (e.g.,
talkers). See the documentation for details.
NIW_ideal_adaptor
: an ideal adaptor with Normal-Inverse-Wishart beliefs, by default in long format with
one row each for each belief. In addition to the Normal-Inverse-Wishart beliefs, the ideal adaptor contains the prior
probability of each category (currently without uncertainty about those prior probabilities) and, optionally, a lapse
rate, lapse bias, and/or perceptual noise matrix.
NIW_ideal_adaptor_MCMC
: a collection of MCMC samples, each of which constitutes an NIW ideal adaptor. In
other words, this object describes uncertainty about the parameters of the NIW ideal adaptor (specifically, in the
current implementation about the NIW beliefs and the lapse rate and lapse bias, but not yet about the category priors). This is
used, for example, to represent the researchers uncertainty about the prior or posterior beliefs of an ideal adaptor.
NIW_ideal_adaptor_stanfit
: The stanfit resulting from inferring an NIW_ideal_adaptor
from a collection
of exposure and test data. This object contains an NIW_ideal_adaptor_MCMC
object.
The belief-updating formulas are taken from Murphy (2012). The package incorporates code from Dave Kleinschmidt's BeliefUpdatr (Kleinschmidt and Jaeger, 2011, 2012, 2015, 2016) and Shaorong Yan's modeling of unsupervised adaptation (Yan and Jaeger, 2018). Pull requests and suggestions from Zach Burchill, Anna Persson, and Xin Xie are gratefully acknowledged.
TBD
Maintainer: T. Florian Jaeger fjaeger@ur.rochester.edu (ORCID)
TBD
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.