Commit 41e027ae authored by MichelJuillard's avatar MichelJuillard
Browse files

added steady option stop_on_error. stop_on_error = 0 permits to

continue (for example, when chaining homotopy steps), even if the
steady state computation was not successful.
parent 1014bb03
......@@ -2430,6 +2430,23 @@ Defines the number of steps when performing a homotopy. See
@item nocheck
Don't check the steady state values when they are provided explicitely either by a steady state file or a @code{steady_state_model} block. This is useful for models with unit roots as, in this case, the steady state is not unique or doesn't exist.
@item stop_on_error = @var{INTEGER}
Normally, @code{steady} stops on error with a message. However, in
special circumstances, such as chaining homotopy steps, it may be useful
to let it continue to the next step even if the current one was not
successful. @code{stop_on_error} can take two values:
@table @code
@item 0
@code{steady} doesn't stop on error
@item 1
@code{steady} stops on error
@end table
@noindent
Default is @code{1}
@end table
@examplehead
......
......@@ -80,6 +80,7 @@ else
end
options_.steadystate_partial = [];
options_.steadystate.nocheck = 0;
options_.steady.stop_on_error = 1;
% subset of the estimated deep parameters
options_.ParamSubSet = 'None';
......
......@@ -55,7 +55,7 @@ end
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);
if info(1)
if info(1) && options_.steady.stop_on_error
print_info(info,options_.noprint);
end
......
......@@ -130,7 +130,7 @@ class ParsingDriver;
%token UNIFORM_PDF UNIT_ROOT_VARS USE_DLL USEAUTOCORR GSA_SAMPLE_FILE
%token VALUES VAR VAREXO VAREXO_DET VAROBS PREDETERMINED_VARIABLES
%token WRITE_LATEX_DYNAMIC_MODEL WRITE_LATEX_STATIC_MODEL
%token XLS_SHEET XLS_RANGE
%token XLS_SHEET XLS_RANGE STOP_ON_ERROR
%left COMMA
%left EQUAL_EQUAL EXCLAMATION_EQUAL
%left LESS GREATER LESS_EQUAL GREATER_EQUAL
......@@ -836,6 +836,7 @@ steady_options : o_solve_algo
| o_markowitz
| o_maxit
| o_nocheck
| o_stop_on_error
;
check : CHECK ';'
......@@ -2483,6 +2484,7 @@ o_median : MEDIAN { driver.option_num("ms.median","1"); }
o_regimes : REGIMES { driver.option_num("ms.regimes","1"); };
o_regime : REGIME EQUAL INT_NUMBER { driver.option_num("ms.regime",$3); };
o_data_obs_nbr : DATA_OBS_NBR EQUAL INT_NUMBER { driver.option_num("ms.forecast_data_obs",$3); };
o_stop_on_error: STOP_ON_ERROR EQUAL INT_NUMBER { driver.option_num("steady.stop_on_eror",$3); };
range : symbol ':' symbol
{
......
......@@ -451,6 +451,7 @@ string eofbuff;
<DYNARE_STATEMENT>deflator {return token::DEFLATOR;}
<DYNARE_STATEMENT>growth_factor {return token::GROWTH_FACTOR;}
<DYNARE_STATEMENT>cova_compute {return token::COVA_COMPUTE;}
<DYNARE_STATEMENT>stop_on_error {return token::STOP_ON_ERROR;}
<DYNARE_STATEMENT>[\$][^$]*[\$] {
strtok(yytext+1, "$");
......
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