From 37fbf5b665a276289a44988dfe743e553ebcad82 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 11 Oct 2021 18:04:47 +0200 Subject: [PATCH 1/2] resid.m: fix display when used together with optimal policy --- matlab/resid.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matlab/resid.m b/matlab/resid.m index b5d4e0d63..22cc2f874 100644 --- a/matlab/resid.m +++ b/matlab/resid.m @@ -102,11 +102,11 @@ if nargout == 0 ind = []; disp('Residuals of the static equations:') skipline() - for i=1:M_.orig_endo_nbr - if abs(z(i)) < options_.solve_tolf/100 + for i=1:M_.orig_eq_nbr + if abs(z(i+M_.ramsey_eq_nbr)) < options_.solve_tolf/100 tmp = 0; else - tmp = z(i); + tmp = z(i+M_.ramsey_eq_nbr); end if istag tg = tags(cell2mat(tags(:,1)) == i,2:3); % all tags for equation i @@ -123,4 +123,4 @@ if nargout == 0 skipline(2) end -oo_.steady_state = steady_state_old; +oo_.steady_state = steady_state_old; \ No newline at end of file From fa04600264ac6a2ea321c7c8867def34a1871aae Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 11 Oct 2021 18:06:37 +0200 Subject: [PATCH 2/2] Testsuite: add calls to resid for optimal policy --- tests/discretionary_policy/dennis_1.mod | 1 + tests/optimal_policy/Ramsey/Gali_commitment.mod | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/discretionary_policy/dennis_1.mod b/tests/discretionary_policy/dennis_1.mod index 993b391d4..8dd22f2f0 100644 --- a/tests/discretionary_policy/dennis_1.mod +++ b/tests/discretionary_policy/dennis_1.mod @@ -29,6 +29,7 @@ var e; stderr 1; end; planner_objective pi_c^2 + y^2; +resid; discretionary_policy(instruments=(i),irf=0,planner_discount=beta, periods=200); // Generate data used by dennis_1_estim.mod diff --git a/tests/optimal_policy/Ramsey/Gali_commitment.mod b/tests/optimal_policy/Ramsey/Gali_commitment.mod index 9569b2bad..05ccfb1be 100644 --- a/tests/optimal_policy/Ramsey/Gali_commitment.mod +++ b/tests/optimal_policy/Ramsey/Gali_commitment.mod @@ -169,6 +169,7 @@ end; planner_objective pi^2 +(((1-theta)*(1-betta*theta)/theta*((1-alppha)/(1-alppha+alppha*epsilon)))*(siggma+(phi+alppha)/(1-alppha)))/epsilon*y_gap^2; ramsey_model(instruments=(i),planner_discount=betta); +resid; stoch_simul(order=1,irf=13) x pi p u; verbatim;