Commit 14ed3d94 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

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.
parent 00485425
function [result,info] = check(M, options, oo) function [oo,result,info] = check(M, options, oo)
% Checks determinacy conditions by computing the generalized eigenvalues. % Checks determinacy conditions by computing the generalized eigenvalues.
%@info: %@info:
...@@ -21,6 +21,8 @@ function [result,info] = check(M, options, oo) ...@@ -21,6 +21,8 @@ function [result,info] = check(M, options, oo)
%! @strong{Outputs} %! @strong{Outputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item oo
%! Matlab's structure gathering the results (initialized by dynare).
%! @item result %! @item result
%! Integer scalar equal to one (BK conditions are satisfied) or zero (otherwise). %! Integer scalar equal to one (BK conditions are satisfied) or zero (otherwise).
%! @item info %! @item info
...@@ -38,7 +40,7 @@ function [result,info] = check(M, options, oo) ...@@ -38,7 +40,7 @@ function [result,info] = check(M, options, oo)
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
% Copyright (C) 2001-2012 Dynare Team % Copyright (C) 2001-2013 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
......
...@@ -15,7 +15,7 @@ function [r,flag] = smm_objective(xparams,sample_moments,weighting_matrix,option ...@@ -15,7 +15,7 @@ function [r,flag] = smm_objective(xparams,sample_moments,weighting_matrix,option
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% The user has to provide a file where the moment conditions are defined. % 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. % This file is part of Dynare.
% %
...@@ -75,7 +75,7 @@ save('estimated_parameters.mat','xparams'); ...@@ -75,7 +75,7 @@ save('estimated_parameters.mat','xparams');
% Check for local determinacy of the deterministic steady state. % Check for local determinacy of the deterministic steady state.
noprint = options_.noprint; options_.noprint = 1; 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 if ~local_determinacy_and_stability
r = priorObjectiveValue * (1+info(2)); r = priorObjectiveValue * (1+info(2));
flag = 0; flag = 0;
......
...@@ -59,7 +59,7 @@ void ...@@ -59,7 +59,7 @@ void
CheckStatement::writeOutput(ostream &output, const string &basename) const CheckStatement::writeOutput(ostream &output, const string &basename) const
{ {
options_list.writeOutput(output); options_list.writeOutput(output);
output << "check(M_,options_,oo_);\n"; output << "oo_ = check(M_,options_,oo_);" << endl;
} }
void void
......
Supports Markdown
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