DetectionTheory.jl is a Julia package to compute signal detection theory measures. Signal detection theory (SDT) is commonly used in psychophysics to quantify the performance of an observer in a variety of tasks.
DetectionTheory.jl includes functions to compute d' for the following tasks:
- Multiple alternatives forced choice
- Odd-One-Out with 3 response alternatives (also known as oddity, or triangular method)
Most of the functions have been ported from the psyphy R package.
Installation and Usage
DetectionTheory can be installed using:
once the package is installed, to access the functions in the module you can type:
A complete description of each function is given in the Function Reference section. Information on individual functions can also be obtained using the Julia help system:
A few usage examples for
DetectionTheory functions are given in the next section.
Compute d' for an ABX task for an observer with a hit rate of 0.8 and a false alarm rate of 0.4. If we assume that the observer is following a differencing strategy, we can compute d' with:
dprimeABX(0.8, 0.4, "diff")
if we assume that the observer is using an independent observations strategy instead, we can compute d' with:
dprimeABX(0.8, 0.4, "IO")
d' for the same-different and odd-one-out tasks can also be computed for either the differencing, or the independent observations strategies. For an observer with a hit rate of 0.7 and a false alarm rate of 0.2 in the same-different task:
dprimeSD(0.7, 0.2, "diff") #differencing strategy dprimeSD(0.7, 0.2, "IO") #independent observations strategy
for an observer with a proportion of correct responses of 0.7 in the odd-one-out task:
dprimeOddity(0.7, "diff") #differencing strategy dprimeOddity(0.7, "IO") #independent observations strategy
To compute d' in a Yes-No task for an observer with a hit rate of 0.6 and a false alarm rate of 0.3:
To compute the d' value corresponding to a proportion of correct responses of 0.75 in a 2-alternatives forced choice task:
for a 3-alternatives forced choice task: