Add a flag for calib_smoother command and apply a setup similar to the one used for stoch_simul command:

- Add auxiliary variables for leaded and lagged exogenous
- Set the cutoff applied to the Jacobian at zero for the static and the dynamic models
issue#70
ferhat 2013-10-28 14:22:23 +01:00
parent 3706338bf4
commit b6c0850fb7
5 changed files with 21 additions and 6 deletions

View File

@ -2411,6 +2411,12 @@ CalibSmootherStatement::CalibSmootherStatement(const SymbolList &symbol_list_arg
{
}
void
CalibSmootherStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
{
mod_file_struct.calib_smoother_present = true;
}
void
CalibSmootherStatement::writeOutput(ostream &output, const string &basename) const
{

View File

@ -516,6 +516,7 @@ private:
public:
CalibSmootherStatement(const SymbolList &symbol_list_arg,
const OptionsList &options_list_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename) const;
};

View File

@ -123,7 +123,8 @@ ModFile::checkPass()
|| mod_file_struct.estimation_present
|| mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present
|| mod_file_struct.discretionary_policy_present;
|| mod_file_struct.discretionary_policy_present
|| mod_file_struct.calib_smoother_present;
// Allow empty model only when doing a standalone BVAR estimation
if (dynamic_model.equation_number() == 0
@ -318,7 +319,8 @@ ModFile::transformPass(bool nostrict)
|| mod_file_struct.estimation_present
|| mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present
|| mod_file_struct.discretionary_policy_present)
|| mod_file_struct.discretionary_policy_present
|| mod_file_struct.calib_smoother_present)
{
// In stochastic models, create auxiliary vars for leads and lags greater than 2, on both endos and exos
dynamic_model.substituteEndoLeadGreaterThanTwo(false);
@ -423,7 +425,8 @@ ModFile::computingPass(bool no_tmp_terms)
{
if (mod_file_struct.stoch_simul_present
|| mod_file_struct.estimation_present || mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present)
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present
|| mod_file_struct.calib_smoother_present)
static_model.set_cutoff_to_zero();
const bool static_hessian = mod_file_struct.identification_present
@ -437,7 +440,8 @@ ModFile::computingPass(bool no_tmp_terms)
if (mod_file_struct.simul_present || mod_file_struct.check_present
|| mod_file_struct.stoch_simul_present
|| mod_file_struct.estimation_present || mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present)
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present
|| mod_file_struct.calib_smoother_present)
{
if (mod_file_struct.simul_present)
dynamic_model.computingPass(true, false, false, false, global_eval_context, no_tmp_terms, block, use_dll, byte_code);
@ -445,7 +449,8 @@ ModFile::computingPass(bool no_tmp_terms)
{
if (mod_file_struct.stoch_simul_present
|| mod_file_struct.estimation_present || mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present)
|| mod_file_struct.ramsey_policy_present || mod_file_struct.identification_present
|| mod_file_struct.calib_smoother_present)
dynamic_model.set_cutoff_to_zero();
if (mod_file_struct.order_option < 1 || mod_file_struct.order_option > 3)
{

View File

@ -47,7 +47,8 @@ ModFileStructure::ModFileStructure() :
dsge_var_estimated(false),
bayesian_irf_present(false),
estimation_data_statement_present(false),
last_markov_switching_chain(0)
last_markov_switching_chain(0),
calib_smoother_present(false)
{
}

View File

@ -57,6 +57,8 @@ public:
bool planner_objective_present;
//! Whether an extended_path statement is present
bool extended_path_present;
//! Whether a calib_smoother statement is present
bool calib_smoother_present;
//! The value of the "order" option of stoch_simul, estimation, osr, ramsey_policy
//! Derivation order
/*! First initialized to zero. If user sets order option somewhere in the MOD file, it will be equal to the maximum of order options. Otherwise will default to 2 */