Merge branch 'master' into ecb-master
Fixed conflict in preprocessor/ModFile.ccissue#70
commit
dc490570ab
|
@ -44,6 +44,10 @@ DynamicModel::DynamicModel(SymbolTable &symbol_table_arg,
|
||||||
max_endo_lag(0), max_endo_lead(0),
|
max_endo_lag(0), max_endo_lead(0),
|
||||||
max_exo_lag(0), max_exo_lead(0),
|
max_exo_lag(0), max_exo_lead(0),
|
||||||
max_exo_det_lag(0), max_exo_det_lead(0),
|
max_exo_det_lag(0), max_exo_det_lead(0),
|
||||||
|
max_lag_orig(0), max_lead_orig(0),
|
||||||
|
max_endo_lag_orig(0), max_endo_lead_orig(0),
|
||||||
|
max_exo_lag_orig(0), max_exo_lead_orig(0),
|
||||||
|
max_exo_det_lag_orig(0), max_exo_det_lead_orig(0),
|
||||||
dynJacobianColsNbr(0),
|
dynJacobianColsNbr(0),
|
||||||
global_temporary_terms(true)
|
global_temporary_terms(true)
|
||||||
{
|
{
|
||||||
|
@ -2594,7 +2598,15 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
|
||||||
outstruct = "oo_.";
|
outstruct = "oo_.";
|
||||||
}
|
}
|
||||||
|
|
||||||
output << modstruct << "lead_lag_incidence = [";
|
output << modstruct << "max_endo_lag_orig = " << max_endo_lag_orig << ";" << endl
|
||||||
|
<< modstruct << "max_endo_lead_orig = " << max_endo_lead_orig << ";" << endl
|
||||||
|
<< modstruct << "max_exo_lag_orig = " << max_exo_lag_orig << ";" << endl
|
||||||
|
<< modstruct << "max_exo_lead_orig = " << max_exo_lead_orig << ";" << endl
|
||||||
|
<< modstruct << "max_exo_det_lag_orig = " << max_exo_det_lag_orig << ";" << endl
|
||||||
|
<< modstruct << "max_exo_det_lead_orig = " << max_exo_det_lead_orig << ";" << endl
|
||||||
|
<< modstruct << "max_lag_orig = " << max_lag_orig << ";" << endl
|
||||||
|
<< modstruct << "max_lead_orig = " << max_lead_orig << ";" << endl
|
||||||
|
<< modstruct << "lead_lag_incidence = [";
|
||||||
// Loop on endogenous variables
|
// Loop on endogenous variables
|
||||||
int nstatic = 0,
|
int nstatic = 0,
|
||||||
nfwrd = 0,
|
nfwrd = 0,
|
||||||
|
@ -3830,6 +3842,8 @@ DynamicModel::cloneDynamic(DynamicModel &dynamic_model) const
|
||||||
for (size_t i = 0; i < static_only_equations.size(); i++)
|
for (size_t i = 0; i < static_only_equations.size(); i++)
|
||||||
dynamic_model.addStaticOnlyEquation(static_only_equations[i]->cloneDynamic(dynamic_model),
|
dynamic_model.addStaticOnlyEquation(static_only_equations[i]->cloneDynamic(dynamic_model),
|
||||||
static_only_equations_lineno[i]);
|
static_only_equations_lineno[i]);
|
||||||
|
|
||||||
|
dynamic_model.setLeadsLagsOrig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4008,6 +4022,55 @@ DynamicModel::findUnusedExogenous()
|
||||||
return unusedExo;
|
return unusedExo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DynamicModel::setLeadsLagsOrig()
|
||||||
|
{
|
||||||
|
set<pair<int, int> > dynvars;
|
||||||
|
|
||||||
|
for (int i = 0; i < (int) equations.size(); i++)
|
||||||
|
{
|
||||||
|
equations[i]->collectDynamicVariables(eEndogenous, dynvars);
|
||||||
|
equations[i]->collectDynamicVariables(eExogenous, dynvars);
|
||||||
|
equations[i]->collectDynamicVariables(eExogenousDet, dynvars);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (set<pair<int, int> >::const_iterator it = dynvars.begin();
|
||||||
|
it != dynvars.end(); it++)
|
||||||
|
{
|
||||||
|
int lag = it->second;
|
||||||
|
SymbolType type = symbol_table.getType(it->first);
|
||||||
|
|
||||||
|
if (max_lead_orig < lag)
|
||||||
|
max_lead_orig= lag;
|
||||||
|
else if (-max_lag_orig > lag)
|
||||||
|
max_lag_orig = -lag;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case eEndogenous:
|
||||||
|
if (max_endo_lead_orig < lag)
|
||||||
|
max_endo_lead_orig = lag;
|
||||||
|
else if (-max_endo_lag_orig > lag)
|
||||||
|
max_endo_lag_orig = -lag;
|
||||||
|
break;
|
||||||
|
case eExogenous:
|
||||||
|
if (max_exo_lead_orig < lag)
|
||||||
|
max_exo_lead_orig = lag;
|
||||||
|
else if (-max_exo_lag_orig > lag)
|
||||||
|
max_exo_lag_orig = -lag;
|
||||||
|
break;
|
||||||
|
case eExogenousDet:
|
||||||
|
if (max_exo_det_lead_orig < lag)
|
||||||
|
max_exo_det_lead_orig = lag;
|
||||||
|
else if (-max_exo_det_lag_orig > lag)
|
||||||
|
max_exo_det_lag_orig = -lag;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DynamicModel::computeDerivIDs()
|
DynamicModel::computeDerivIDs()
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,6 +61,14 @@ private:
|
||||||
//! Maximum lag and lead over deterministic exogenous variables (positive values)
|
//! Maximum lag and lead over deterministic exogenous variables (positive values)
|
||||||
/*! Set by computeDerivIDs() */
|
/*! Set by computeDerivIDs() */
|
||||||
int max_exo_det_lag, max_exo_det_lead;
|
int max_exo_det_lag, max_exo_det_lead;
|
||||||
|
//! Maximum lag and lead over all types of variables (positive values) of original model
|
||||||
|
int max_lag_orig, max_lead_orig;
|
||||||
|
//! Maximum lag and lead over endogenous variables (positive values) of original model
|
||||||
|
int max_endo_lag_orig, max_endo_lead_orig;
|
||||||
|
//! Maximum lag and lead over exogenous variables (positive values) of original model
|
||||||
|
int max_exo_lag_orig, max_exo_lead_orig;
|
||||||
|
//! Maximum lag and lead over deterministic exogenous variables (positive values) of original model
|
||||||
|
int max_exo_det_lag_orig, max_exo_det_lead_orig;
|
||||||
|
|
||||||
//! Cross reference information
|
//! Cross reference information
|
||||||
map<int, ExprNode::EquationInfo> xrefs;
|
map<int, ExprNode::EquationInfo> xrefs;
|
||||||
|
@ -287,6 +295,9 @@ public:
|
||||||
//! Find exogenous variables not used in model
|
//! Find exogenous variables not used in model
|
||||||
set<int> findUnusedExogenous();
|
set<int> findUnusedExogenous();
|
||||||
|
|
||||||
|
//! Set the max leads/lags of the original model
|
||||||
|
void setLeadsLagsOrig();
|
||||||
|
|
||||||
//! Copies a dynamic model (only the equations)
|
//! Copies a dynamic model (only the equations)
|
||||||
/*! It assumes that the dynamic model given in argument has just been allocated */
|
/*! It assumes that the dynamic model given in argument has just been allocated */
|
||||||
void cloneDynamic(DynamicModel &dynamic_model) const;
|
void cloneDynamic(DynamicModel &dynamic_model) const;
|
||||||
|
|
|
@ -2688,8 +2688,8 @@ plot_shock_decomposition_options_list : plot_shock_decomposition_option COMMA pl
|
||||||
| plot_shock_decomposition_option
|
| plot_shock_decomposition_option
|
||||||
;
|
;
|
||||||
|
|
||||||
plot_shock_decomposition_option : o_psd_use_shock_groups
|
plot_shock_decomposition_option : o_use_shock_groups
|
||||||
| o_psd_colormap
|
| o_colormap
|
||||||
| o_psd_nodisplay
|
| o_psd_nodisplay
|
||||||
| o_psd_graph_format
|
| o_psd_graph_format
|
||||||
| o_psd_detail_plot
|
| o_psd_detail_plot
|
||||||
|
@ -3514,14 +3514,10 @@ o_lmmcp : LMMCP {driver.option_num("lmmcp.status", "1"); };
|
||||||
o_occbin : OCCBIN {driver.option_num("occbin", "1"); };
|
o_occbin : OCCBIN {driver.option_num("occbin", "1"); };
|
||||||
o_function : FUNCTION EQUAL filename { driver.option_str("function", $3); };
|
o_function : FUNCTION EQUAL filename { driver.option_str("function", $3); };
|
||||||
o_sampling_draws : SAMPLING_DRAWS EQUAL INT_NUMBER { driver.option_num("sampling_draws",$3); };
|
o_sampling_draws : SAMPLING_DRAWS EQUAL INT_NUMBER { driver.option_num("sampling_draws",$3); };
|
||||||
o_use_shock_groups : USE_SHOCK_GROUPS { driver.option_str("use_shock_groups","default"); }
|
o_use_shock_groups : USE_SHOCK_GROUPS { driver.option_str("plot_shock_decomp.use_shock_groups","default"); }
|
||||||
| USE_SHOCK_GROUPS EQUAL symbol { driver.option_str("use_shock_groups", $3); }
|
| USE_SHOCK_GROUPS EQUAL symbol { driver.option_str("plot_shock_decomp.use_shock_groups", $3); }
|
||||||
;
|
;
|
||||||
o_psd_use_shock_groups : USE_SHOCK_GROUPS { driver.option_str("plot_shock_decomp.use_shock_groups","default"); }
|
|
||||||
| USE_SHOCK_GROUPS EQUAL symbol { driver.option_str("plot_shock_decomp.use_shock_groups", $3); }
|
|
||||||
;
|
|
||||||
o_colormap : COLORMAP EQUAL symbol { driver.option_num("plot_shock_decomp.colormap",$3); };
|
o_colormap : COLORMAP EQUAL symbol { driver.option_num("plot_shock_decomp.colormap",$3); };
|
||||||
o_psd_colormap : COLORMAP EQUAL symbol { driver.option_num("plot_shock_decomp.colormap",$3); };
|
|
||||||
|
|
||||||
range : symbol ':' symbol
|
range : symbol ':' symbol
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue