From ea5d2e90b2600ebb141903e8b71d6f2acda3d91d Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Fri, 5 Jul 2013 23:46:05 +0200 Subject: [PATCH] Take care of parameter estimates at prior bounds in check plots Symmetric plots for parameters at the prior bounds resulted in nothing being printed. This commit then switches to asymmetric plots for those parameters and plots a red line signifying the bound. --- matlab/mode_check.m | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/matlab/mode_check.m b/matlab/mode_check.m index 6f9299ac1..8fdbbc2a4 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -109,15 +109,24 @@ for plt = 1:nbplt, end end xx = x; - l1 = max(BayesInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; - l2 = min(BayesInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); - if DynareOptions.mode_check.symmetric_plots, - if l2<(1+ll)*x(kk) - l1 = x(kk) - (l2-x(kk)); + l1 = max(BayesInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound + l2 = min(BayesInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound + binding_lower_bound=0; + binding_upper_bound=0; + if isequal(x(kk),BayesInfo.lb(kk)) + binding_lower_bound=1; + bound_value=BayesInfo.lb(kk); + elseif isequal(x(kk),BayesInfo.ub(kk)) + binding_upper_bound=1; + bound_value=BayesInfo.ub(kk); + end + if DynareOptions.mode_check.symmetric_plots && ~binding_lower_bound && ~binding_upper_bound + if l2<(1+ll)*x(kk) %test whether upper bound is too small due to prior binding + l1 = x(kk) - (l2-x(kk)); %adjust lower bound to become closer m1 = 1; end - if ~m1 && (l1>(1-ll)*x(kk)) && (x(kk)+(x(kk)-l1)(1-ll)*x(kk)) && (x(kk)+(x(kk)-l1)