From 54d353e255339affe197128da743ce81a247163c Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 2 Jun 2014 13:58:29 +0200 Subject: [PATCH 1/2] Fix typo in header of DynamicModel.cc --- preprocessor/DynamicModel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc index c3aa03747..ca2051329 100644 --- a/preprocessor/DynamicModel.cc +++ b/preprocessor/DynamicModel.cc @@ -1516,7 +1516,7 @@ DynamicModel::writeDynamicMFile(const string &dynamic_basename) const << "% Inputs :" << endl << "% y [#dynamic variables by 1] double vector of endogenous variables in the order stored" << endl << "% in M_.lead_lag_incidence; see the Manual" << endl - << "% x [M_.exo_nbr by nperiods] double matrix of exogenous variables (in declaration order)" << endl + << "% x [nperiods by M_.exo_nbr] double matrix of exogenous variables (in declaration order)" << endl << "% for all simulation periods" << endl << "% params [M_.param_nbr by 1] double vector of parameter values in declaration order" << endl << "% it_ scalar double time period for exogenous variables for which to evaluate the model" << endl From ca6803b5310df303b2b754193f8cc31e836bf89b Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 2 Jun 2014 14:00:13 +0200 Subject: [PATCH 2/2] Add forgotten case to likelihood functions Code 25 was not filtered out, leading to cryptic crashes --- matlab/dsge_likelihood.m | 2 +- matlab/dsge_var_likelihood.m | 2 +- matlab/non_linear_dsge_likelihood.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matlab/dsge_likelihood.m b/matlab/dsge_likelihood.m index e3ffc7cea..2e743cce7 100644 --- a/matlab/dsge_likelihood.m +++ b/matlab/dsge_likelihood.m @@ -259,7 +259,7 @@ end % Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol). if info(1) == 1 || info(1) == 2 || info(1) == 5 || info(1) == 7 || info(1) ... - == 8 || info(1) == 22 || info(1) == 24 || info(1) == 19 + == 8 || info(1) == 22 || info(1) == 24 || info(1) == 19 || info(1) == 25 fval = objective_function_penalty_base+1; info = info(1); exit_flag = 0; diff --git a/matlab/dsge_var_likelihood.m b/matlab/dsge_var_likelihood.m index 6c37fd1a4..1177b4751 100644 --- a/matlab/dsge_var_likelihood.m +++ b/matlab/dsge_var_likelihood.m @@ -127,7 +127,7 @@ end % Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol). if info(1) == 1 || info(1) == 2 || info(1) == 5 || info(1) == 7 || info(1) ... - == 8 || info(1) == 22 || info(1) == 24 + == 8 || info(1) == 22 || info(1) == 24 || info(1) == 25 fval = objective_function_penalty_base+1; info = info(1); exit_flag = 0; diff --git a/matlab/non_linear_dsge_likelihood.m b/matlab/non_linear_dsge_likelihood.m index a76d73075..4ea45c814 100644 --- a/matlab/non_linear_dsge_likelihood.m +++ b/matlab/non_linear_dsge_likelihood.m @@ -217,7 +217,7 @@ end % Linearize the model around the deterministic sdteadystate and extract the matrices of the state equation (T and R). [T,R,SteadyState,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,DynareOptions,DynareResults,'restrict'); -if info(1) == 1 || info(1) == 2 || info(1) == 5 +if info(1) == 1 || info(1) == 2 || info(1) == 5 || info(1) == 25 fval = objective_function_penalty_base+1; exit_flag = 0; return