Ramsey: Test whether number of instruments matches number of missing equation

Otherwise cryptic crashes can result
time-shift
Johannes Pfeifer 2016-06-23 20:48:01 +02:00
parent 25243712ba
commit 317f958184
1 changed files with 11 additions and 0 deletions

View File

@ -54,6 +54,17 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
end
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
% explicit steady state file
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ...