forked from nacemikus/STE_model
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecovery_figures.m
More file actions
46 lines (34 loc) · 1.11 KB
/
recovery_figures.m
File metadata and controls
46 lines (34 loc) · 1.11 KB
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
function recovery_figures(recov)
all_params = fieldnames(recov);
all_params(ismember(all_params, {'LME', 'AIC', 'BIC', 'est'})) = [];
for iP = 1:numel(all_params)
sim = recov.(all_params{iP}).sim;
est = recov.(all_params{iP}).est;
valid = ~isnan(est);
sim = sim(valid);
est = est(valid);
figname = all_params{iP};
if strcmp(recov.(all_params{iP}).space, 'log')
sim = log(sim);
est = log(est);
figname = ['log(', figname, ')'];
elseif strcmp(recov.(all_params{iP}).space, 'logit')
sim = tapas_logit(sim, 1);
est = tapas_logit(est, 1);
figname = ['logit(', figname, ')'];
end
figure('name', figname);
hold on;
scatter(sim, est, 40);
h = refline(1,0);
h.Color = [0.8500 0.3250 0.0980];
xlabel('Simulated');
ylabel('Estimated');
corr_string = sprintf("%s\nPearson's r = %.3f; Spearman's \\rho = %.3f; Kendall's \\tau = %.3f", ...
figname,...
corr(sim, est), ...
corr(sim, est, 'type', 'Spearman'), ...
corr(sim, est, 'type', 'Kendall'));
title(corr_string)
end
end