From 55b6d0eb93638c009276070e34291f8ce78031c7 Mon Sep 17 00:00:00 2001 From: Jukka Heikkonen Date: Fri, 12 Sep 2014 14:49:25 +0200 Subject: [PATCH] 1) check for restricted or extened var list 2) allow proper working will all GSA type of sample: prior, MC, posterior --- matlab/endogenous_prior_restrictions.m | 16 +++++++-- matlab/gsa/map_calibration.m | 48 +++++++++++++++++--------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/matlab/endogenous_prior_restrictions.m b/matlab/endogenous_prior_restrictions.m index d5b62104b..617116a89 100644 --- a/matlab/endogenous_prior_restrictions.m +++ b/matlab/endogenous_prior_restrictions.m @@ -42,8 +42,7 @@ endo_prior_restrictions.irf= DynareOptions.endogenous_prior_restrictions.irf; endo_prior_restrictions.moment= DynareOptions.endogenous_prior_restrictions.moment; if ~isempty(endo_prior_restrictions.irf), - data_irf=cell(size(endo_prior_restrictions.irf,1),1); - + data_irf=cell(size(endo_prior_restrictions.irf,1),1); if DynareOptions.order>1, error('The algorithm for prior (sign) restrictions on irf''s is currently restricted to first-order decision rules') return @@ -53,7 +52,18 @@ if ~isempty(endo_prior_restrictions.irf), [T,R,SteadyState,infox,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults); else % check if T and R are given in the restricted form!!! if size(T,1)nbr_irf_restrictions, @@ -108,21 +122,21 @@ if ~isempty(indx_irf), indx2 = find(indx_irf(:,ij)~=0); 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}) - aname=['irf_calib_',int2str(ij)]; - atitle=['IRF Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.irf{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.irf{ij,2}, '(', leg,')']; + aname=[type '_irf_calib_',int2str(ij)]; + 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); indplot=find(probanbr_moment_restrictions, @@ -153,15 +167,15 @@ if ~isempty(indx_moment) indx2 = find(indx_moment(:,ij)~=0); 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}) - aname=['moment_calib_',int2str(ij)]; - atitle=['MOMENT Calib: Parameter(s) driving ',DynareOptions.endogenous_prior_restrictions.moment{ij,1},' vs ',DynareOptions.endogenous_prior_restrictions.moment{ij,2}, '(', leg,')']; + aname=[type '_moment_calib_',int2str(ij)]; + 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); indplot=find(proba