Skip to contents

m-Alternative Forced Choice Signal Detection Theory Model

Usage

sdt_mafc(
  response,
  n_trials = NULL,
  m,
  dist = c("normal", "gumbel_min", "gumbel_max", "logistic"),
  links = NULL,
  ...
)

Arguments

response

A single string naming the column with counts of correct responses, or, with one row per trial (n_trials = NULL), 1 for a correct and 0 for an incorrect response.

n_trials

The name of the variable containing the total number of trials per cell. NULL (the default) declares one row per trial: the column named by response then holds 0 or 1 in every row.

m

Either a single integer >= 2 giving the number of alternatives (constant across all rows), or a single string naming a data column that gives the number of alternatives per row. A column lets trials with different set sizes be fit jointly.

dist

The distribution assumed for the latent evidence, given here by its cumulative distribution function. One of:

  • "normal" (default): Gaussian m-AFC, \(\Phi(x)\)

  • "gumbel_min": smallest-extreme-value m-AFC, \(1 - \exp(-\exp(x))\) (complementary log-log)

  • "gumbel_max": largest-extreme-value m-AFC, \(\exp(-\exp(-x))\) (log-log, as in evd::pgumbel)

  • "logistic": logistic m-AFC, \(1 / (1 + \exp(-x))\)

A named list of link functions for the parameters.

...

used internally for testing, ignore it

Value

An object of class bmmodel

Details

  • Domain: Perception, Long-term memory

  • Task: Detection, recognition and confidence judgments

  • Name: m-Alternative Forced Choice Signal Detection Theory Model

  • Citation:

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

    • DeCarlo, L. T. (2012). On a signal detection approach to m-alternative forced choice with bias, with maximum likelihood and Bayesian approaches to estimation. Journal of Mathematical Psychology, 56(3), 196-207. https://doi.org/10.1016/j.jmp.2012.02.004

  • Requirements:

    Provide aggregated accuracy data, one row per cell, with the following columns:

  • Response counts (response): number of correct responses

  • Number of trials (n_trials): total trials per cell

No stimulus column is needed: each trial has exactly one signal alternative.

  • Parameters:

    • d: Sensitivity: d', the distance between the signal and distractor distributions in SD units (m-AFC assumes a common SD, so this is also the d_a that sdt_yn reports under unequal variance)

  • Fixed parameters:

  • Default parameter links:

    • d = identity

  • Default priors:

    • d:

      • main: normal(1, 1)

      • effects: normal(0, 0.5)

      • sd: exponential(1)

  • Requirements for one row per trial:

    Provide one row per trial with the following column:

  • Response (response): 1 = correct, 0 = incorrect

No stimulus column is needed: each trial has exactly one signal alternative.

  • Trial-level data: Without trial-level predictors or item terms, trial rows give the same posterior as the counts aggregated from them, which are sufficient statistics; the fit only takes longer, because its cost grows with the number of rows. Crossed random effects such as (1 | id) + (1 | item) need trial rows, unless the counts are kept per participant and item.

    • loo() leaves out single trials on trial rows and whole cells on aggregated rows. These are different predictions, and the log-likelihoods of the trial rows sum to the cell's log-likelihood less the log of the binomial (or multinomial) coefficient, so ELPD values compare only fits to the same layout. kfold(fit, group = "id") leaves out whole participants with either layout.

    • bmm(..., threads = n) with backend = "cmdstanr" evaluates the likelihood on n threads per chain, which shortens trial-level fits on a machine with cores to spare.

    • ppp(fit, participant = "id") names the participant when the formula has more than one grouping variable, such as item terms.

Models accuracy in m-AFC tasks where each trial presents one signal among m alternatives and the observer chooses the strongest one. Only d is estimated (m-AFC has no response bias). The probability correct, \(P_c = \int f(x - d)\, F(x)^{m-1}\, dx\), is computed per noise distribution: a closed-form softmax for gumbel_max, a closed-form Gamma ratio for gumbel_min, Gauss-Hermite quadrature for normal (\(\Phi(d/\sqrt{2})\) at m = 2), and Gauss-Legendre quadrature for logistic.

Sensitivity is on the same scale as sdt_yn()

d is \(d'\). m-AFC assumes the signal and distractor distributions share an SD, so there is no sdratio parameter, and \(d'\) coincides with the balanced index \(d_a\) that sdt_yn() reports once its sdratio is estimated.

At m = 2 the two models agree: 2AFC proportion correct equals the area under the yes/no ROC (Green's theorem), and for Gaussian noise both give \(P_c = \Phi(d/\sqrt{2})\). The same observer therefore yields the same d whether it is measured by a yes/no ROC or by 2AFC accuracy, which is the property that makes \(d_a\) the right common scale for the SDT family. For dist = "normal" this holds even when sdt_yn() estimates unequal variance. For the other distributions it holds when sdt_yn() keeps sdratio at its default, because only the Gaussian \(d_a\) is exactly the AUC-equivalent index (see the sensitivity section of sdt_yn()).

References

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

DeCarlo, L. T. (2012). On a signal detection approach to m-alternative forced choice with bias, with maximum likelihood and Bayesian approaches to estimation. Journal of Mathematical Psychology, 56(3), 196–207. doi:10.1016/j.jmp.2012.02.004

Examples

if (FALSE) { # \dontrun{
dat <- data.frame(id = 1:20, n_trials = 200L)
dat$n_correct <- rsdt_mafc(nrow(dat), dat$n_trials, m = 4,
                           d = rnorm(20, 1.5, 0.4))

model <- sdt_mafc(
  response = "n_correct",
  n_trials = "n_trials",
  m = 4
)

fit <- bmm(
  formula = bmf(d ~ 1),
  data = dat,
  model = model,
  cores = 4,
  backend = "cmdstanr"
)
} # }