Skip to content

Commit e99a87b

Browse files
committed
Changed email addresses, bug fixes
1 parent ee00e92 commit e99a87b

41 files changed

Lines changed: 1090 additions & 130 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

R/fitConfModels.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
#' each belonging to one possible identity of the stimulus.
203203
#' Both samples of sensory evidence \eqn{x_{-1}} and
204204
#' \eqn{x_1} are sampled from Gaussian distributions with a standard deviations of \eqn{\sqrt{1/2}}.
205-
#' The mean of \eqn{x_{-1}} is given by \eqn{(1 S) \times 0.25 \times d}; the mean
205+
#' The mean of \eqn{x_{-1}} is given by \eqn{(1 - S) \times 0.25 \times d}; the mean
206206
#' of \eqn{x_1} is given by \eqn{(1 + S) \times 0.25 \times d}. The sensory evidence
207207
#' used for the discrimination choice is \eqn{x = x_2 - x_1},
208208
#' which implies that the discrimination decision is equivalent to standard SDT.

R/groupBMS.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#' It therefore aggregates the available subject-level model evidences
4949
#' according to a random effects model, which assumes that model probabilities
5050
#' are distributed in the population according to a Dirichlet distribution.
51-
#' The parameters of the Dirichelet distribution are determined using a variational Bayes algorithm.
51+
#' The parameters of the Dirichlet distribution are determined using a variational Bayes algorithm.
5252
#' `groupBMS` provides three statistics associated with the random effects model:
5353
#' * estimated model frequencies in the population,
5454
#' * The exceedance probability represents the probability that a specific
@@ -64,7 +64,7 @@
6464
#' @references Stephan, K. E., Penny, W. D., Daunizeau, J., Moran, R. J., & Friston, K. J. (2009). Bayesian model selection for group studies. Neuroimage, 46(4), 1004-1017.
6565

6666
#' @author
67-
#' Sebastian Hellmann, \email{sebastian.hellmann@@ku.de}\cr
67+
#' Sebastian Hellmann, \email{sebastian.hellmann@tum.de}\cr
6868
#' Manuel Rausch, \email{manuel.rausch@ku.de}
6969
#'
7070
#' @examples
@@ -83,7 +83,7 @@
8383
#'
8484
#' @importFrom stats rgamma
8585
#' @export
86-
groupBMS <- function(fits, measure = "BIC", opts=list()) {
86+
groupBMS <- function(fits, measure = "AICc", opts=list()) {
8787
if (!measure %in% c("BIC", "AIC", "AICc"))
8888
stop(paste0("measure=", measure, " should be BIC, AIC, or AICc"))
8989
models <- sort(unique(fits$model))

man/fitConfModels.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/groupBMS.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

statConfR.Rcheck/00_pkg_src/statConfR/DESCRIPTION

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Package: statConfR
22
Type: Package
33
Title: Models of Decision Confidence and Measures of Metacognition
4-
Version: 0.2.0
5-
Date: 2025-02-11
4+
Version: 0.2.1
5+
Date: 2025-02-22
66
Authors@R: c(
7-
person("Manuel", "Rausch", email = "manuel.rausch@hochschule-rhein-waal.de",
7+
person("Manuel", "Rausch", email = "manuel.rausch@ku.de",
88
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-5805-5544")),
99
person("Sascha", "Meyen", email = "saschameyen@gmail.com",
1010
role = c("aut"), comment = c(ORCID = "0000-0001-6928-4126")),
1111
person("Sebastian", "Hellmann", email = "sebastian.hellmann@tum.de",
1212
role = c("aut"), comment = c(ORCID = "0000-0002-3621-6343"))
1313
)
14-
Maintainer: Manuel Rausch <manuel.rausch@hochschule-rhein-waal.de>
14+
Maintainer: Manuel Rausch <manuel.rausch@ku.de>
1515
Description: Provides fitting functions and other tools for decision confidence
1616
and metacognition researchers, including meta-d'/d', often considered to be
1717
the gold standard to measure metacognitive efficiency, and information-theoretic measures of metacognition.
18-
Also allows to fit several static models of decision making and confidence.
18+
Also allows to fit and compare several static models of decision making and confidence.
1919
License: GPL(>=3)
2020
URL: https://github.com/ManuelRausch/StatConfR
2121
BugReports: https://github.com/ManuelRausch/StatConfR/issues
@@ -25,7 +25,7 @@ Date/Publication: 2023-09-12
2525
Encoding: UTF-8
2626
LazyData: true
2727
NeedsCompilation: no
28-
Packaged: 2025-02-13 13:50:54 UTC; PPA714
28+
Packaged: 2025-07-28 07:51:45 UTC; PPA714
2929
Repository: CRAN
3030
Roxygen: list(old_usage = TRUE, markdown=TRUE)
3131
RoxygenNote: 7.3.2

statConfR.Rcheck/00_pkg_src/statConfR/NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export(estimateMetaI)
44
export(fitConf)
55
export(fitConfModels)
66
export(fitMetaDprime)
7+
export(groupBMS)
78
export(plotConfModelFit)
89
export(simConf)
910
import(ggplot2)
@@ -19,5 +20,6 @@ importFrom(stats,optim)
1920
importFrom(stats,plnorm)
2021
importFrom(stats,pnorm)
2122
importFrom(stats,qnorm)
23+
importFrom(stats,rgamma)
2224
importFrom(stats,rmultinom)
2325
importFrom(utils,tail)

statConfR.Rcheck/00_pkg_src/statConfR/R/fitConf.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
#' addition to the set of shared parameters.
171171

172172
#' @author Sebastian Hellmann, \email{sebastian.hellmann@tum.de}\cr
173-
#' Manuel Rausch, \email{manuel.rausch@hochschule-rhein-waal.de}
173+
#' Manuel Rausch, \email{manuel.rausch@ku.de}
174174

175175
# unlike for the other tags, the references are formatted more nicely if each reference is tagged seperately
176176
#' @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\cr
@@ -186,6 +186,7 @@
186186
#' @references Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461–464. doi: 10.1214/aos/1176344136\cr
187187
#' @references Shekhar, M., & Rahnev, D. (2021). The Nature of Metacognitive Inefficiency in Perceptual Decision Making. Psychological Review, 128(1), 45–70. doi: 10.1037/rev0000249\cr
188188
#' @references 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\cr
189+
#' @references Peters, M. A. K., Thesen, T., Ko, Y. D., Maniscalco, B., Carlson, C., Davidson, M., Doyle, W., Kuzniecky, R., Devinsky, O., Halgren, E., & Lau, H. (2017). Perceptual confidence neglects decision-incongruent evidence in the brain. Nature Human Behaviour, 1(0139), 1–21. doi:10.1038/s41562-017-0139
189190

190191
#' @examples
191192
#' # 1. Select one subject from the masked orientation discrimination experiment
@@ -264,7 +265,9 @@ fitConf <- function(data, model = "SDT",
264265
fitting_fct <- fitLognorm
265266
} else if (model == "logWEV"){
266267
fitting_fct <- fitLogWEV
267-
} else stop(paste0("Model: ", model, " not implemented!\nChoose one of: 'WEV', 'SDT', 'IG', 'ITGc', 'ITGcm, 'GN', 'logN', 'logWEV', or 'PDA'"))
268+
} else if (model == "RCE"){
269+
fitting_fct <- fitRCE
270+
} else stop(paste0("Model: ", model, " not implemented!\nChoose one of: 'WEV', 'SDT', 'IG', 'ITGc', 'ITGcm, 'GN', 'logN', 'logWEV', 'RCE', or 'PDA'"))
268271

269272
fit <- fitting_fct(N_SA_RA = N_SA_RA,N_SA_RB = N_SA_RB,
270273
N_SB_RA = N_SB_RA,N_SB_RB = N_SB_RB,

statConfR.Rcheck/00_pkg_src/statConfR/R/fitConfModels.R

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#' the models given in the second argument are fitted to each subset of `data`
3131
#' determined by the different values of this column)
3232
#' @param models `character`. The different computational models that should be
33-
#' fitted. Models implemented so far: 'WEV', 'SDT', 'GN', 'PDA', 'IG', 'ITGc',
33+
#' fitted. Models implemented so far: 'WEV', 'SDT', 'GN', 'PDA', 'IG', 'ITGc', 'RCE',
3434
#' 'ITGcm', 'logN', and 'logWEV'. Alternatively, if `model="all"` (default),
3535
#' all implemented models will be fit.
3636
#' @param nInits `integer`. Number of initial values used for maximum likelihood optimization.
@@ -193,10 +193,25 @@
193193
#' The parameter \eqn{w} represents the weight that is put on the choice-irrelevant
194194
#' features in the confidence judgment. \eqn{w} and \eqn{\sigma} are fitted in
195195
#' addition to the set of shared parameters.
196+
#'
197+
#' ### \strong{Response-congruent evidence model (RCE)}
198+
#' The response-congruent evidence model represents the idea that observers use
199+
#' all available sensory information to make the discrimination decision, but for confidence judgements,
200+
#' they only consider evidence consistent with the selected decision and ignore evidence against the decision (Peters et al., 2017).
201+
#' The model assumes two separate samples of sensory evidence collected in each trial,
202+
#' each belonging to one possible identity of the stimulus.
203+
#' Both samples of sensory evidence \eqn{x_{-1}} and
204+
#' \eqn{x_1} are sampled from Gaussian distributions with a standard deviations of \eqn{\sqrt{1/2}}.
205+
#' The mean of \eqn{x_{-1}} is given by \eqn{(1 − S) \times 0.25 \times d}; the mean
206+
#' of \eqn{x_1} is given by \eqn{(1 + S) \times 0.25 \times d}. The sensory evidence
207+
#' used for the discrimination choice is \eqn{x = x_2 - x_1},
208+
#' which implies that the discrimination decision is equivalent to standard SDT.
209+
#' The confidence decision variable y is \eqn{y = - x_1} if the response R is -1 and \eqn{y = x_2} otherwise.
210+
196211

197212
#' @author
198213
#' Sebastian Hellmann, \email{sebastian.hellmann@tum.de}\cr
199-
#' Manuel Rausch, \email{manuel.rausch@hochschule-rhein-waal.de}
214+
#' Manuel Rausch, \email{manuel.rausch@ku.de}
200215

201216
# unlike for the other tags, the references are formatted more nicely if each reference is tagged seperately
202217
#' @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\cr
@@ -212,6 +227,8 @@
212227
#' @references Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461–464. doi: 10.1214/aos/1176344136\cr
213228
#' @references Shekhar, M., & Rahnev, D. (2021). The Nature of Metacognitive Inefficiency in Perceptual Decision Making. Psychological Review, 128(1), 45–70. doi: 10.1037/rev0000249\cr
214229
#' @references 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\cr
230+
#' @references Peters, M. A. K., Thesen, T., Ko, Y. D., Maniscalco, B., Carlson, C., Davidson, M., Doyle, W., Kuzniecky, R., Devinsky, O., Halgren, E., & Lau, H. (2017). Perceptual confidence neglects decision-incongruent evidence in the brain. Nature Human Behaviour, 1(0139), 1–21. doi:10.1038/s41562-017-0139
231+
215232

216233
#' @examples
217234
#' # 1. Select two subjects from the masked orientation discrimination experiment
@@ -237,7 +254,7 @@ fitConfModels <- function(data, models="all",
237254
nInits = 5, nRestart = 4,
238255
.parallel=FALSE, n.cores=NULL) {
239256
AllModels <- c('WEV', 'SDT', 'IG', 'ITGc',
240-
'ITGcm', 'GN', 'PDA', 'logN', 'logWEV') # if you implement additional models, add them here!
257+
'ITGcm', 'GN', 'PDA', 'logN', 'logWEV', 'RCE') # if you implement additional models, add them here!
241258
if (identical(models,"all")) models <- AllModels
242259
if (!all(models %in% AllModels)) {
243260
stop(paste(paste(setdiff(models, AllModels),collapse = " and "), " not implemented!"))

statConfR.Rcheck/00_pkg_src/statConfR/R/int_fitCEV.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Functions to fit the WEV model
22
### Model version described by (Rausch et al., 2023)
3+
34
fitCEV <-
45
function(N_SA_RA, N_SA_RB, N_SB_RA, N_SB_RB,
56
nInits, nRestart, nRatings, nCond, nTrials){

statConfR.Rcheck/00_pkg_src/statConfR/R/plotConfModelFit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#' @importFrom Rmisc summarySEwithin
8484
#' @importFrom stats aggregate
8585

86-
#' @author Manuel Rausch, \email{manuel.rausch@hochschule-rhein-waal.de}
86+
#' @author Manuel Rausch, \email{manuel.rausch@ku.de}
8787

8888
#' @export
8989
plotConfModelFit <- function(data, fitted_pars, model = NULL){

0 commit comments

Comments
 (0)