-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute_sobol_indices_doubling_time.m
63 lines (56 loc) · 2.58 KB
/
compute_sobol_indices_doubling_time.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
% % SCRIPT: compute_sobol_indices_doubling_time
% % AUTHOR: Fabian Santiago
% % EMAIL: fsantiago3@ucmerced.edu
% % DATE: 11/21/2020
% Make a folder to store DT Sobol indices if one does not exist
if ~exist('sobol_indices_dt', 'dir')
mkdir('sobol_indices_dt')
end
% Load parameter information for slobal sensitivity analysis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prms_info = fun_model_parameter_ranges;
% Load model solutions for each contact scenario
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
model_sols_file_id = dir('model_sols/');
model_sols_file_id(1:2) = [];
% Set sub-sampling size for bootstrapping and number of resamples
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sub_sample_size = 1500*(sum(prms_info(:,1))+2);
n_resamples = 2000; % Number of times to perform re-sampling
y_sol_idx = 1; % index of model solution of interest
% Compute Sensitivity Indices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for case_solution_idx = 1:numel(model_sols_file_id)
tic
% Load model solutions YA, YB, YA_Bj, and
% parameter information prms_info and prms_str
load(['model_sols/',model_sols_file_id(case_solution_idx).name])
% Display contact scenario being considered
disp(['contact scenario: ',num2str(class_cap)]);
% Compute first and total-order Sobol indices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[FirstOrderIdx,TotalOrderIdx,Stats] = ...
fun_sobol_indices_by_measure(...
y_sol_idx,...
sub_sample_size,...
n_resamples,...
YA_cell,...
YB_cell,...
YA_Bj_cell,...
prms_info(:,1)...
);
save(... % File name:
['sobol_indices_dt/Sobol_dt_'...
'sol',num2str(y_sol_idx),...
'sub',num2str(sub_sample_size),...
'rep',num2str(n_resamples),...
'CC_',num2str(class_cap),...
'Vu',num2str(Vu),'Vd',num2str(Vd),...
'Vg',num2str(Vg),'Vf',num2str(Vf),'.mat'],...
... % Variables to save:
'FirstOrderIdx',...
'TotalOrderIdx',...
'Stats',...
'class_cap');
disp(['cs: ',num2str(class_cap),', time: ',num2str(toc/60),'min']);
end