Density and random generation for the dual-process signal
detection model (Yonelinas, 1994), with recall-to-reject of new items
(Rn; as in Yonelinas, 2024). Extends rating SDT with recollection
probabilities Ro (old items recollected as old) and Rn (new items
recall-rejected) that add mass to the most-confident rating category. These
are the simulation counterparts of the dpsdt version of sdt_rating();
here Ro/Rn are supplied directly as probabilities in [0, 1].
Arguments
- counts
Integer matrix with one row per observation and one column per rating category, ordered from "definitely noise" (1) to "definitely signal" (K), or a vector for a single observation. A data frame is read as the matrix of its rows.
- stimulus
Integer vector (0/1). Stimulus type: 0 = noise, 1 = signal.
- d
Numeric vector. Sensitivity: \(d'\) when
sdratiois 1, and otherwise the balanced index \(d_a\) (seesdt_yn()). The separation between the distributions in noise units isd * sqrt((1 + sdratio^2) / 2).- thresholds
Numeric vector of length K-1 with the ordered decision thresholds, or an n-by-(K-1) matrix with one row per observation. The thresholds are positions on the noise-standardized axis, measured from the mean of the noise distribution (the signal mean sits at
d * sqrt((1 + sdratio^2) / 2)), and are not rescaled bysdratio.- Ro
Numeric vector in
[0, 1]. Recollection probability for old (signal) items.- Rn
Numeric vector in
[0, 1]. Recall-to-reject probability for new (noise) items. Defaults to 0, the classic one-sided model, as thedpsdtversion fixes it off unlessRnis in the formula.- sdratio
Numeric vector. Ratio of signal to noise standard deviations (default 1, i.e., equal variance). Must be positive. Note that this is the natural scale: the
sdratioparameter ofsdt_rating()is sampled on the log scale, so it corresponds tolog(sdratio)here.- dist
Character. Noise distribution: "normal" (default), "logistic", "gumbel_min", or "gumbel_max".
- log
Logical. If
TRUE, returns log-density (defaultFALSE).- n
Integer. Number of observations to generate.
n_trials,stimulus,thresholds, and the model parameters are recycled to this length.- n_trials
Integer vector. Number of trials per observation.
Value
dsdt_dpsdt returns the (log-)density (multinomial probability).
rsdt_dpsdt returns an integer matrix with one row per observation and
one rating-count column per category (r1 ... rK).
Vector arguments
r*(n, ...)returns exactlyndraws: a vector, or a data frame or matrix withnrows. Every per-observation argument (a parameter, a stimulus, a number of trials) is recycled to lengthnwithrep_len(), as instats::rnorm(): drawiuses elementi, and a matrix is read element by element; only a set of values per draw, such asthresholds, takes rowiof a matrix (see below). A shorter vector is repeated, also whennis not a multiple of its length. Until bmm 1.6.0 at the earliest,rddm()withn = 1and parameter vectors still returns one draw per element, with a deprecation warning.nis a single number of at least 0. A fraction is truncated, as instats::rnorm(), andn = 0gives an empty vector, or a matrix or data frame with zero rows and the usual columns. Unlikestats::rnorm(), which takes the length of a vectorn, these functions stop on one;rddm()still takes its length, with a deprecation warning.d*(x, ...)returns one value per observation: as many as the longest ofx(its rows, when the observations are rows of counts) and the per-observation arguments, the others recycled to that length. Valueiis what the call on thei-th elements alone returns. A matrix in an argument that takes one number per observation, such asxord, holds one observation per element, as instats::dnorm(). Whenxor any per-observation argument is empty, the result is empty, as instats::dnorm(). ANULLargument, such as a misspelt column of a data frame, counts as empty, except where the default isNULL, as forcriterionorkcrit: there it means that the argument is not given. Where an observation is a vector of counts (dsdt_rating(),dsdt_dpsdt(),dsdt_metad(),dsdt_ranking()anddsdt_cdp()), or the pair ofmean_rtorvar_rtvalues ofdezdm(version = "4par"), a vector is always one observation: pass a matrix with zero rows for none, as an empty vector stops. An emptykcritofdsdt_cdp()andrsdt_cdp()stops as well;kcrit = NULLgives the R/K model. Counts in a data frame, a tibble included, are read as the matrix of its rows, and so aremean_rtandvar_rtofdezdm(version = "4par").dsdm()with a data framexis the exception: it returns a data frame of the same shape, one density per cell, and cuts longer parameters to the number of cells.A set of values that describes one observation, such as the
thresholdsof the rating models or the item locationsmu(anddist) ofdmixture3p()anddimm(), is a vector when every observation shares it and a matrix with one row per observation otherwise: rowibelongs to observationi, or to drawi. Item locations are padded withNApast each row's set size, and a data frame of them is read as the matrix of its rows. As for counts, an empty vector of them stops: pass a matrix with zero rows for no observations.Configuration arguments such as
version,distof the ranking models,log,parametrizationandn_neware single values and are never recycled. An argument that a version does not use, such aszrofdezdm(version = "3par"), is ignored.
References
Yonelinas, A. P. (1994). Receiver-operating characteristics in recognition memory: Evidence for a dual-process model. Journal of Experimental Psychology: Learning, Memory, and Cognition, 20(6), 1341–1354. doi:10.1037/0278-7393.20.6.1341
Yonelinas, A. P. (2024). The role of recollection and familiarity in visual working memory: A mixture of threshold and signal detection processes. Psychological Review, 131(2), 321–348. doi:10.1037/rev0000432
Examples
# Density for a single observation (K=4) with recollection of old items;
# Rn defaults to 0 (no recall-to-reject), the one-sided model
dsdt_dpsdt(counts = c(2, 8, 20, 70), stimulus = 1,
d = 1.5, thresholds = c(0.25, 0.75, 1.25), Ro = 0.3)
#> [1] 3.023007e-05
# Generate DPSDT rating data (K=4) for 10 subjects and both stimulus types
dat <- expand.grid(id = 1:10, stimulus = c(0L, 1L))
dat <- cbind(dat, rsdt_dpsdt(nrow(dat), 100, dat$stimulus, d = 1.5,
thresholds = c(0.25, 0.75, 1.25),
Ro = 0.3, Rn = 0.1))
head(dat)
#> id stimulus r1 r2 r3 r4
#> 1 1 0 58 14 13 15
#> 2 2 0 69 14 10 7
#> 3 3 0 61 18 11 10
#> 4 4 0 55 13 19 13
#> 5 5 0 56 25 11 8
#> 6 6 0 61 16 12 11
