Core SDT Measures¶
The core signal detection theory measures found throughout the literature. For reference, see Stanislaw & Todorov (1999)1.
kriterion.measures
¶
Performance
dataclass
¶
Performance(
tpr: ArrayLike,
fpr: ArrayLike,
d_prime: ArrayLike,
a_prime: ArrayLike,
c_bias: ArrayLike,
beta: ArrayLike,
a_z: ArrayLike | None = None,
)
Sensitivity and bias measures for one or more TPR/FPR pairs.
| ATTRIBUTE | DESCRIPTION |
|---|---|
tpr |
True positive rate(s).
TYPE:
|
fpr |
False positive rate(s).
TYPE:
|
d_prime |
Sensitivity \(d'\).
TYPE:
|
a_prime |
Non-parametric sensitivity \(A'\).
TYPE:
|
c_bias |
Criterion bias \(c\).
TYPE:
|
beta |
Likelihood-ratio bias \(\beta\).
TYPE:
|
a_z |
Area under the binormal ROC curve \(A_z\). Only present when
TYPE:
|
compute_performance
¶
compute_performance(
tpr: ArrayLike,
fpr: ArrayLike,
z_intercept: ArrayLike | None = None,
z_slope: ArrayLike | None = None,
) -> Performance
Compute all sensitivity and bias measures for one or more TPR/FPR pairs.
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s).
TYPE:
|
fpr
|
False positive rate(s).
TYPE:
|
z_intercept
|
Intercept of the fitted \(z\)-ROC line, required to compute \(A_z\).
TYPE:
|
z_slope
|
Slope of the fitted \(z\)-ROC line, required to compute \(A_z\).
TYPE:
|
Source code in src/kriterion/measures.py
d_prime
¶
Sensitivity measure \(d'\).
Where \(\Phi^{-1}(p)\) is the inverse cumulative distribution function, which converts a probability to a \(z\)-score.
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s), \(0 \leq H \leq 1\).
TYPE:
|
fpr
|
False positive rate(s), \(0 \leq F \leq 1\).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(d'\). A float or array of the same shape as |
Notes
Estimates the ability to discriminate between signal and noise. Larger magnitude indicates greater sensitivity.
Examples:
Source code in src/kriterion/measures.py
c_bias
¶
Bias measure \(c\).
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s), \(0 \leq H \leq 1\).
TYPE:
|
fpr
|
False positive rate(s), \(0 \leq F \leq 1\).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(c\). A float or array of the same shape as |
Notes
Estimates the criterion relative to the intersection of the signal and noise distributions. \(c = 0\) indicates no bias; positive values indicate conservative bias, negative values indicate liberal bias.
Examples:
Source code in src/kriterion/measures.py
a_prime
¶
Non-parametric sensitivity index \(A'\).
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s), \(0 \leq H \leq 1\).
TYPE:
|
fpr
|
False positive rate(s), \(0 \leq F \leq 1\).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(A'\). A float or array of the same shape as |
Notes
A non-parametric measure of discrimination that estimates sensitivity as the area under an "average" ROC curve for a single TPR/FPR pair. See Snodgrass & Corwin (1988). \(d'\) is preferred where model assumptions hold.
Source code in src/kriterion/measures.py
beta
¶
Likelihood-ratio bias measure \(\beta\).
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s), \(0 \leq H \leq 1\).
TYPE:
|
fpr
|
False positive rate(s), \(0 \leq F \leq 1\).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(\beta\). A float or array of the same shape as |
Notes
The ratio of the signal distribution density to the noise distribution density at the criterion. \(\beta = 1\) indicates no bias; \(\beta > 1\) indicates conservative bias, \(\beta < 1\) indicates liberal bias. See Snodgrass & Corwin (1988) for details.
Source code in src/kriterion/measures.py
beta_doubleprime
¶
Non-parametric bias index \(\beta''\).
Grier's (1971) formula:
| PARAMETER | DESCRIPTION |
|---|---|
tpr
|
True positive rate(s), \(0 \leq H \leq 1\).
TYPE:
|
fpr
|
False positive rate(s), \(0 \leq F \leq 1\).
TYPE:
|
donaldson
|
Use Donaldson's formula instead of Grier's, by default False.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(\beta''\). A float or array of the same shape as |
Notes
\(\beta'' \in [-1, 1]\). Positive values indicate conservative bias, negative values indicate liberal bias. Default is Grier's (1971) as cited in Stanislaw & Todorov (1999).
Source code in src/kriterion/measures.py
a_z
¶
Area under the binormal ROC curve, \(A_z\).
where \(a\) is the \(z\)-ROC intercept, \(b\) is the \(z\)-ROC slope, and \(\Phi\) is the standard normal CDF.
| PARAMETER | DESCRIPTION |
|---|---|
z_intercept
|
Intercept \(a\) of the fitted \(z\)-ROC line.
TYPE:
|
z_slope
|
Slope \(b\) of the fitted \(z\)-ROC line.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ArrayLike
|
\(A_z\), the area under the binormal ROC curve. |
Notes
Useful for checking the equal-variance \(d'\) assumption: the slope \(b\) should equal 1 (equivalently, \(\ln b = 0\)) under equal variances. See Stanislaw & Todorov (1999).