diminished tolerance in computation of steady state for linear models. This corrects a bug in estimation of constants in linear models.

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2283 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2008-12-03 10:12:52 +00:00
parent bf65cb4f10
commit a6bd42218c
1 changed files with 14 additions and 10 deletions

View File

@ -67,18 +67,22 @@ if options_.steadystate_flag
[oo_.exo_steady_state; oo_.exo_det_steady_state]); [oo_.exo_steady_state; oo_.exo_det_steady_state]);
else else
% testing if ys isn't a steady state or if we aren't computing Ramsey policy % testing if ys isn't a steady state or if we aren't computing Ramsey policy
if max(abs(feval(fh,dr.ys,[oo_.exo_steady_state; oo_.exo_det_steady_state], M_.params))) ... if options_.ramsey_policy == 0
> options_.dynatol & options_.ramsey_policy == 0 if options_.linear == 0
if options_.linear == 0 % nonlinear models
% nonlinear models if max(abs(feval(fh,dr.ys,[oo_.exo_steady_state; ...
[dr.ys,check1] = dynare_solve(fh,dr.ys,options_.jacobian_flag,... oo_.exo_det_steady_state], M_.params))) > options_.dynatol
[oo_.exo_steady_state; ... [dr.ys,check1] = dynare_solve(fh,dr.ys,options_.jacobian_flag,...
[oo_.exo_steady_state; ...
oo_.exo_det_steady_state], M_.params); oo_.exo_det_steady_state], M_.params);
else end
% linear models else
[fvec,jacob] = feval(fh,dr.ys,[oo_.exo_steady_state;... % linear models
[fvec,jacob] = feval(fh,dr.ys,[oo_.exo_steady_state;...
oo_.exo_det_steady_state], M_.params); oo_.exo_det_steady_state], M_.params);
dr.ys = dr.ys-jacob\fvec; if max(abs(fvec)) > 1e-12
dr.ys = dr.ys-jacob\fvec;
end
end end
end end
end end