-
Notifications
You must be signed in to change notification settings - Fork 1
/
Get2DResults.m
84 lines (72 loc) · 5.58 KB
/
Get2DResults.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Basedir = '/storage/maullz/Contour_Inference_2018';
outdir = fullfile(Basedir,'Figures','2D_Figures');
if ~isdir(outdir)
mkdir(outdir)
end
sim_results_mat = {fullfile(Basedir,'Sim_47_results','60_subjects','Sim_47_60_subjects.mat'), ...
fullfile(Basedir,'Sim_47_results','120_subjects','Sim_47_120_subjects.mat'), ...
fullfile(Basedir,'Sim_47_results','240_subjects','Sim_47_240_subjects.mat'), ...
fullfile(Basedir,'Sim_47_results','480_subjects','Sim_47_480_subjects.mat'); ...
fullfile(Basedir,'Sim_48_results','60_subjects','Sim_48_60_subjects.mat'), ...
fullfile(Basedir,'Sim_48_results','120_subjects','Sim_48_120_subjects.mat'), ...
fullfile(Basedir,'Sim_48_results','240_subjects','Sim_48_240_subjects.mat'), ...
fullfile(Basedir,'Sim_48_results','480_subjects','Sim_48_480_subjects.mat'); ...
fullfile(Basedir,'Sim_49_results','60_subjects','Sim_49_60_subjects.mat'), ...
fullfile(Basedir,'Sim_49_results','120_subjects','Sim_49_120_subjects.mat'), ...
fullfile(Basedir,'Sim_49_results','240_subjects','Sim_49_240_subjects.mat'), ...
fullfile(Basedir,'Sim_49_results','480_subjects','Sim_49_480_subjects.mat'); ...
fullfile(Basedir,'Sim_50_results','60_subjects','Sim_50_60_subjects.mat'), ...
fullfile(Basedir,'Sim_50_results','120_subjects','Sim_50_120_subjects.mat'), ...
fullfile(Basedir,'Sim_50_results','240_subjects','Sim_50_240_subjects.mat'), ...
fullfile(Basedir,'Sim_50_results','480_subjects','Sim_50_480_subjects.mat')};
sim_results_mat_dim = size(sim_results_mat);
nominal_levels = [80, 90, 95];
nominal_prct_levels = nominal_levels/100;
nominal_levels_dim = size(nominal_levels);
result = load(sim_results_mat{1});
nRlz = result.nRlz;
std_error_vector = zeros(nominal_levels_dim);
sim_covering_levels_and_subs = zeros([5 4 4 3]);
for i = 1:nominal_levels_dim(2)
std_error = sqrt((nominal_prct_levels(i)*(1 - nominal_prct_levels(i)))/nRlz);
std_error_vector(i) = std_error;
for j = 1:sim_results_mat_dim(1)
for k = 1:sim_results_mat_dim(2)
temp = load(char(sim_results_mat(j,k)));
raw_result = sprintf('percentage_success_vector_raw_%d_alternate', nominal_levels(i));
raw_mean_quantile_value = sprintf('threshold_raw_%d_store', nominal_levels(i));
observed_result = sprintf('percentage_success_vector_observed_%d_alternate', nominal_levels(i));
observed_mean_quantile_value = sprintf('threshold_observed_%d_store', nominal_levels(i));
nSubj = sprintf('nSubj');
sim_covering_levels_and_subs(1,k,j,i) = temp.(raw_result);
sim_covering_levels_and_subs(2,k,j,i) = temp.(observed_result);
sim_covering_levels_and_subs(3,k,j,i) = mean(temp.(raw_mean_quantile_value));
sim_covering_levels_and_subs(4,k,j,i) = mean(temp.(observed_mean_quantile_value));
sim_covering_levels_and_subs(5,k,j,i) = temp.(nSubj);
end
end
end
results_params = struct('nom_80_results', struct('nominal_level', nominal_levels(1), ...
'nominal_prct_level', nominal_prct_levels(1), ...
'std_error', std_error_vector(1), ...
'sig_1_std_1_results', sim_covering_levels_and_subs(:,:,1,1), ...
'sig_1_std_2_results', sim_covering_levels_and_subs(:,:,2,1), ...
'sig_2_std_1_results', sim_covering_levels_and_subs(:,:,3,1), ...
'sig_2_std_2_results', sim_covering_levels_and_subs(:,:,4,1)), ...
'nom_90_results', struct('nominal_level', nominal_levels(2), ...
'nominal_prct_level', nominal_prct_levels(2), ...
'std_error', std_error_vector(2), ...
'sig_1_std_1_results', sim_covering_levels_and_subs(:,:,1,2), ...
'sig_1_std_2_results', sim_covering_levels_and_subs(:,:,2,2), ...
'sig_2_std_1_results', sim_covering_levels_and_subs(:,:,3,2), ...
'sig_2_std_2_results', sim_covering_levels_and_subs(:,:,4,2)), ...
'nom_95_results', struct('nominal_level', nominal_levels(3), ...
'nominal_prct_level', nominal_prct_levels(3), ...
'std_error', std_error_vector(3), ...
'sig_1_std_1_results', sim_covering_levels_and_subs(:,:,1,3), ...
'sig_1_std_2_results', sim_covering_levels_and_subs(:,:,2,3), ...
'sig_2_std_1_results', sim_covering_levels_and_subs(:,:,3,3), ...
'sig_2_std_2_results', sim_covering_levels_and_subs(:,:,4,3)) ...
);
filename = fullfile(outdir, '2DResults.mat');
save(filename,'results_params');