Commit c16c2fb8 authored by Johannes Pfeifer 's avatar Johannes Pfeifer

evaluate_steady_state.m: consistently use params

Prevents erroneously relying on stale parameters from M.params (thanks to Tom Holden); closes #1627
parent 7b0ef3d0
......@@ -48,7 +48,7 @@ exo_ss = [oo.exo_steady_state; oo.exo_det_steady_state];
if length(M.aux_vars) > 0 && ~steadystate_flag && M.set_auxiliary_variables
h_set_auxiliary_variables = str2func([M.fname '.set_auxiliary_variables']);
ys_init = h_set_auxiliary_variables(ys_init,exo_ss,M.params);
ys_init = h_set_auxiliary_variables(ys_init,exo_ss,params);
end
if options.ramsey_policy
......@@ -289,7 +289,7 @@ if check
%make sure ys contains auxiliary variables in case of problem with dynare_solve
if length(M.aux_vars) > 0 && ~steadystate_flag
if M.set_auxiliary_variables
ys = h_set_auxiliary_variables(ys,exo_ss,M.params);
ys = h_set_auxiliary_variables(ys,exo_ss,params);
end
end
resid = evaluate_static_model(ys,exo_ss,params,M,options);
......@@ -307,15 +307,15 @@ if M.static_and_dynamic_models_differ
z = repmat(ys,1,M.maximum_lead + M.maximum_lag + 1);
zx = repmat([exo_ss'], M.maximum_lead + M.maximum_lag + 1, 1);
if options.bytecode
[chck, r, ~]= bytecode('dynamic','evaluate', z, zx, M.params, ys, 1);
[chck, r, ~]= bytecode('dynamic','evaluate', z, zx, params, ys, 1);
mexErrCheck('bytecode', chck);
elseif options.block
[r, oo.dr] = feval([M.fname '.dynamic'], z', zx, M.params, ys, M.maximum_lag+1, oo.dr);
[r, oo.dr] = feval([M.fname '.dynamic'], z', zx, params, ys, M.maximum_lag+1, oo.dr);
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);
r = feval([M.fname '.dynamic'], z(iyr0), zx, params, ys, M.maximum_lag + 1);
end
% Fail if residual greater than tolerance
if max(abs(r)) > options.solve_tolf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment