View source: R/helpers-analysis.R
| auc_sdt | R Documentation |
Computes the posterior area under the ROC curve (AUC). For Gaussian and
Gumbel (min or max) equal-variance binary SDT the AUC is available in
closed form from the d draws; otherwise it is obtained by trapezoidal
integration of the model-implied curve (for rating fits, the curve swept
from the posterior of d and sdratio, lifted by Ro/Rn for
version = "dpsdt", so the AUC is the area under the predicted mixture ROC
and not \Phi(d/\sqrt{2}); for version = "metad" it is the type-1
curve). The returned AUC is always the
area under the full curve, not the trapezoid of the discrete operating
points or the K-1 rating thresholds; for binary multi-criteria fits it is
one value per curve.
auc_sdt(
fit,
conditions = NULL,
probs = c(0.025, 0.975),
criterion_points = NULL,
...
)
fit |
A |
conditions |
Optional data frame of predictor values at which to
evaluate the model. Column names must match predictor variables used in
the formula. If |
probs |
Numeric vector of length 2. Quantiles for the credible interval
(default |
criterion_points |
Optional. Control of the binary multi-criteria
behaviour. |
... |
Additional arguments passed to |
The closed form is used only when sdratio is fixed at 0, where d
(which is d_a) equals d'; every fit with sdratio estimated or
fixed away from 0 takes the numerical route, so the AUC is invariant to the
sensitivity parameterization.
Analytical formulas (equal variance, where d_a = d'): normal
EV-SDT AUC = \Phi(d'/\sqrt{2}); Gumbel-min and Gumbel-max EV-SDT
AUC = \mathrm{logistic}(g').
A data frame of class "bmm_sdt_auc" with columns AUC, .draw,
and any condition columns, plus a summary attribute (AUC_mean,
AUC_lower, AUC_upper), model_class, dist and conditions
attributes.
roc_sdt(), plot.bmm_sdt_auc()
## Not run:
# Three base-rate conditions shift the criterion, which identifies sdratio
dat <- expand.grid(id = 1:20, stimulus = c(0L, 1L),
condition = c("liberal", "neutral", "strict"))
dat$n_trials <- 100L
# simulated as bias, measured from the midpoint between the means (0 = boundary at the midpoint)
criteria <- c(liberal = -0.5, neutral = 0, strict = 0.5)
dat$n_old <- rsdt_yn(nrow(dat), dat$n_trials, dat$stimulus, d = 1.5,
bias = criteria[as.character(dat$condition)],
sdratio = 1.3)
fit <- bmm(
formula = bmf(d ~ 1, criterion ~ 0 + condition, sdratio ~ 1),
data = dat,
model = sdt_yn(response = "n_old", stimulus = "stimulus",
n_trials = "n_trials"),
cores = 4,
backend = "cmdstanr"
)
auc <- auc_sdt(fit)
auc
plot(auc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.