Skip to content

Commit ee00e92

Browse files
committed
Updating Namespace
1 parent e68134c commit ee00e92

File tree

11 files changed

+159
-7
lines changed

11 files changed

+159
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Authors@R: c(
1111
person("Sebastian", "Hellmann", email = "[email protected]",
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.

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)

R/fitConf.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

R/fitConfModels.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,21 @@
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{[email protected]}\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

R/groupBMS.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
#' # Conduct group-level Bayesian model selection based on BIC
8181
#' ModelComp <- groupBMS(fitted_par, measure="BIC")
8282
#' ModelComp
83+
#'
84+
#' @importFrom stats rgamma
8385
#' @export
8486
groupBMS <- function(fits, measure = "BIC", opts=list()) {
8587
if (!measure %in% c("BIC", "AIC", "AICc"))
@@ -114,7 +116,7 @@ groupBMS <- function(fits, measure = "BIC", opts=list()) {
114116
res <- sum(g*(x - log(g+opts$eps) - log(K)))
115117
return(res)
116118
}
117-
119+
118120
FreeEnergyNull <- sum(apply(mlp, 2, modelprobs_Null))
119121

120122
# derive probabilities and free energy of the 'fixed-effect' analysis

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){

R/int_fitRCE.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fitRCE <-
4747

4848

4949
logL <- apply(inits, MARGIN = 1,
50-
function(p) try(ll_llRCE(p, N_SA_RA, N_SA_RB, N_SB_RA,N_SB_RB, nRatings, nCond), silent = TRUE))
50+
function(p) try(ll_RCE(p, N_SA_RA, N_SA_RB, N_SB_RA,N_SB_RB, nRatings, nCond), silent = TRUE))
5151
logL <- as.numeric(logL)
5252
inits <- inits[order(logL),]
5353
inits <- inits[1:nInits,]

man/fitConf.Rd

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

man/fitConfModels.Rd

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

man/groupBMS.Rd

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

0 commit comments

Comments
 (0)