commit
e1833c475d
|
@ -272,80 +272,8 @@ elseif opt_gsa.morris==3
|
|||
return
|
||||
elseif opt_gsa.morris==2 % ISKREV stuff
|
||||
return
|
||||
else % main effects analysis
|
||||
if itrans==0
|
||||
fsuffix = '';
|
||||
elseif itrans==1
|
||||
fsuffix = '_log';
|
||||
else
|
||||
fsuffix = '_rank';
|
||||
end
|
||||
|
||||
imap=1:npT;
|
||||
|
||||
if isempty(lpmat0)
|
||||
x0=lpmat(istable,:);
|
||||
else
|
||||
x0=[lpmat0(istable,:), lpmat(istable,:)];
|
||||
end
|
||||
nrun=length(istable);
|
||||
nest=min(250,nrun);
|
||||
|
||||
if opt_gsa.load_ident_files==0
|
||||
try
|
||||
EET=load([OutputDirectoryName,'/SCREEN/',fname_,'_morris_IDE'],'SAcc','ir_cc','ic_cc');
|
||||
catch
|
||||
EET=[];
|
||||
end
|
||||
ccac = gsa.standardize_columns([mss cc ac]);
|
||||
[pcc, dd] = eig(cov(ccac(istable,:)));
|
||||
[latent, isort] = sort(-diag(dd));
|
||||
latent = -latent;
|
||||
figure, bar(latent)
|
||||
title('Eigenvalues in PCA')
|
||||
pcc=pcc(:,isort);
|
||||
ccac = ccac*pcc;
|
||||
npca = max(find(cumsum(latent)./length(latent)<0.99))+1;
|
||||
siPCA = (EET.SAcc'*abs(pcc'))';
|
||||
siPCA = siPCA./(max(siPCA,[],2)*ones(1,npT));
|
||||
SAcc=zeros(size(ccac,2),npT);
|
||||
gsa_=NaN(npca);
|
||||
for j=1:npca %size(ccac,2),
|
||||
if itrans==0
|
||||
y0 = ccac(istable,j);
|
||||
elseif itrans==1
|
||||
y0 = gsa.log_transform(ccac(istable,j));
|
||||
else
|
||||
y0 = trank(ccac(istable,j));
|
||||
end
|
||||
if ~isempty(EET)
|
||||
imap=find(siPCA(j,:) >= (0.1.*max(siPCA(j,:))) );
|
||||
end
|
||||
gsa_(j) = gsa_sdp(y0(1:nest), x0(1:nest,imap), ...
|
||||
2, [],[],[],0,[OutputDirectoryName,'/map_cc',fsuffix,int2str(j)], pnames);
|
||||
SAcc(j,imap)=gsa_(j).si;
|
||||
imap_cc{j}=imap;
|
||||
end
|
||||
save([OutputDirectoryName,'/map_cc',fsuffix,'.mat'],'gsa_')
|
||||
save([OutputDirectoryName,'/',fname_,'_main_eff.mat'],'imap_cc','SAcc','ccac','-append')
|
||||
else
|
||||
load([OutputDirectoryName,'/',fname_,'_main_eff'],'SAcc')
|
||||
end
|
||||
|
||||
hh_fig=dyn_figure(options_.nodisplay,'Name',['Identifiability indices in the ',fsuffix,' moments.']);
|
||||
bar(sum(SAcc))
|
||||
set(gca,'xticklabel',' ','fontsize',10,'xtick',1:npT)
|
||||
set(gca,'xlim',[0.5 npT+0.5])
|
||||
ydum = get(gca,'ylim');
|
||||
set(gca,'ylim',[0 ydum(2)])
|
||||
set(gca,'position',[0.13 0.2 0.775 0.7])
|
||||
for ip=1:npT
|
||||
text(ip,-0.02*(ydum(2)),bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
|
||||
end
|
||||
xlabel(' ')
|
||||
title(['Identifiability indices in the ',fsuffix,' moments.'],'interpreter','none')
|
||||
dyn_saveas(hh_fig,[OutputDirectoryName,'/',fname_,'_ident_ALL',fsuffix],options_.nodisplay,options_.graph_format);
|
||||
create_TeX_loader(options_,[OutputDirectoryName,'/',fname_,'_ident_ALL',fsuffix],1,['Identifiability indices in the ',fsuffix,' moments.'],['ident_ALL',fsuffix]',1)
|
||||
else
|
||||
error('gsa/map_identification: unsupported option morris=%u',opt_gsa.morris)
|
||||
end
|
||||
|
||||
function []=create_TeX_loader(options_,figpath,ifig_number,caption,label_name,scale_factor)
|
||||
|
|
|
@ -736,7 +736,7 @@ if iload <=0
|
|||
end
|
||||
run_index = 0; % reset index
|
||||
end
|
||||
if SampleSize > 1
|
||||
if SampleSize > 1 && mod(iteration,3)
|
||||
dyn_waitbar(iteration/SampleSize, h, ['MC identification checks ', int2str(iteration), '/', int2str(SampleSize)]);
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ function [cmm, mm] = simulated_moment_uncertainty(indx, periods, replic,options_
|
|||
% - cmm: [n_moments by n_moments] covariance matrix of simulated moments
|
||||
% - mm: [n_moments by replic] matrix of moments
|
||||
|
||||
% Copyright © 2009-2018 Dynare Team
|
||||
% Copyright © 2009-2024 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -60,15 +60,10 @@ end
|
|||
|
||||
oo_.dr=set_state_space(oo_.dr,M_);
|
||||
|
||||
|
||||
if options_.logged_steady_state %if steady state was previously logged, undo this
|
||||
oo_.dr.ys=exp(oo_.dr.ys);
|
||||
oo_.steady_state=exp(oo_.steady_state);
|
||||
options_.logged_steady_state=0;
|
||||
logged_steady_state_indicator=1;
|
||||
evalin('base','options_.logged_steady_state=0;')
|
||||
else
|
||||
logged_steady_state_indicator=0;
|
||||
end
|
||||
|
||||
[oo_.dr,info,M_.params] = compute_decision_rules(M_,options_,oo_.dr, oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state);
|
||||
|
@ -92,7 +87,6 @@ else
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
for j=1:replic
|
||||
[ys, oo_.exo_simul] = simult(y0,oo_.dr,M_,options_);%do simulation
|
||||
oo_=disp_moments(ys, options_.varobs,M_,options_,oo_); %get moments
|
||||
|
@ -106,8 +100,5 @@ for j=1:replic
|
|||
end
|
||||
dyn_waitbar_close(h);
|
||||
|
||||
if logged_steady_state_indicator
|
||||
evalin('base','options_.logged_steady_state=1;') %reset base workspace option to conform to base oo_
|
||||
end
|
||||
cmm = cov(mm');
|
||||
disp('Simulated moment uncertainty ... done!')
|
||||
|
|
Loading…
Reference in New Issue