Ensure that running check without stoch_simul still sets oo_.dr.eigval

This is documented in the reference manual, but was not working.
The change consists in having check.m returning oo_ as 1st output argument, and
having the preprocessor generating the corresponding code.
time-shift
Sébastien Villemot 2013-01-15 16:14:15 +01:00
parent 00485425c1
commit 14ed3d94a9
3 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
function [result,info] = check(M, options, oo)
function [oo,result,info] = check(M, options, oo)
% Checks determinacy conditions by computing the generalized eigenvalues.
%@info:
@ -21,6 +21,8 @@ function [result,info] = check(M, options, oo)
%! @strong{Outputs}
%! @sp 1
%! @table @ @var
%! @item oo
%! Matlab's structure gathering the results (initialized by dynare).
%! @item result
%! Integer scalar equal to one (BK conditions are satisfied) or zero (otherwise).
%! @item info
@ -38,7 +40,7 @@ function [result,info] = check(M, options, oo)
%! @end deftypefn
%@eod:
% Copyright (C) 2001-2012 Dynare Team
% Copyright (C) 2001-2013 Dynare Team
%
% This file is part of Dynare.
%

View File

@ -15,7 +15,7 @@ function [r,flag] = smm_objective(xparams,sample_moments,weighting_matrix,option
% SPECIAL REQUIREMENTS
% The user has to provide a file where the moment conditions are defined.
% Copyright (C) 2010-2012 Dynare Team
% Copyright (C) 2010-2013 Dynare Team
%
% This file is part of Dynare.
%
@ -75,7 +75,7 @@ save('estimated_parameters.mat','xparams');
% Check for local determinacy of the deterministic steady state.
noprint = options_.noprint; options_.noprint = 1;
[local_determinacy_and_stability,info] = check(M_,options_,oo_); options_.noprint = noprint;
[oo_,local_determinacy_and_stability,info] = check(M_,options_,oo_); options_.noprint = noprint;
if ~local_determinacy_and_stability
r = priorObjectiveValue * (1+info(2));
flag = 0;

View File

@ -59,7 +59,7 @@ void
CheckStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output);
output << "check(M_,options_,oo_);\n";
output << "oo_ = check(M_,options_,oo_);" << endl;
}
void