-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrocCurveAnalysis.m
35 lines (27 loc) · 952 Bytes
/
rocCurveAnalysis.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%% ROC CURVE ANALYSIS FOR VARYING THRESHOLD T AND CONSECUTIVE VALUES K
% Correlation threshold
T = 0.1:0.01:1;
% Within SURROUNDING SAMPLES
for ix = 1:length(T)
corr_values_above_T_within(ix) = sum(corr_mat_surr>T(ix));
ratio_corr_values_within(ix) = corr_values_above_T_within(ix)/length(corr_mat_surr);
% [n,~] = hist(corr_values_above_T,xc);
% pdf(ix,:) = smooth(smooth(n/sum(n)));
% figure
% plot(x,pdf(ix,:))
% title(['k=' num2str(T(ix))])
end
% Between FAR SAMPLES with a GAP in the middle
for ix = 1:length(T)
corr_values_above_T_between(ix) = sum(corr_mat_beyond>T(ix));
ratio_corr_values_between(ix) = ...
corr_values_above_T_between(ix)/length(corr_mat_beyond);
% [n,~] = hist(corr_values_above_T,xc);
% pdf(ix,:) = smooth(smooth(n/sum(n)));
% figure
% plot(x,pdf(ix,:))
% title(['k=' num2str(T(ix))])
end
%% ROC CURVE
figure
plot(ratio_corr_values_between,ratio_corr_values_within)