v4 initial_estimation_checks: added a check for *_steadystate.m accuracy

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1403 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2007-10-01 11:53:28 +00:00
parent 7a87a7b200
commit e62027a296
1 changed files with 49 additions and 25 deletions

View File

@ -26,6 +26,30 @@ else
[fval,cost_flag,ys,trend_coeff,info] = DsgeLikelihood(xparam1,gend,data);
end
% when their is an analytical steadystate, check that the values
% returned by *_steadystate match with the static model
if options_.steadystate_flag
[oo_.steady_state,check] = feval([M_.fname '_steadystate'],...
oo_.steady_state,...
[oo_.exo_steady_state; ...
oo_.exo_det_steady_state]);
% Check if the steady state obtained from the _steadystate file is a
% steady state.
check1 = 0;
if isfield(options_,'unit_root_vars')
if isempty(options_.unit_root_vars)
check1 = max(abs(feval([M_.fname '_static'],...
oo_.steady_state,...
[oo_.exo_steady_state; ...
oo_.exo_det_steady_state]))) > options_.dynatol ;
if check1
error(['The seadystate values returned by ' M_.fname ...
'_steadystate.m don''t solve the static model!' ])
end
end
end
end
if info(1) > 0
disp('Error in computing likelihood for initial parameter values')
print_info(info)