Merge remote-tracking branch 'remotes/personal/gsa' into gsa
commit
6a4f79684c
|
@ -87,7 +87,8 @@ end
|
||||||
irestrictions=irestrictions(find(irestrictions));
|
irestrictions=irestrictions(find(irestrictions));
|
||||||
xmat=lpmat(irestrictions,:);
|
xmat=lpmat(irestrictions,:);
|
||||||
skipline()
|
skipline()
|
||||||
save([OutputDirectoryName,filesep,fname_,'_',type,'_restrictions'],'xmat','mat_irf','mat_moment','irestrictions','indx_irf','indx_moment');
|
endo_prior_restrictions=DynareOptions.endogenous_prior_restrictions;
|
||||||
|
save([OutputDirectoryName,filesep,fname_,'_',type,'_restrictions'],'xmat','mat_irf','mat_moment','irestrictions','indx_irf','indx_moment','endo_prior_restrictions');
|
||||||
|
|
||||||
if ~isempty(indx_irf),
|
if ~isempty(indx_irf),
|
||||||
indx_irf = indx_irf(irestrictions,:);
|
indx_irf = indx_irf(irestrictions,:);
|
||||||
|
@ -97,6 +98,13 @@ if ~isempty(indx_irf),
|
||||||
if nrow*(nrow-1)>nbr_irf_restrictions,
|
if nrow*(nrow-1)>nbr_irf_restrictions,
|
||||||
ncol=nrow-1;
|
ncol=nrow-1;
|
||||||
end
|
end
|
||||||
|
% For single legend search which has maximum nbr of restrictions
|
||||||
|
maxijv=0;
|
||||||
|
for ij=1:nbr_irf_restrictions
|
||||||
|
if length(DynareOptions.endogenous_prior_restrictions.irf{ij,3})>maxijv
|
||||||
|
maxij=ij;maxijv=length(DynareOptions.endogenous_prior_restrictions.irf{ij,3});
|
||||||
|
end
|
||||||
|
end
|
||||||
for ij=1:nbr_irf_restrictions,
|
for ij=1:nbr_irf_restrictions,
|
||||||
figure(h1),
|
figure(h1),
|
||||||
mat_irf{ij}=mat_irf{ij}(irestrictions,:);
|
mat_irf{ij}=mat_irf{ij}(irestrictions,:);
|
||||||
|
@ -115,14 +123,24 @@ if ~isempty(indx_irf),
|
||||||
leg = num2str(DynareOptions.endogenous_prior_restrictions.irf{ij,3}(1));
|
leg = num2str(DynareOptions.endogenous_prior_restrictions.irf{ij,3}(1));
|
||||||
if size(mat_irf{ij},2)>1,
|
if size(mat_irf{ij},2)>1,
|
||||||
leg = [leg,':' ,num2str(DynareOptions.endogenous_prior_restrictions.irf{ij,3}(end))];
|
leg = [leg,':' ,num2str(DynareOptions.endogenous_prior_restrictions.irf{ij,3}(end))];
|
||||||
end
|
end
|
||||||
title([DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'],'interpreter','none'),
|
title([DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'],'interpreter','none'),
|
||||||
|
%set(legend_h,'Xlim',[0 1]);
|
||||||
|
if ij==maxij
|
||||||
|
leg1 = num2str(DynareOptions.endogenous_prior_restrictions.irf{ij,3}(:));
|
||||||
|
[legend_h,object_h,plot_h,text_strings]=legend(leg1);
|
||||||
|
Position=get(legend_h,'Position');Position(1:2)=[-0.055 0.95-Position(4)];
|
||||||
|
set(legend_h,'Position',Position);
|
||||||
|
end
|
||||||
|
% hc = get(h,'Children');
|
||||||
|
%for i=2:2:length(hc)
|
||||||
|
%end
|
||||||
indx1 = find(indx_irf(:,ij)==0);
|
indx1 = find(indx_irf(:,ij)==0);
|
||||||
indx2 = find(indx_irf(:,ij)~=0);
|
indx2 = find(indx_irf(:,ij)~=0);
|
||||||
atitle=[DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'];
|
atitle=[DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'];
|
||||||
fprintf(['%4.1f%% of the prior support matches IRF ',atitle,' inside [%4.1f, %4.1f]\n'],length(indx1)/length(irestrictions)*100,DynareOptions.endogenous_prior_restrictions.irf{ij,4})
|
fprintf(['%4.1f%% of the prior support matches IRF ',atitle,' inside [%4.1f, %4.1f]\n'],length(indx1)/length(irestrictions)*100,DynareOptions.endogenous_prior_restrictions.irf{ij,4})
|
||||||
aname=[type '_irf_calib_',int2str(ij)];
|
% aname=[type '_irf_calib_',int2str(ij)];
|
||||||
|
aname=[type '_irf_calib_',endo_prior_restrictions.irf{ij,1},'_VS_',endo_prior_restrictions.irf{ij,2}];
|
||||||
atitle=[type ' IRF Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'];
|
atitle=[type ' IRF Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')'];
|
||||||
[proba, dproba] = stab_map_1(xmat, indx1, indx2, aname, 0);
|
[proba, dproba] = stab_map_1(xmat, indx1, indx2, aname, 0);
|
||||||
indplot=find(proba<pvalue_ks);
|
indplot=find(proba<pvalue_ks);
|
||||||
|
@ -142,6 +160,13 @@ if ~isempty(indx_moment)
|
||||||
if nrow*(nrow-1)>nbr_moment_restrictions,
|
if nrow*(nrow-1)>nbr_moment_restrictions,
|
||||||
ncol=nrow-1;
|
ncol=nrow-1;
|
||||||
end
|
end
|
||||||
|
% For single legend search which has maximum nbr of restrictions
|
||||||
|
maxijv=0;
|
||||||
|
for ij=1:nbr_moment_restrictions
|
||||||
|
if length(DynareOptions.endogenous_prior_restrictions.moment{ij,3})>maxijv
|
||||||
|
maxij=ij;maxijv=length(DynareOptions.endogenous_prior_restrictions.moment{ij,3});
|
||||||
|
end
|
||||||
|
end
|
||||||
for ij=1:nbr_moment_restrictions,
|
for ij=1:nbr_moment_restrictions,
|
||||||
figure(h2),
|
figure(h2),
|
||||||
mat_moment{ij}=mat_moment{ij}(irestrictions,:);
|
mat_moment{ij}=mat_moment{ij}(irestrictions,:);
|
||||||
|
@ -162,12 +187,18 @@ if ~isempty(indx_moment)
|
||||||
leg = [leg,':' ,num2str(DynareOptions.endogenous_prior_restrictions.moment{ij,3}(end))];
|
leg = [leg,':' ,num2str(DynareOptions.endogenous_prior_restrictions.moment{ij,3}(end))];
|
||||||
end
|
end
|
||||||
title([DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2},'(',leg,')'],'interpreter','none'),
|
title([DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2},'(',leg,')'],'interpreter','none'),
|
||||||
|
if ij==maxij
|
||||||
|
leg1 = num2str(DynareOptions.endogenous_prior_restrictions.moment{ij,3}(:));
|
||||||
|
[legend_h,object_h,plot_h,text_strings]=legend(leg1);
|
||||||
|
Position=get(legend_h,'Position');Position(1:2)=[-0.055 0.95-Position(4)];
|
||||||
|
set(legend_h,'Position',Position);
|
||||||
|
end
|
||||||
indx1 = find(indx_moment(:,ij)==0);
|
indx1 = find(indx_moment(:,ij)==0);
|
||||||
indx2 = find(indx_moment(:,ij)~=0);
|
indx2 = find(indx_moment(:,ij)~=0);
|
||||||
atitle=[DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2}, '(', leg,')'];
|
atitle=[DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2}, '(', leg,')'];
|
||||||
fprintf(['%4.1f%% of the prior support matches MOMENT ',atitle,' inside [%4.1f, %4.1f]\n'],length(indx1)/length(irestrictions)*100,DynareOptions.endogenous_prior_restrictions.moment{ij,4})
|
fprintf(['%4.1f%% of the prior support matches MOMENT ',atitle,' inside [%4.1f, %4.1f]\n'],length(indx1)/length(irestrictions)*100,DynareOptions.endogenous_prior_restrictions.moment{ij,4})
|
||||||
aname=[type '_moment_calib_',int2str(ij)];
|
% aname=[type '_moment_calib_',int2str(ij)];
|
||||||
|
aname=[type '_moment_calib_',DynareOptions.endogenous_prior_restrictions.moment(ij,1),'_VS_',DynareOptions.endogenous_prior_restrictions.moment(ij,2)];
|
||||||
atitle=[type ' MOMENT Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2}, '(', leg,')'];
|
atitle=[type ' MOMENT Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2}, '(', leg,')'];
|
||||||
[proba, dproba] = stab_map_1(xmat, indx1, indx2, aname, 0);
|
[proba, dproba] = stab_map_1(xmat, indx1, indx2, aname, 0);
|
||||||
indplot=find(proba<pvalue_ks);
|
indplot=find(proba<pvalue_ks);
|
||||||
|
|
Loading…
Reference in New Issue