A module for computing signal detection theory measures. |
pysdt
– Signal Detection Theory Measures¶A module for computing signal detection theory measures. Some of the functions in this module have been ported to python from the ‘psyphy’ R package of Kenneth Knoblauch http://cran.r-project.org/web/packages/psyphy/index.html
Compute proportions with optional corrections for extreme proportions.
Number of correct ‘A’ trials
Number of total ‘A’ trials
Number of incorrect ‘B’ trials
Number of total ‘B’ trials
The correction to apply, none for no correction, ‘loglinear` for the log-linear correction, and 2N for the ‘2N’ correction.
Hit rate
False alarm rate
References
Hautus, M. J. (1995). Corrections for extreme proportions and their biasing effects on estimated values of d’. Behavior Research Methods, Instruments, & Computers, 27(I), 46–51. http://doi.org/10.3758/BF03203619
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Examples
>>> H,F = compute_proportions(8, 10, 2, 10, "loglinear")
>>> H,F = compute_proportions(10, 10, 2, 10, "loglinear")
>>> H,F = compute_proportions(10, 10, 2, 10, "2N")
Compute d’ for ABX task from ‘hit’ and ‘false alarm’ rates.
Hit rate.
False alarms rate.
‘diff’ for differencing strategy or ‘IO’ for independent observations strategy.
d’ value
References
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Examples
>>> dp = dprime_ABX(0.7, 0.2, 'IO')
>>> dp = dprime_ABX(0.7, 0.2, 'diff')
Compute d’ for ABX task from counts of correct and total responses.
Number of correct responses in ‘same’ trials.
Total number of ‘same’ trials.
Number of correct responses in ‘different’ trials.
Total number of ‘different’ trials.
‘diff’ for differencing strategy or ‘IO’ for independent observations strategy.
if True, apply the correction to avoid hit and false alarm rates of 0 or one.
d’ value
References
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Examples
>>> dp = dprime_ABX(0.7, 0.2, 'IO')
Compute d’ for one interval same/different task from ‘hit’ and ‘false alarm’ rates.
Hit rate.
False alarms rate.
‘diff’ for differencing strategy or ‘IO’ for independent observations strategy.
d’ value
References
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Examples
>>> dp = dprime_SD(0.7, 0.2, 'IO')
Compute d’ for one interval same/different task from counts of correct and total responses.
Number of correct responses in ‘same’ trials.
Total number of ‘same’ trials.
Number of correct responses in ‘different’ trials.
Total number of ‘different’ trials.
‘diff’ for differencing strategy or ‘IO’ for independent observations strategy.
if True, apply the correction to avoid hit and false alarm rates of 0 or one.
d’ value
References
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Examples
>>> dp = dprime_SD(0.7, 0.2, 'IO')
Compute d’ corresponding to a certain proportion of correct responses in m-AFC tasks.
Proportion of correct responses.
Number of alternatives.
d’ value
References
Green, D. M., & Swets, J. A. (1988). Signal Detection Theory and Psychophysics. Los Altos, California: Peninsula Publishing.
Green, D. M., & Dai, H. P. (1991). Probability of being correct with 1 of M orthogonal signals. Perception & Psychophysics, 49(1), 100–101.
Examples
>>> dp = dprime_mAFC(0.7, 3)
Compute d’ for oddity task from proportion of correct responses. Only valid for the case in which there are three presentation intervals.
Proportion of correct responses.
‘diff’ for differencing strategy or ‘IO’ for independent observations strategy.
d’ value
References
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Versfeld, N. J., Dai, H., & Green, D. M. (1996). The optimum decision rules for the oddity task. Perception & Psychophysics, 58(1), 10–21.
Examples
>>> dp = dprime_oddity(0.7)
>>> dp = dprime_oddity(0.8)
Compute d’ for one interval ‘yes/no’ type tasks from hits and false alarm rates.
Hit rate.
False alarms rate.
d’ value
References
Green, D. M., & Swets, J. A. (1988). Signal Detection Theory and Psychophysics. Los Altos, California: Peninsula Publishing.
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Examples
>>> dp = dprime_yes_no(0.7, 0.2)
Compute d’ for one interval ‘yes/no’ type tasks from counts of correct and total responses.
Number of correct responses in ‘signal’ trials.
Total number of ‘signal’ trials.
Number of correct responses in ‘noise’ trials.
Total number of ‘noise’ trials.
if True, apply the correction to avoid hit and false alarm rates of 0 or one.
d’ value
References
Green, D. M., & Swets, J. A. (1988). Signal Detection Theory and Psychophysics. Los Altos, California: Peninsula Publishing.
Macmillan, N. A., & Creelman, C. D. (2004). Detection Theory: A User’s Guide (2nd ed.). London: Lawrence Erlbraum Associates.
Examples
>>> dp = dprime_yes_no_from_counts(nCA=70, nTA=100, nCB=80, nTB=100, corr=True)
Compute the gaussian psychometric function.
Stimulus level(s).
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function (guess rate).
The lapse rate.
Proportion correct at the stimulus level(s) x.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the gumbel psychometric function.
Stimulus level(s).
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function (guess rate).
The lapse rate.
Proportion correct at the stimulus level(s) x.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the inverse gaussian psychometric function.
Proportion correct on the psychometric function.
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function.
The lapse rate.
Stimulus level at which proportion correct equals p for the listener specified by the function.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the inverse gumbel psychometric function.
Proportion correct on the psychometric function.
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function.
The lapse rate.
Stimulus level at which proportion correct equals p for the listener specified by the function.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the inverse logistic psychometric function.
Proportion correct on the psychometric function.
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function.
The lapse rate.
Stimulus level at which proportion correct equals p for the listener specified by the function.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the inverse weibull psychometric function.
Proportion correct on the psychometric function.
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function.
The lapse rate.
Stimulus level at which proportion correct equals p for the listener specified by the function.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the logistic psychometric function.
Stimulus level(s).
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function (guess rate).
The lapse rate.
Proportion correct at the stimulus level(s) x.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.
Compute the weibull psychometric function.
Stimulus level(s).
Mid-point(s) of the psychometric function.
The slope of the psychometric function.
Lower limit of the psychometric function (guess rate).
The lapse rate.
Proportion correct at the stimulus level(s) x.
References
Kingdom, F. A. A., & Prins, N. (2010). Psychophysics: A Practical Introduction. Academic Press.