海南网站建设方面,网站开发人员招募费用,郑州整站网站优化,谷歌关键词搜索工具信号检测理论#xff08;Signal Detection Theory, SDT#xff09;模拟是一种实验设计#xff0c;用于研究和理解在存在噪声或不确定性的情况下如何做出决策。在心理学、认知科学、工程学和许多其他领域#xff0c;信号检测理论都非常重要。 一、基础概念#xff1a;
在信…信号检测理论Signal Detection Theory, SDT模拟是一种实验设计用于研究和理解在存在噪声或不确定性的情况下如何做出决策。在心理学、认知科学、工程学和许多其他领域信号检测理论都非常重要。 一、基础概念
在信号检测理论的模拟中通常会涉及以下几个关键概念
信号Signal需要被检测或识别的刺激或信息。 噪声Noise干扰信号检测的背景或无关信息。 决策标准Decision Criterion用于判断信号是否存在的阈值或标准。
击中Hit当信号实际存在且被正确检测到时的情况。 漏报Miss当信号实际存在但未被检测到时的情况。 虚报False Alarm当信号实际上不存在但被错误地检测为存在时的情况。 正确否定Correct Rejection当信号实际上不存在且被正确地判断为不存在时的情况。 二、统计决策理论
1两个分布的重叠程度决定了被试对信号和噪音的辨别力感受性 d ′ d d′被称为辨别力指数灵敏度。可以有两个分布的均值差来决定。 重叠越多辨别力指数越小辨别力越弱。 重叠越少辨别力指数越大辨别力越强。
特别地 d ′ 0 d0 d′0均值相同完全重叠不一定重合无法辨别。
2被试的决策标准决定了其反应倾向
定义 C C C决策标准 C的右边判断为“有”左边判断为“无”
定义 β β β似然比可由 Y 击中 Y 虚报 \frac{Y击中}{Y虚报} Y虚报Y击中得到一般给出β后即可通过计算来确定C的位置大小。 β 1 β1 β1 严格——被试的判断倾向于“无” β 1 β1 β1 中等——被试的判断“均等” β 1 β1 β1 宽松——被试的判断倾向于“有”
3ROC曲线
一般也叫等感受曲线有以下几个特点
[1]击中率和虚报率呈正相关关系C增大二者同时减小C减小标准变松二者同时增大。 [2]击中率不等于虚报率
存在3中极端情况 1击中率0C趋近于正无穷 2击中率1C趋近于负无穷 3 d ′ 0 d0 d′0曲线完全重叠均值相同 这三种情况意义不大
[3]越往左下反应标准越严 β β β越大C越大 [4] d ′ d d′越大曲线区分度越大 三、示例
下面是一个示例Julia文件
1) Let’s simulate 2 signal distributions, plot them, and compute d’ and the probabilities of the four outcomes with a specific criterion
using Distributions
using PlotlyJS# --- Signal Detection Theory Simulation --- 信号检测理论Signal Detection Theory, SDT# 1. Parameters
dPrime 1.5 # Sensitivity (d)灵敏度判别力指数
criterion 0.8 # Response criterion判断标准# 2. Distributions
dist_noise Normal(0, 1) # Noise distribution 噪声分布
dist_signal Normal(dPrime, 1) # Signal noise distribution 信号噪声分布# 3. Generate trials
nTrials 1000
signalPresent rand(Bernoulli(0.5), nTrials) # 生成一个布尔数组每个元素表示一次试验中信号是否出现50% signal presence
stimuli signalPresent .* rand(dist_signal, nTrials) (1 .- signalPresent) .* rand(dist_noise, nTrials)# 4. Apply criterion
responses stimuli . criterion # 生成一个布尔值数组responses大于criterion的为true否则为false
# 5. Calculate outcomes
hits sum(responses[signalPresent]) # 击中
misses sum(.!responses[signalPresent]) # 漏报
falseAlarms sum(responses[.!signalPresent]) # 虚报
correctRejections sum(.!responses[.!signalPresent]) # 正确否定# --- Visualization with PlotlyJS ---# Generate data for histograms
noise_data rand(dist_noise, 10000)
signal_data rand(dist_signal, 10000)
y max
# Create the histogram traces
noise_trace PlotlyJS.histogram(xnoise_data, nameNoise, opacity0.5)
signal_trace PlotlyJS.histogram(xsignal_data, nameSignal Noise, opacity0.5)# Create the criterion line trace画判断标准线
criterion_trace PlotlyJS.scatter(x[criterion, criterion], y[0, 600],modelines,nameCriterion,lineattr(colorred, dashdash)
)# Create the plot
plt PlotlyJS.plot([noise_trace, signal_trace, criterion_trace],Layout(xaxis_titleInternal Response,yaxis_titleFrequency,titleSignal Detection Theory Demonstration,barmodeoverlay)
)# Display the plot
display(plt)# Display results
println(d: , dPrime)
println(Criterion: , criterion)
println(Hits: , hits, (, round(hits / sum(signalPresent) * 100, digits2), %))
println(Misses: , misses, (, round(misses / sum(signalPresent) * 100, digits2), %))
println(False Alarms: , falseAlarms, (, round(falseAlarms / sum(.!signalPresent) * 100, digits2), %))
println(Correct Rejections: , correctRejections, (, round(correctRejections / sum(.!signalPresent) * 100, digits2), %))画出分布图像 上图红色虚线就是C蓝色分布是噪声红色是信号。
输出
d: 1.5
Criterion: 0.8
Hits: 369 (73.95%)
Misses: 130 (26.05%)
False Alarms: 89 (17.76%)
Correct Rejections: 412 (82.24%)ROC曲线相关
using Distributions
using PlotlyJS# --- Signal Detection Theory Simulation (Multiple d) --- 多个d的信号检测理论模拟# 1. Parameters
dPrimes [0.5, 1.0, 1.5, 2.0] # Range of sensitivities
criteria range(-3, 3, length100) # Range of criteria for ROC C变化范围# 2. Distributions
dist_noise Normal(0, 1) # Noise distribution 噪声分布# --- ROC Analysis and Visualization ---
# 准备一个ROC曲线图的布局为后续添加具体的ROC曲线数据做准备。
plt PlotlyJS.plot(Layout(xaxis_titleFalse Alarm Rate,yaxis_titleHit Rate,titleROC Curves for Different d,xaxis_range[0, 1],yaxis_range[0, 1],xaxis_constraindomain, # Ensure the x-axis stays within the plot areayaxisattr(scaleanchorx, # Link y-axis scaling to x-axisscaleratio1), # Maintain 1:1 aspect ratio))# Add diagonal reference line
PlotlyJS.add_trace!(plt, PlotlyJS.scatter(x[0, 1], y[0, 1], modelines, lineattr(colorgray, dashdash), nameChance Level))for dPrime in dPrimes# 根据不同的d生成不同的信号分布。因为噪声分布固定所以d的大小决定了信号分布的位置。dist_signal Normal(dPrime, 1) # Signal noise distribution 信号噪声分布# 3. Generate trials (for each d)nTrials 1000signalPresent rand(Bernoulli(0.5), nTrials)stimuli signalPresent .* rand(dist_signal, nTrials) (1 .- signalPresent) .* rand(dist_noise, nTrials)# 4. ROC CalculationhitRates zeros(length(criteria))falseAlarmRates zeros(length(criteria))for (i, criterion) in enumerate(criteria)responses stimuli . criterionhits sum(responses[signalPresent])falseAlarms sum(responses[.!signalPresent])hitRates[i] hits / sum(signalPresent)falseAlarmRates[i] falseAlarms / sum(.!signalPresent)end# 5. Add ROC Curve to PlotPlotlyJS.add_trace!(plt, PlotlyJS.scatter(xfalseAlarmRates, yhitRates, modelines, named $dPrime))
end# Display the plot
display(plt)画出ROC曲线 可以发现随 d ′ d d′增大图像越往上 思考
上面四个率和机器学习中的性能评估指标有相似之处 文章转载自: http://www.morning.zhnpj.cn.gov.cn.zhnpj.cn http://www.morning.gtylt.cn.gov.cn.gtylt.cn http://www.morning.dwkfx.cn.gov.cn.dwkfx.cn http://www.morning.tmbfz.cn.gov.cn.tmbfz.cn http://www.morning.bqwrn.cn.gov.cn.bqwrn.cn http://www.morning.gycyt.cn.gov.cn.gycyt.cn http://www.morning.bccls.cn.gov.cn.bccls.cn http://www.morning.rfdqr.cn.gov.cn.rfdqr.cn http://www.morning.hwbmn.cn.gov.cn.hwbmn.cn http://www.morning.tpbhf.cn.gov.cn.tpbhf.cn http://www.morning.cxsdl.cn.gov.cn.cxsdl.cn http://www.morning.nrftd.cn.gov.cn.nrftd.cn http://www.morning.rbhcx.cn.gov.cn.rbhcx.cn http://www.morning.bzbq.cn.gov.cn.bzbq.cn http://www.morning.zsyqg.cn.gov.cn.zsyqg.cn http://www.morning.mpwgs.cn.gov.cn.mpwgs.cn http://www.morning.fwcjy.cn.gov.cn.fwcjy.cn http://www.morning.yxshp.cn.gov.cn.yxshp.cn http://www.morning.zkzjm.cn.gov.cn.zkzjm.cn http://www.morning.rxxdk.cn.gov.cn.rxxdk.cn http://www.morning.rpsjh.cn.gov.cn.rpsjh.cn http://www.morning.dlbpn.cn.gov.cn.dlbpn.cn http://www.morning.lcqrf.cn.gov.cn.lcqrf.cn http://www.morning.qynpw.cn.gov.cn.qynpw.cn http://www.morning.mpflb.cn.gov.cn.mpflb.cn http://www.morning.ljdhj.cn.gov.cn.ljdhj.cn http://www.morning.sgbjh.cn.gov.cn.sgbjh.cn http://www.morning.dhyzr.cn.gov.cn.dhyzr.cn http://www.morning.qbwyd.cn.gov.cn.qbwyd.cn http://www.morning.rpwht.cn.gov.cn.rpwht.cn http://www.morning.ltqzq.cn.gov.cn.ltqzq.cn http://www.morning.ghfrb.cn.gov.cn.ghfrb.cn http://www.morning.kpcxj.cn.gov.cn.kpcxj.cn http://www.morning.mcpdn.cn.gov.cn.mcpdn.cn http://www.morning.hgscb.cn.gov.cn.hgscb.cn http://www.morning.kjcll.cn.gov.cn.kjcll.cn http://www.morning.mbrbg.cn.gov.cn.mbrbg.cn http://www.morning.qpnmd.cn.gov.cn.qpnmd.cn http://www.morning.jrdbq.cn.gov.cn.jrdbq.cn http://www.morning.sxhdzyw.com.gov.cn.sxhdzyw.com http://www.morning.bssjz.cn.gov.cn.bssjz.cn http://www.morning.jgykx.cn.gov.cn.jgykx.cn http://www.morning.rqbr.cn.gov.cn.rqbr.cn http://www.morning.ntlxg.cn.gov.cn.ntlxg.cn http://www.morning.xnyfn.cn.gov.cn.xnyfn.cn http://www.morning.rjrnx.cn.gov.cn.rjrnx.cn http://www.morning.nhrkl.cn.gov.cn.nhrkl.cn http://www.morning.crhd.cn.gov.cn.crhd.cn http://www.morning.pabxcp.com.gov.cn.pabxcp.com http://www.morning.zmnyj.cn.gov.cn.zmnyj.cn http://www.morning.rqgjr.cn.gov.cn.rqgjr.cn http://www.morning.jbblf.cn.gov.cn.jbblf.cn http://www.morning.hdtcj.cn.gov.cn.hdtcj.cn http://www.morning.lxjcr.cn.gov.cn.lxjcr.cn http://www.morning.prprz.cn.gov.cn.prprz.cn http://www.morning.gqjqf.cn.gov.cn.gqjqf.cn http://www.morning.jqrp.cn.gov.cn.jqrp.cn http://www.morning.xwgbr.cn.gov.cn.xwgbr.cn http://www.morning.nxzsd.cn.gov.cn.nxzsd.cn http://www.morning.plwfx.cn.gov.cn.plwfx.cn http://www.morning.jlqn.cn.gov.cn.jlqn.cn http://www.morning.zlgth.cn.gov.cn.zlgth.cn http://www.morning.ylsxk.cn.gov.cn.ylsxk.cn http://www.morning.csdgt.cn.gov.cn.csdgt.cn http://www.morning.rtpw.cn.gov.cn.rtpw.cn http://www.morning.nrcbx.cn.gov.cn.nrcbx.cn http://www.morning.pznqt.cn.gov.cn.pznqt.cn http://www.morning.jqkjr.cn.gov.cn.jqkjr.cn http://www.morning.dfhkh.cn.gov.cn.dfhkh.cn http://www.morning.rxfbf.cn.gov.cn.rxfbf.cn http://www.morning.bmssj.cn.gov.cn.bmssj.cn http://www.morning.zhqfn.cn.gov.cn.zhqfn.cn http://www.morning.qtkdn.cn.gov.cn.qtkdn.cn http://www.morning.trhrk.cn.gov.cn.trhrk.cn http://www.morning.wrcgy.cn.gov.cn.wrcgy.cn http://www.morning.sbwr.cn.gov.cn.sbwr.cn http://www.morning.pjwml.cn.gov.cn.pjwml.cn http://www.morning.mxptg.cn.gov.cn.mxptg.cn http://www.morning.nnwnl.cn.gov.cn.nnwnl.cn http://www.morning.mlbdr.cn.gov.cn.mlbdr.cn