Skip to content
Snippets Groups Projects
Commit 41a714ee authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Move check for correct number of instruments to ramsey_policy.m

No reason to trigger the check in every iteration
parent 1f26aed0
Branches
Tags
No related merge requests found
...@@ -54,17 +54,6 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta ...@@ -54,17 +54,6 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
end end
if options.ramsey_policy if options.ramsey_policy
%test whether specification matches
inst_nbr = size(options.instruments,1);
if inst_nbr~=0
orig_endo_aux_nbr = M.orig_endo_nbr + min(find([M.aux_vars.type] == 6)) - 1;
implied_inst_nbr = orig_endo_aux_nbr - M.orig_eq_nbr;
if inst_nbr>implied_inst_nbr
error('You have specified more instruments than there are omitted equations')
elseif inst_nbr<implied_inst_nbr
error('You have specified fewer instruments than there are omitted equations')
end
end
if steadystate_flag if steadystate_flag
% explicit steady state file % explicit steady state file
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ... [ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ...
......
...@@ -22,6 +22,19 @@ global options_ oo_ M_ ...@@ -22,6 +22,19 @@ global options_ oo_ M_
options_.ramsey_policy = 1; options_.ramsey_policy = 1;
oldoptions = options_; oldoptions = options_;
options_.order = 1; options_.order = 1;
%test whether specification matches
inst_nbr = size(options_.instruments,1);
if inst_nbr~=0
orig_endo_aux_nbr = M_.orig_endo_nbr + min(find([M_.aux_vars.type] == 6)) - 1;
implied_inst_nbr = orig_endo_aux_nbr - M_.orig_eq_nbr;
if inst_nbr>implied_inst_nbr
error('You have specified more instruments than there are omitted equations')
elseif inst_nbr<implied_inst_nbr
error('You have specified fewer instruments than there are omitted equations')
end
end
info = stoch_simul(var_list); info = stoch_simul(var_list);
oo_.steady_state = oo_.dr.ys; oo_.steady_state = oo_.dr.ys;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment