Fix bugs in evaluate_steady_state.m for static_and_dynamic_models_differ
The code in evaluate_steady_state.m below contains two bugs:
if M.static_and_dynamic_models_differ
% Evaluate residual of *dynamic* model using the steady state
% computed on the *static* one
z = repmat(ys,1,M.maximum_lead + M.maximum_lag + 1);
zx = repmat([oo.exo_simul oo.exo_det_simul],M.maximum_lead + M.maximum_lag + 1, 1);
if options.bytecode
[chck, r, junk]= bytecode('dynamic','evaluate', z, zx, M.params, ys, 1);
mexErrCheck('bytecode', chck);
elseif options.block
[r, data] = feval([M.fname '_dynamic'], z', zx, M.params, ys, M.maximum_lag+1, data);
else
iyv = M.lead_lag_incidence';
iyr0 = find(iyv(:));
xys = z(iyr0);
r = feval([M.fname '_dynamic'], z(iyr0), zx, M.params, ys, M.maximum_lag + 1);
end
% Fail if residual greater than tolerance
if max(abs(r)) > options.solve_tolf
info(1) = 25;
return
end
First, the code in the else
clause does not work, because [oo.exo_simul oo.exo_det_simul]
do not exist. They are generated by make_ex_
which is not called. My guess is the line needs to be replaced by
zx = repmat([exo_ss'],M.maximum_lead + M.maximum_lag + 1, 1);
Second, the elseif options.block
calls data
which is not defined.