fitConfModels {statConfR}R Documentation

Fit several static confidence models to multiple participants

Description

This function is a wrapper of the function fitConf. It calls the function for every possible combination of model in the model argument and participant in the data, respectively. See the Details for more information about the parameters.

Usage

fitConfModels(data, models = "all", nInits = 5, nRestart = 4,
  .parallel = FALSE, n.cores = NULL)

Arguments

data

a data.frame where each row is one trial, containing following variables:

  • diffCond (optional; different levels of discriminability, should be a factor with levels ordered from hardest to easiest),

  • rating (discrete confidence judgments, should be a factor with levels ordered from lowest confidence to highest confidence; otherwise will be transformed to factor with a warning),

  • stimulus (stimulus category in a binary choice task, should be a factor with two levels, otherwise it will be transformed to a factor with a warning),

  • correct (encoding whether the response was correct; should be 0 for incorrect responses and 1 for correct responses)

  • participant (giving the subject ID; the models given in the second argument are fitted for each subject individually.

models

character. Models implemented so far: 'WEV', 'SDT', 'GN', 'PDA', 'IG', 'ITGc', 'ITGcm', 'logN', and 'logWEV'. Alternatively, if model="all" (default), all implemented models will be fit.

nInits

integer. Number of initial values used for maximum likelihood optimization. Defaults to 5.

nRestart

integer. Number of times the optimization is restarted. Defaults to 4.

.parallel

logical. Whether to parallelize the fitting over models and participant (default: FALSE)

n.cores

integer. Number of cores used for parallelization. If NULL (default), the available number of cores -1 will be used.

Details

The fitting routine first performs a coarse grid search to find promising starting values for the maximum likelihood optimization procedure. Then the best nInits parameter sets found by the grid search are used as the initial values for separate runs of the Nelder-Mead algorithm implemented in optim. Each run is restarted nRestart times.

Mathematical description of models

The computational models 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. Both S and R can be either -1 or 1. R is considered correct if S=R. In addition, we assume that there are K different levels of stimulus discriminability in the experiment, i.e. a physical variable that makes the discrimination task easier or harder. For each level of discriminability, the function fits a different discrimination sensitivity parameter d_k. If there is more than one sensitivity parameter, we assume that the sensitivity parameters are ordered such as 0 < d_1 < d_2 < ... < d_K. The models assume that the stimulus generates normally distributed sensory evidence x with mean S\times d_k/2 and variance of 1. The sensory evidence x is compared to a decision criterion c to generate a discrimination response R, which is 1, if x exceeds c and -1 else. To generate confidence, it is assumed that the confidence variable y is compared to another set of criteria \theta_{R,i}, i=1,2,...,L-1, depending on the discrimination response R to produce a L-step discrete confidence response. The number of thresholds will be inferred from the number of steps in the rating column of data. Thus, the parameters shared between all models are:

How the confidence variable y is computed varies across the different models. The following models have been implemented so far:

Signal Detection Rating Model (SDT)

According to SDT, the same sample of sensory evidence is used to generate response and confidence, i.e., y=x and the confidence criteria span from the left and right side of the decision criterion c(Green & Swets, 1966).

Gaussian Noise Model (GN)

According to the model, y is subject to additive noise and assumed to be normally distributed around the decision evidence value x with a standard deviation \sigma(Maniscalco & Lau, 2016). \sigma is an additional free parameter.

Weighted Evidence and Visibility model (WEV)

WEV assumes that the observer combines evidence about decision-relevant features of the stimulus with the strength of evidence about choice-irrelevant features to generate confidence (Rausch et al., 2018). Thus, the WEV model assumes that y is normally distributed with a mean of (1-w)\times x+w \times d_k\times R and standard deviation \sigma. The standard deviation quantifies the amount of unsystematic variability contributing to confidence judgments but not to the discrimination judgments. The parameter w represents the weight that is put on the choice-irrelevant features in the confidence judgment. w and \sigma are fitted in addition to the set of shared parameters.

Post-decisional accumulation model (PDA)

PDA represents the idea of on-going information accumulation after the discrimination choice (Rausch et al., 2018). The parameter a indicates the amount of additional accumulation. The confidence variable is normally distributed with mean x+S\times d_k\times a and variance a. For this model the parameter a is fitted in addition to the shared parameters.

Independent Gaussian Model (IG)

According to IG, y is sampled independently from x (Rausch & Zehetleitner, 2017). y is normally distributed with a mean of a\times d_k and variance of 1 (again as it would scale with m). The additional parameter m represents the amount of information available for confidence judgment relative to amount of evidence available for the discrimination decision and can be smaller as well as greater than 1.

Independent Truncated Gaussian Model: HMetad-Version (ITGc)

According to the version of ITG consistent with the HMetad-method (Fleming, 2017; see Rausch et al., 2023), y is sampled independently from x from a truncated Gaussian distribution with a location parameter of S\times d_k \times m/2 and a scale parameter of 1. The Gaussian distribution of y is truncated in a way that it is impossible to sample evidence that contradicts the original decision: If R = -1, the distribution is truncated to the right of c. If R = 1, the distribution is truncated to the left of c. The additional parameter m represents metacognitive efficiency, i.e., the amount of information available for confidence judgments relative to amount of evidence available for discrimination decisions and can be smaller as well as greater than 1.

Independent Truncated Gaussian Model: Meta-d'-Version (ITGcm)

According to the version of the ITG consistent with the original meta-d' method (Maniscalco & Lau, 2012, 2014; see Rausch et al., 2023), y is sampled independently from x from a truncated Gaussian distribution with a location parameter of S\times d_k \times m/2 and a scale parameter of 1. If R = -1, the distribution is truncated to the right of m\times c. If R = 1, the distribution is truncated to the left of m\times c. The additional parameter m represents metacognitive efficiency, i.e., the amount of information available for confidence judgments relative to amount of evidence available for the discrimination decision and can be smaller as well as greater than 1.

Logistic Noise Model (logN)

According to logN, the same sample of sensory evidence is used to generate response and confidence, i.e., y=x just as in SDT (Shekhar & Rahnev, 2021). However, according to logN, the confidence criteria are not assumed to be constant, but instead they are affected by noise drawn from a lognormal distribution. In each trial, \theta_{-1,i} is given by c - \epsilon_i. Likewise, \theta_{1,i} is given by c + \epsilon_i. \epsilon_i is drawn from a lognormal distribution with the location parameter \mu_{R,i}=log(|\overline{\theta}_{R,i}- c|) - 0.5 \times \sigma^{2} and scale parameter \sigma. \sigma is a free parameter designed to quantify metacognitive ability. It is assumed that the criterion noise is perfectly correlated across confidence criteria, ensuring that the confidence criteria are always perfectly ordered. Because \theta_{-1,1}, ..., \theta_{-1,L-1}, \theta_{1,1}, ..., \theta_{1,L-1} change from trial to trial, they are not estimated as free parameters. Instead, we estimate the means of the confidence criteria, i.e., \overline{\theta}_{-1,1}, ..., \overline{\theta}_{-1,L-1}, \overline{\theta}_{1,1}, ... \overline{\theta}_{1,L-1}, as free parameters.

Logistic Weighted Evidence and Visibility model (logWEV)

logWEV is a combination of logN and WEV proposed by Shekhar and Rahnev (2023). Conceptually, logWEV assumes that the observer combines evidence about decision-relevant features of the stimulus with the strength of evidence about choice-irrelevant features (Rausch et al., 2018). The model also assumes that noise affecting the confidence decision variable is lognormal in accordance with Shekhar and Rahnev (2021). According to logWEV, the confidence decision variable is y is equal to y^*\times R. y^* is sampled from a lognormal distribution with a location parameter of (1-w)\times x\times R + w \times d_k and a scale parameter of \sigma. The parameter \sigma quantifies the amount of unsystematic variability contributing to confidence judgments but not to the discrimination judgments. The parameter w represents the weight that is put on the choice-irrelevant features in the confidence judgment. w and \sigma are fitted in addition to the set of shared parameters.

Value

Gives data frame with one row for each combination of model and participant and columns for the estimated parameters. Additional information about the fit is provided in additional columns:

Author(s)

Sebastian Hellmann, sebastian.hellmann@ku.de

Manuel Rausch, manuel.rausch@hochschule-rhein-waal.de

References

Akaike, H. (1974). A New Look at the Statistical Model Identification. IEEE Transactions on Automatic Control, AC-19(6), 716–723.doi: 10.1007/978-1-4612-1694-0_16

Burnham, K. P., & Anderson, D. R. (2002). Model selection and multimodel inference: A practical information-theoretic approach. Springer.

Fleming, S. M. (2017). HMeta-d: Hierarchical Bayesian estimation of metacognitive efficiency from confidence ratings. Neuroscience of Consciousness, 1, 1–14. doi: 10.1093/nc/nix007

Green, D. M., & Swets, J. A. (1966). Signal detection theory and psychophysics. Wiley.

Maniscalco, B., & Lau, H. (2012). A signal detection theoretic method for estimating metacognitive sensitivity from confidence ratings. Consciousness and Cognition, 21(1), 422–430.

Maniscalco, B., & Lau, H. C. (2014). Signal Detection Theory Analysis of Type 1 and Type 2 Data: Meta-d’, Response- Specific Meta-d’, and the Unequal Variance SDT Model. In S. M. Fleming & C. D. Frith (Eds.), The Cognitive Neuroscience of Metacognition (pp. 25–66). Springer. doi: 10.1007/978-3-642-45190-4_3

Maniscalco, B., & Lau, H. (2016). The signal processing architecture underlying subjective reports of sensory awareness. Neuroscience of Consciousness, 1, 1–17. doi: 10.1093/nc/niw002

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. doi: 10.3758/s13414-017-1431-5

Rausch, M., Hellmann, S., & Zehetleitner, M. (2023). Measures of metacognitive efficiency across cognitive models of decision confidence. Psychological Methods. doi: 10.31234/osf.io/kdz34

Rausch, M., & Zehetleitner, M. (2017). Should metacognition be measured by logistic regression? Consciousness and Cognition, 49, 291–312. doi: 10.1016/j.concog.2017.02.007

Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461–464. doi: 10.1214/aos/1176344136

Shekhar, M., & Rahnev, D. (2021). The Nature of Metacognitive Inefficiency in Perceptual Decision Making. Psychological Review, 128(1), 45–70. doi: 10.1037/rev0000249

Shekhar, M., & Rahnev, D. (2023). How Do Humans Give Confidence? A Comprehensive Comparison of Process Models of Perceptual Metacognition. Journal of Experimental Psychology: General. doi:10.1037/xge0001524

Examples

# 1. Select two subjects from the masked orientation discrimination experiment
data <- subset(MaskOri, participant %in% c(1:2))
head(data)

# 2. Fit some models to each subject of the masked orientation discrimination experiment

  # Fitting several models to several subjects takes quite some time
  # If you want to fit more than just two subjects,
  # we strongly recommend setting .parallel=TRUE
  Fits <- fitConfModels(data, models = c("SDT", "ITGc"), .parallel = FALSE)


[Package statConfR version 0.1.1 Index]