Commit 99e1a80f by Chiara Antonini

update covid19

1 parent ba01dbde
Showing 150 changed files with 64 additions and 49 deletions
...@@ -8,13 +8,13 @@ b1=p(3); ...@@ -8,13 +8,13 @@ b1=p(3);
b2=p(4); b2=p(4);
b3=p(5); b3=p(5);
N=10^5; Norm=10^5;
be=be/(N); be=be/(Norm);
b0=b0/(N); b0=b0/(Norm);
b1=b1/(N); b1=b1/(Norm);
b2=b2/(N); b2=b2/(Norm);
b3=b3/(N); b3=b3/(Norm);
FracSevere = p(6); FracSevere = p(6);
FracCritical = p(7); FracCritical = p(7);
...@@ -54,7 +54,7 @@ g3=(1/TimeICUDeath)-u; ...@@ -54,7 +54,7 @@ g3=(1/TimeICUDeath)-u;
s0 = (t<Tlock(2)) + s00(1) * (t>=Tlock(2)) * (t<Tlock(3)) + s00(2)*(t>=Tlock(3)) * (t<Tlock(4)) + s00(3)*(t>=Tlock(4)); s0 = (t<Tlock(2)) + s00(1) * (t>=Tlock(2)) * (t<Tlock(3)) + s00(2)*(t>=Tlock(3)) * (t<Tlock(4)) + s00(3)*(t>=Tlock(4));
s1 = (t<Tlock(2)) + s11(1) * (t>=Tlock(2)) * (t<Tlock(3)) + s11(2)*(t>=Tlock(3))* (t<Tlock(4)) + s00(3)*(t>=Tlock(4)); s1 = (t<Tlock(2)) + s11(1) * (t>=Tlock(2)) * (t<Tlock(3)) + s11(2)*(t>=Tlock(3))* (t<Tlock(4)) + s11(3)*(t>=Tlock(4));
s2 = (t<Tlock(1)) + s22 * (t>=Tlock(1)); s2 = (t<Tlock(1)) + s22 * (t>=Tlock(1));
%s3 = (t<Tlock(1)) + s33 * (t>=Tlock(1)); %s3 = (t<Tlock(1)) + s33 * (t>=Tlock(1));
......
...@@ -34,10 +34,16 @@ function compute_MIRI(model,variable_name,current_func,tail_size,current_tm,Nr,N ...@@ -34,10 +34,16 @@ function compute_MIRI(model,variable_name,current_func,tail_size,current_tm,Nr,N
nominal_parameters=model.nominal_parameters; nominal_parameters=model.nominal_parameters;
%num_parameters=length(nominal_parameters); %num_parameters=length(nominal_parameters);
nominal_parameters_name=model.nominal_parameters_name; nominal_parameters_name=model.nominal_parameters_name;
derived_parameters=model.derived_parameters;
derived_parameters_name=model.derived_parameters_name; if(isfield(model,'derived_parameters'))
num_parameters=length(nominal_parameters)+length(derived_parameters); derived_parameters=model.derived_parameters;
parameters_name=[nominal_parameters_name derived_parameters_name]; derived_parameters_name=model.derived_parameters_name;
num_parameters=length(nominal_parameters)+length(derived_parameters);
parameters_name=[nominal_parameters_name derived_parameters_name];
else
num_parameters=length(nominal_parameters);
parameters_name=[nominal_parameters_name];
end
obs_name=model.observables_name; obs_name=model.observables_name;
...@@ -131,16 +137,20 @@ try ...@@ -131,16 +137,20 @@ try
%[all_xbin_max,all_xbin_min,all_ks_max,all_ks_min]=obj_MIRI.estimate_parampdfs(handles1.nominal_p, handles1.perturbation, Ncloud, handles.XiMax, handles.XiMin); %[all_xbin_max,all_xbin_min,all_ks_max,all_ks_min]=obj_MIRI.estimate_parampdfs(handles1.nominal_p, handles1.perturbation, Ncloud, handles.XiMax, handles.XiMin);
[MIRI_param,CloudCondMin, CloudCondMax]=obj_MIRI.MIRI_computation(all_ks_max,all_ks_min,all_xbin_max,all_xbin_min); [MIRI_param,CloudCondMin, CloudCondMax]=obj_MIRI.MIRI_computation(all_ks_max,all_ks_min,all_xbin_max,all_xbin_min);
obj_MIRI_derived=MIRI(); if(isfield(model,'derived_parameters'))
[all_xbin_max_d,all_xbin_min_d,all_ks_max_d,all_ks_min_d]=obj_MIRI_derived.estimate_parampdfs(derived_parameters, AllDerivedParam{k,1}, XiMax, XiMin); obj_MIRI_derived=MIRI();
%[all_xbin_max,all_xbin_min,all_ks_max,all_ks_min]=obj_MIRI.estimate_parampdfs(handles1.nominal_p, handles1.perturbation, Ncloud, handles.XiMax, handles.XiMin); [all_xbin_max_d,all_xbin_min_d,all_ks_max_d,all_ks_min_d]=obj_MIRI_derived.estimate_parampdfs(derived_parameters, AllDerivedParam{k,1}, XiMax, XiMin);
[MIRI_param_d,CloudCondMin_d, CloudCondMax_d]=obj_MIRI_derived.MIRI_computation(all_ks_max_d,all_ks_min_d,all_xbin_max_d,all_xbin_min_d); %[all_xbin_max,all_xbin_min,all_ks_max,all_ks_min]=obj_MIRI.estimate_parampdfs(handles1.nominal_p, handles1.perturbation, Ncloud, handles.XiMax, handles.XiMin);
[MIRI_param_d,CloudCondMin_d, CloudCondMax_d]=obj_MIRI_derived.MIRI_computation(all_ks_max_d,all_ks_min_d,all_xbin_max_d,all_xbin_min_d);
MIRI_param=[MIRI_param MIRI_param_d]; MIRI_param=[MIRI_param MIRI_param_d];
CloudCondMax=[CloudCondMax CloudCondMax_d];
CloudCondMin=[CloudCondMin CloudCondMin_d];
end
MIRIT(k,:)=MIRI_param; MIRIT(k,:)=MIRI_param;
CloudCondMax=[CloudCondMax CloudCondMax_d];
CloudCondMin=[CloudCondMin CloudCondMin_d];
CloudCondMaxT=[CloudCondMaxT;CloudCondMax]; CloudCondMaxT=[CloudCondMaxT;CloudCondMax];
CloudCondMinT=[CloudCondMinT;CloudCondMin]; CloudCondMinT=[CloudCondMinT;CloudCondMin];
mean_CloudMax=mean(CloudCondMaxT); mean_CloudMax=mean(CloudCondMaxT);
...@@ -153,11 +163,13 @@ try ...@@ -153,11 +163,13 @@ try
ks_param{2,k}(ip,:)=all_ks_min(ip,:); ks_param{2,k}(ip,:)=all_ks_min(ip,:);
end end
for ip=1:length(derived_parameters) if(isfield(model,'derived_parameters'))
xbin_param_d{1,k}(ip,:)=all_xbin_max_d(ip,:); for ip=1:length(derived_parameters)
xbin_param_d{2,k}(ip,:)=all_xbin_min_d(ip,:); xbin_param_d{1,k}(ip,:)=all_xbin_max_d(ip,:);
ks_param_d{1,k}(ip,:)=all_ks_max_d(ip,:); xbin_param_d{2,k}(ip,:)=all_xbin_min_d(ip,:);
ks_param_d{2,k}(ip,:)=all_ks_min_d(ip,:); ks_param_d{1,k}(ip,:)=all_ks_max_d(ip,:);
ks_param_d{2,k}(ip,:)=all_ks_min_d(ip,:);
end
end end
end end
...@@ -196,8 +208,10 @@ try ...@@ -196,8 +208,10 @@ try
save(fullfile(folder,variable_name,'pdf_eval_func.mat'),'xbinT','ks_y_T'); save(fullfile(folder,variable_name,'pdf_eval_func.mat'),'xbinT','ks_y_T');
disp('saving probability density functions of all parameters') disp('saving probability density functions of all parameters')
save(fullfile(folder,variable_name,'pdf_param.mat'),'xbin_param','ks_param'); save(fullfile(folder,variable_name,'pdf_param.mat'),'xbin_param','ks_param');
save(fullfile(folder,variable_name,'pdf_param_derived.mat'),'xbin_param_d','ks_param_d');
if(isfield(model,'derived_parameters'))
save(fullfile(folder,variable_name,'pdf_param_derived.mat'),'xbin_param_d','ks_param_d');
end
catch ME catch ME
......
function R0=compute_R0(p)%,Tlock2,s02,s12) function R0=compute_R0(param)%,Tlock2,s02,s12)
be = p(1); be = param(1);
b0=p(2); b0=param(2);
b1=p(3); b1=param(3);
b2=p(4); b2=param(4);
b3=p(5); b3=param(5);
N=10^5; Norm=10^5; %882000
%Norm=882000;
be=be/(N);
b0=b0/(N); be=be/(Norm);
b1=b1/(N); b0=b0/(Norm);
b2=b2/(N); b1=b1/(Norm);
b3=b3/(N); b2=b2/(Norm);
b3=b3/(Norm);
FracSevere = p(6); FracSevere = param(6);
FracCritical = p(7); FracCritical = param(7);
FracMild = 1-FracSevere-FracCritical; FracMild = 1-FracSevere-FracCritical;
FracAsym = p(8); FracAsym = param(8);
IncubPeriod = p(9); IncubPeriod = param(9);
DurMildInf = p(10); DurMildInf = param(10);
DurAsym = p(11); DurAsym = param(11);
DurHosp = p(12); DurHosp = param(12);
TimeICUDeath = p(13); TimeICUDeath = param(13);
ProbDeath=p(14); ProbDeath=param(14);
PresymPeriod=p(15)*IncubPeriod;
PresymPeriod=param(15)*IncubPeriod;
%PresymPeriod=param(15);
CFR=ProbDeath*FracCritical/100; CFR=ProbDeath*FracCritical/100;
...@@ -54,4 +55,4 @@ g3=(1/TimeICUDeath)-u; ...@@ -54,4 +55,4 @@ g3=(1/TimeICUDeath)-u;
%s0 = (t<Tlock1) + s01 * (t>=Tlock1); %* (t<Tlock2) + s01(2)*(t>=Tlock2); %s0 = (t<Tlock1) + s01 * (t>=Tlock1); %* (t<Tlock2) + s01(2)*(t>=Tlock2);
%s1 = (t<Tlock1) + s11 * (t>=Tlock1); %* (t<Tlock2) + s11(2)*(t>=Tlock2); %s1 = (t<Tlock1) + s11 * (t>=Tlock1); %* (t<Tlock2) + s11(2)*(t>=Tlock2);
R0=N*(((be)/a1)+f*((b0)/g0)+(1-f)*(((b1)/(p1+g1))+(p1/(p1+g1))*(b2/(p2+g2)+ (p2/(p2+g2))*(b3/(u+g3)))));
\ No newline at end of file \ No newline at end of file
R0=Norm*(((be)/a1)+f*((b0)/g0)+(1-f)*(((b1)/(p1+g1))+(p1/(p1+g1))*(b2/(p2+g2)+ (p2/(p2+g2))*(b3/(u+g3)))));
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!