Statistics::SDT Perl package contains signal detection theory measures of sensitivity and response-bias.
$sdt = Statistics::SDT->new(
hits => 50,
signal_trials => 50,
false_alarms => 17,
noise_trials => 25,
correct => 2,
$d = $sdt->d_sensitivity();
$c = $sdt->decision_bias();
Signal Detection Theory algorithms (e.g., of d', A', decision bias), as prescribed by Stanislav & Todorov (1999). Both object- and function-oriented interfaces are provided.
For both object- and function-oriented styles, the following named parameters must be given as a hash-reference: either to the new constructor method, or (with the function-oriented style) into each function. Basically, either all of the first four parameters are required (in order to calculate the hit-rate and false-alarm-rate), or the required rates are themselves supplied.
The number of hits.
The number of false alarms.
The number of signal trials. The hit-rate is derived by dividing the number of hits by the number of signal trials.
The number of noise trials. The false-alarm-rate is derived by dividing the number of false-alarms by the number of noise trials.
The number of response alternatives. Default = 2 (for the classic signal-detection situation of discriminating between signal+noise and noise-only). If the number of alternatives is greater than 2, the measure of sensitivity, when calling d_sensitivity, is based on the Smith (1982) algorithms.
A parameter that indicates whether or not to perform a correction on the number of hits and false-alarms as a corrective when the hit-rate or false-alarm-rate equals 0 or 1 (due, e.g., to strong inducements against false-alarms, or easy discrimination between signals and noise). This is relevant to all functions that make use of the inverse phi function (all except a_sensitivity and griers_bias).
If set to greater than 1, the loglinear transformation is applied, i.e., 0.5 is added to both the number of hits and false-alarms, and 1 is added to the number of signal and noise trials. These adjustments are made irrespective of the extremity of the rates themselves.
If set to 1, extreme rates (of 0 and 1, only) are replaced with the number of signal/noise trials, moderated by a value of 0.5 (specifically, where n = number of signal or noise trials: 0 is replaced with 0.5 / n; 1 is replaced with (n - 0.5) / n.
Stanislav and Todorov (1999) advise that the latter correction is the most common method of handling extreme rates, but that it might bias sensitivity measures and not be as satisfactory as the loglinear transformation applied to all hits and false-alarms.
If set to zero (the default), no correction is performed to the calculation of the rates. This should only be used when you are using (1) the parametric measures and are sure the rates are not at the extremes of 0 and 1; or (2) the nonparametric algorithms (a_sensitivity and griers_bias). An alternative to these corrections is, indeed, to use the nonparametric measures.
This is the hit-rate. Instead of passing the number of hits and signal trials, give the hit-rate directly - but, if doing so, ensure the rate does not equal zero or 1 in order to avoid errors thrown by the inverse-phi function (which will be given as "ndtri domain error").
This is the false-alarm-rate. Instead of passing the number of false alarms and noise trials, give the false-alarm-rate directly - but, if doing so, ensure the rate does not equal zero or 1 in order to avoid errors thrown by the inverse-phi function (which will be given as "ndtri domain error").