-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rausch
authored and
Rausch
committed
Dec 2, 2024
1 parent
0513393
commit 0d3f7d3
Showing
7 changed files
with
268 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#' Bayesian Model Comparison | ||
|
||
#' \code{compareBayes} performs a Bayesian model comparison based on marginal | ||
#' likelihoods (alias model evidence), given for different models across different | ||
#' subject on a group level using a fixed effects model and a random effects model | ||
#' on the distribution of model probabilities (see Rigoux at al., 2014; Daunizeau et al., 2014) | ||
#' `compareBayes` can be used with the output of \code{\link{fitConfModels}}, i.e. a data frame with information | ||
#' criteria for different models and subjects, using a information criterion to | ||
#' approximate the model evidence. | ||
#' \code{summaryCompareBayes} p | ||
#' | ||
|
||
#' @param fits a data frame as returned by \code{\link{fitRTConfModels}}. | ||
#' Should contain a column `model`indicating the model name, a column | ||
#' `subject` (alternatively `sbj` or `participant`) indicating the grouping | ||
#' structure of the data, and a column with the name given by the `measure` | ||
#' argument containing the values of the information criterion that should be | ||
#' used to approximate model evidence. | ||
#' @param measure the name of the column indicating the information criterion | ||
#' to approximate model evidence. For outputs of \code{\link{fitRTConfModels}}, | ||
#' the available measures are 'BIC', 'AIC', and 'AICc'. Any other approximation | ||
#' for the model evidence may be used, the measure is transferred to log model | ||
#' evidence by taking -measure/2. | ||
#' @param opts a list with options for the iteration algorithm to estimate | ||
#' the parameter of the Dirichlet distribution. Following values may be provided: | ||
#' * \code{maxiter} the maximum number of iterations (Default: 200) | ||
#' * \code{tol} the tolerance for changes in the free energy approximation | ||
#' to stop the algorithm, if abs(FE(i+1)-FE(i))<tol the algorithm | ||
#' is stopped (Default: 1e-4) | ||
#' * \code{eps} The number to substitute values of 0 in calls to log (Default: 1e-32) | ||
#' | ||
#' #' @return a matrix with rows for each model (row names indicate the | ||
#' model names for `group_BMS_fits` and for `group_BMS` if | ||
#' row names are available in `mlp`), and following columns: | ||
#' `alpha` (the alpha parameter of the Dirichlet posterior | ||
#' over model probabilities in the population), `r` (the | ||
#' mean probabilities of each model in the population), `ep` | ||
#' and `pep` (exceedance and protected exceedance | ||
#' probabilities for each model), and `fx_prop` (the | ||
#' posterior model probabilities if a fixed true model is | ||
#' assumed in the population). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,7 @@ gitbranch <- "main/" | |
|
||
The `statConfR` package provides functions to fit static models of | ||
decision-making and confidence derived from signal detection theory for | ||
binary discrimination tasks, meta-d′/d′, the most prominent measure of metacognitive efficiency, | ||
meta-I, an information-theoretic measures of metacognitive sensitivity, | ||
as well as $meta-I_{1}^{r}$ and $meta-I_{2}^{r}$, two information-theoretic measures of metacognitive efficiency. | ||
|
||
Fitting models of confidence can be used to test the assumptions underlying | ||
meta-d′/d′. Several static models of decision-making and confidence include a metacognition parameter that may | ||
serve as an alternative when the assumptions of meta-d′/d′ assuming the | ||
corresponding model provides a better fit to the data. The following models are included: | ||
binary discrimination tasks. Up to now, the following models have been included: | ||
|
||
- signal detection rating model (Green & Swets, 1966), | ||
- Gaussian noise model (Maniscalco & Lau, 2016), | ||
|
@@ -38,6 +31,18 @@ corresponding model provides a better fit to the data. The following models are | |
- lognormal noise model (Shekhar & Rahnev, 2021), and | ||
- lognormal weighted evidence and visibility model (Shekhar & Rahnev, 2023). | ||
|
||
Bayesian model selection on the group level is performed using a fixed effects model (i.e. assuming that data from each subject was caused by the same generative model) and a and a Dirichelet random-effects model (which assumes that different generative models may cause the data from different subjects), as proposed by Rigoux et al. (2014) and Daunizeau et al. (2014). | ||
|
||
In addition, the `statConfR` package provides functions for estimating different | ||
kinds of measures of metacognition: | ||
- meta-d$^\prime$/d$^\prime$, the most widely-used measure of metacognitive efficiency, allowing both Maniscalco and Lau (2012)'s and Fleming (2017)'s model specification. Fitting models of confidence is a way to test the assumptions underlying meta-d′/d′. | ||
- Information-theoretic measures of metacognition (Dayan, 2023), including | ||
- meta-I, an information-theoretic measures of metacognitive sensitivity, | ||
- $meta-I_{1}^{r}$ and $meta-I_{2}^{r}$, two measures of metacognitive efficiency proposed by Dayan (2023), | ||
- RMI, a novel measure of metacognitive accuracy, also derived from information theory. | ||
|
||
|
||
|
||
## Mathematical description of implemented models of confidence | ||
The models included in the statConfR package are all based on signal detection theory (Green & Swets, 1966). | ||
It is assumed that participants select a binary discrimination response $R$ about a stimulus $S$. | ||
|
@@ -332,6 +337,7 @@ or [sebastian.hellmann\@ku.de](mailto:[email protected]) | |
or [submit an issue](https://github.com/ManuelRausch/StatConfR/issues). | ||
|
||
## References | ||
- Daunizeau, J., Adam, V., & Rigoux, L. (2014). Vba: A probabilistic treatment of nonlinear models for neurobiological and behavioural data. \emph{PLOS Computational Biology}, 10(1), e1003441. https://doi.org/10.1371/journal.pcbi.1003441 | ||
- Dayan, P. (2023). Metacognitive Information Theory. Open Mind, 7, 392–411. https://doi.org/10.1162/opmi_a_00091 | ||
- Fleming, S. M. (2017). HMeta-d: Hierarchical Bayesian estimation of metacognitive efficiency from confidence ratings. Neuroscience of Consciousness, 1, 1–14. https://doi.org/10.1093/nc/nix007 | ||
- Green, D. M., & Swets, J. A. (1966). Signal detection theory and psychophysics. Wiley. | ||
|
@@ -342,6 +348,7 @@ or [submit an issue](https://github.com/ManuelRausch/StatConfR/issues). | |
- Palminteri, S., Wyart, V., & Koechlin, E. (2017). The importance of falsification in computational cognitive modeling. Trends in Cognitive Sciences, 21(6), 425–433. https://doi.org/10.1016/j.tics.2017.03.011 | ||
- Rausch, M., Hellmann, S., & Zehetleitner, M. (2018). Confidence in masked orientation judgments is informed by both evidence and visibility. Attention, Perception, and Psychophysics, 80(1), 134–154. https://doi.org/10.3758/s13414-017-1431-5 | ||
- Rausch, M., & Zehetleitner, M. (2017). Should metacognition be measured by logistic regression? Consciousness and Cognition, 49, 291–312. https://doi.org/10.1016/j.concog.2017.02.007 | ||
- Rigoux, L., Stephan, K. E., Friston, K. J., & Daunizeau, J. (2014). Bayesian model selection for group studies - revisited. \emph{NeuroImage}, 84, 971–985. https://doi.org/10.1016/j.neuroimage.2013.08.065 | ||
- Shekhar, M., & Rahnev, D. (2021). The Nature of Metacognitive Inefficiency in Perceptual Decision Making. Psychological Review, 128(1), 45–70. https://doi.org/10.1037/rev0000249 | ||
- Shekhar, M., & Rahnev, D. (2024). How Do Humans Give Confidence? A Comprehensive Comparison of Process Models of Perceptual Metacognition. Journal of Experimental Psychology: General, 153(3), 656–688. https://doi.org/10.1037/xge0001524 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters