Structs
SignalDetectionModels.SDT — Type
SDT{T <: Real} <: AbstractSDTFields
d::T: discriminabilityc::T: criterion relative optimal valueσₛ::T: standard deviation of noise distributionnₙ::Int: number of noise trialsnₛ::Int: number of signal trials
Constructors
SDT(; d, c, σₛ = 1.0, nₙ, nₛ = nₙ)
SDT(d, c, σₛ, nₙ, nₛ)References
Stanislaw, H., & Todorov, N. (1999). Calculation of signal detection theory measures. Behavior Research Methods, Instruments, & Computers, 31(1), 137-149.
Functions
SignalDetectionModels.compute_c — Function
compute_c(model::AbstractSDT)Computes criterion c.
Arguments
model::AbstractSDT: abstract signal detection theory model
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = 0.0, nₙ = 100)
data = compute_c(model)compute_c(hr::Real, far::Real, σₛ = 1.0)Computes criterion c.
Arguments
hr::Real: hit ratefar::Real: false alarm rateσₛ = 1.0: standard deviation of the signal distribution
Example
using SignalDetectionModels
hr = .90
far = .05
compute_c(hr, far)SignalDetectionModels.compute_d — Function
compute_d(model::AbstractSDT)Computes discriminability d.
Arguments
model::AbstractSDT: abstract signal detection theory model
compute_d(hr::Real, far::Real, σₛ = 1.0)Computes discriminability d.
Arguments
hr::Real: hit ratefar::Real: false alarm rateσₛ = 1.0: standard deviation of the signal distribution
Example
using SignalDetectionModels
hr = .90
far = .05
compute_d(hr, far)SignalDetectionModels.compute_far — Function
compute_far(model::AbstractSDT)Computes false alarm rate.
Arguments
model::AbstractSDT: abstract signal detection theory model
SignalDetectionModels.compute_hr — Function
compute_hr(model::AbstractSDT)Computes hit rate.
Arguments
model::AbstractSDT: abstract signal detection theory model
Distributions.logpdf — Function
logpdf(model::AbstractSDT, data::Vector{Int})Compute log likelihood of data based on signal detection theory model.
Arguments
model::AbstractSDT: abstract signal detection theory modeldata::Vector{Int}: data vector containing the hit count and false alarm count
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = 0.0, nₙ = 100)
data = rand(model)
LL = logpdf(model, data)Base.rand — Function
rand(model::AbstractSDT)Generates simulated data from model.
Arguments
model::AbstractSDT: abstract signal detection theory model
Returns
data::Vector{Int}: data vector containing the hit count and false alarm count
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = 0.0, nₙ = 100)
data = rand(model)Plotting
SignalDetectionModels.plot_distributions — Function
plot_distributions(
model::AbstractSDT;
far_color = RGB(99/255, 144/255, 166/255),
hr_color = RGB(67 / 255, 97 / 255, 112 / 255),
config...
)Generates a plot of a noise and signal distribution with the criterion represented as a vertical line.
Arguments
model::AbstractSDT: an abstract signal detection theory model
Keywords
far_color = RGB(99/255, 144/255, 166/255): the color of the false alarm rate of the noise distributionhr_color = RGB(67 / 255, 97 / 255, 112 / 255): the color of hit rate area of the signal distributionconfig...: optional keyword arguments to configure plot
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = .50, σₛ = 1.5, nₙ = 100)
plot_distributions(model)SignalDetectionModels.plot_iso_bias — Function
plot_iso_bias(model::AbstractSDT; config...)Generates a plot of bias ('c') as a function of false alarm rate and hit rate.
Arguments
model::AbstractSDT: an abstract signal detection theory model
Keywords
config...: optional keyword arguments to configure plot
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = .50, σₛ = 1.5, nₙ = 100)
plot_iso_bias(model)SignalDetectionModels.plot_iso_sensitivity — Function
plot_iso_sensitivity(model::AbstractSDT; config...)Generates a plot of sensitivity ('d') as a function of false alarm rate and hit rate.
Arguments
model::AbstractSDT: an abstract signal detection theory model
Keywords
config...: optional keyword arguments to configure plot
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = .50, σₛ = 1.5, nₙ = 100)
plot_iso_sensitivity(model)SignalDetectionModels.plot_ROC — Function
plot_ROC(model::AbstractSDT; config...)Generates a plot of the receiver operating characteristic (ROC).
Arguments
model::AbstractSDT: an abstract signal detection theory model
Keywords
config...: optional keyword arguments to configure plot
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = .50, σₛ = 1.5, nₙ = 100)
plot_ROC(model)SignalDetectionModels.plot_zROC — Function
plot_zROC(model::AbstractSDT; config...)Generates a plot of the z-receiver operating characteristic (zROC).
Arguments
model::AbstractSDT: an abstract signal detection theory model
Keywords
config...: optional keyword arguments to configure plot
Example
using SignalDetectionModels
model = SDT(; d = 2.0, c = .50, σₛ = 1.5, nₙ = 100)
plot_zROC(model)