Added a new option "partial_information" to stoch_simul, estimation, osr, ramsey_policy

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3063 ac1d8469-bf42-47a9-8791-bf33cf982152
issue#70
sebastien 2009-10-20 16:55:31 +00:00
parent 2761b4c016
commit ab7bcdd304
5 changed files with 29 additions and 2 deletions

View File

@ -114,6 +114,11 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct)
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
if (it != options_list.num_options.end() && it->second == "1")
mod_file_struct.partial_information = true;
// This (temporary) check is present in stoch_simul, osr and ramsey_policy
if (options_list.num_options.find("simul") != options_list.num_options.end()
&& options_list.num_options.find("hp_filter") != options_list.num_options.end())
@ -173,6 +178,11 @@ RamseyPolicyStatement::checkPass(ModFileStructure &mod_file_struct)
mod_file_struct.order_option = max(mod_file_struct.order_option, order + 1);
}
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
if (it != options_list.num_options.end() && it->second == "1")
mod_file_struct.partial_information = true;
// This (temporary) check is present in stoch_simul, osr and ramsey_policy
if (options_list.num_options.find("simul") != options_list.num_options.end()
&& options_list.num_options.find("hp_filter") != options_list.num_options.end())
@ -206,6 +216,11 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct)
OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
if (it != options_list.num_options.end() && it->second == "1")
mod_file_struct.partial_information = true;
}
void
@ -730,6 +745,11 @@ OsrStatement::checkPass(ModFileStructure &mod_file_struct)
if (it != options_list.num_options.end())
mod_file_struct.order_option = max(mod_file_struct.order_option,atoi(it->second.c_str()));
// Fill in mod_file_struct.partial_information
it = options_list.num_options.find("partial_information");
if (it != options_list.num_options.end() && it->second == "1")
mod_file_struct.partial_information = true;
// This (temporary) check is present in stoch_simul, osr and ramsey_policy
if (options_list.num_options.find("simul") != options_list.num_options.end()
&& options_list.num_options.find("hp_filter") != options_list.num_options.end())

View File

@ -113,7 +113,7 @@ class ParsingDriver;
%token NAN_CONSTANT NOBS NOCONSTANT NOCORR NODIAGNOSTIC NOFUNCTIONS
%token NOGRAPH NOMOMENTS NOPRINT NORMAL_PDF
%token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS
%token PARAMETERS PARAMETER_SET PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE
%token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE
%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_ANALYSIS PRIOR_MODE PRIOR_MEAN POSTERIOR_ANALYSIS POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN
%token <string_val> QUOTED_STRING
%token QZ_CRITERIUM
@ -717,6 +717,7 @@ stoch_simul_options : o_dr_algo
| o_print
| o_noprint
| o_aim_solver
| o_partial_information
;
symbol_list : symbol_list symbol
@ -1018,6 +1019,7 @@ estimation_options : o_datafile
| o_plot_priors
| o_order
| o_aim_solver
| o_partial_information
;
prior_analysis : PRIOR_ANALYSIS '(' prior_posterior_options_list ')' ';'
@ -1627,6 +1629,7 @@ o_mh_recover : MH_RECOVER { driver.option_num("mh_recover", "1"); };
o_diffuse_filter: DIFFUSE_FILTER {driver.option_num("diffuse_filter", "1"); };
o_plot_priors: PLOT_PRIORS {driver.option_num("plot_priors", "1"); };
o_aim_solver: AIM_SOLVER {driver.option_num("aim_solver", "1"); };
o_partial_information : PARTIAL_INFORMATION {driver.option_num("partial_information", "1"); };
o_planner_discount : PLANNER_DISCOUNT EQUAL number { driver.option_num("planner_discount",$3); };

View File

@ -222,6 +222,7 @@ int sigma_e = 0;
<DYNARE_STATEMENT>diffuse_filter {return token::DIFFUSE_FILTER;}
<DYNARE_STATEMENT>plot_priors {return token::PLOT_PRIORS;}
<DYNARE_STATEMENT>aim_solver {return token::AIM_SOLVER;}
<DYNARE_STATEMENT>partial_information {return token::PARTIAL_INFORMATION;}
<DYNARE_STATEMENT>freq {return token::FREQ;}
<DYNARE_STATEMENT>initial_year {return token::INITIAL_YEAR;}

View File

@ -29,7 +29,8 @@ ModFileStructure::ModFileStructure() :
order_option(0),
bvar_density_present(false),
bvar_forecast_present(false),
identification_present(false)
identification_present(false),
partial_information(false)
{
}

View File

@ -58,6 +58,8 @@ public:
bool ms_sbvar_present;
//! Whether an identification statement is present or the identification option of dynare_sensitivity statement is equal to one
bool identification_present;
//! Whether the option partial_information is given to stoch_simul/estimation/osr/ramsey_policy
bool partial_information;
};
class Statement