2008-02-03 11:28:36 +01:00
|
|
|
/*
|
2018-01-30 16:33:16 +01:00
|
|
|
* Copyright (C) 2003-2018 Dynare Team
|
2008-02-03 11:28:36 +01:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _COMPUTINGTASKS_HH
|
|
|
|
#define _COMPUTINGTASKS_HH
|
|
|
|
|
|
|
|
#include <ostream>
|
|
|
|
|
2008-04-07 15:14:40 +02:00
|
|
|
#include "SymbolList.hh"
|
2008-02-03 11:28:36 +01:00
|
|
|
#include "SymbolTable.hh"
|
|
|
|
#include "Statement.hh"
|
2009-04-14 16:39:53 +02:00
|
|
|
#include "StaticModel.hh"
|
2009-04-30 15:14:33 +02:00
|
|
|
#include "DynamicModel.hh"
|
2018-09-03 17:16:28 +02:00
|
|
|
#include "ModelEquationBlock.hh"
|
2008-02-03 11:28:36 +01:00
|
|
|
|
|
|
|
class SteadyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SteadyStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CheckStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit CheckStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class SimulStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SimulStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2014-04-09 17:57:17 +02:00
|
|
|
class PerfectForesightSetupStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit PerfectForesightSetupStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2014-04-09 17:57:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PerfectForesightSolverStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit PerfectForesightSolverStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2014-04-09 17:57:17 +02:00
|
|
|
};
|
|
|
|
|
2015-10-13 17:16:10 +02:00
|
|
|
class PriorPosteriorFunctionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2015-10-14 11:02:35 +02:00
|
|
|
const bool prior_func;
|
2015-10-13 17:16:10 +02:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
PriorPosteriorFunctionStatement(const bool prior_func_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2015-10-13 17:16:10 +02:00
|
|
|
};
|
|
|
|
|
2018-09-21 17:13:19 +02:00
|
|
|
|
|
|
|
class DetCondForecast : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const bool linear_decomposition;
|
|
|
|
public:
|
|
|
|
DetCondForecast(const SymbolList &symbol_list_arg,
|
|
|
|
const OptionsList &options_list_arg,
|
|
|
|
const bool linear_decompositiontion_arg);
|
|
|
|
//virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
|
|
|
|
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
|
|
|
|
};
|
|
|
|
|
2008-08-29 14:31:25 +02:00
|
|
|
class ModelInfoStatement : public Statement
|
2008-08-25 17:06:36 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ModelInfoStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-08-25 17:06:36 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class StochSimulStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
StochSimulStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2018-03-28 18:46:15 +02:00
|
|
|
class PacModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2018-07-31 10:49:23 +02:00
|
|
|
const string name;
|
2018-08-14 14:23:21 +02:00
|
|
|
const string aux_model_name;
|
2018-07-31 10:49:23 +02:00
|
|
|
const string discount;
|
|
|
|
const string growth;
|
2018-03-28 18:46:15 +02:00
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
vector<int> lhs;
|
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
PacModelStatement(string name_arg,
|
2018-08-14 14:23:21 +02:00
|
|
|
string aux_model_name_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
string discount_arg,
|
|
|
|
string growth_arg,
|
2018-03-28 18:46:15 +02:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2018-03-28 18:46:15 +02:00
|
|
|
void fillUndiffedLHS(vector<int> &lhs);
|
2018-08-14 14:23:21 +02:00
|
|
|
tuple<string, string, int> getPacModelInfoForPacExpectation() const;
|
2018-03-28 18:46:15 +02:00
|
|
|
};
|
|
|
|
|
2017-05-04 18:06:50 +02:00
|
|
|
class VarRestrictionsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2018-06-04 14:31:26 +02:00
|
|
|
using var_restriction_eq_crosseq_t = pair<pair<int, pair<int, int>>, expr_t>;
|
2018-07-31 10:49:23 +02:00
|
|
|
const string var_model_name;
|
|
|
|
const map<string, vector<string>> var_map;
|
2018-06-04 14:17:36 +02:00
|
|
|
const map<int, map<int, SymbolList>> exclusion_restrictions;
|
2018-06-04 14:31:26 +02:00
|
|
|
using equation_restrictions_t = map<int, pair<pair<var_restriction_eq_crosseq_t, var_restriction_eq_crosseq_t>, double>>;
|
2017-05-04 18:06:50 +02:00
|
|
|
const equation_restrictions_t equation_restrictions;
|
2018-06-04 14:31:26 +02:00
|
|
|
using crossequation_restrictions_t = vector<pair<pair<var_restriction_eq_crosseq_t, var_restriction_eq_crosseq_t>, double>>;
|
2017-05-04 18:06:50 +02:00
|
|
|
const crossequation_restrictions_t crossequation_restrictions;
|
|
|
|
const map<pair<int, int>, double> covariance_number_restriction;
|
2018-06-04 14:17:36 +02:00
|
|
|
const map<pair<int, int>, pair<int, int>> covariance_pair_restriction;
|
2017-05-16 10:09:48 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2017-05-18 17:50:58 +02:00
|
|
|
int findIdxInVector(const vector<string> &vecvars, const string &var) const;
|
2017-05-04 18:06:50 +02:00
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
VarRestrictionsStatement(string var_model_name_arg,
|
|
|
|
map<string, vector<string>> var_map_arg,
|
2018-06-04 14:17:36 +02:00
|
|
|
map<int, map<int, SymbolList>> exclusion_restrictions_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
equation_restrictions_t equation_restrictions_arg,
|
|
|
|
crossequation_restrictions_t crossequation_restrictions_arg,
|
|
|
|
map<pair<int, int>, double> covariance_number_restriction_arg,
|
2018-06-04 14:17:36 +02:00
|
|
|
map<pair<int, int>, pair<int, int>> covariance_pair_restriction_arg,
|
2017-05-16 10:09:48 +02:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2017-05-04 18:06:50 +02:00
|
|
|
};
|
|
|
|
|
2017-05-10 17:21:38 +02:00
|
|
|
class VarEstimationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2017-05-11 12:14:45 +02:00
|
|
|
const OptionsList options_list;
|
2017-05-10 17:21:38 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit VarEstimationStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2017-05-10 17:21:38 +02:00
|
|
|
};
|
|
|
|
|
2008-05-01 14:04:48 +02:00
|
|
|
class ForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
ForecastStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2014-03-08 10:05:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class RamseyModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit RamseyModelStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-05-01 14:04:48 +02:00
|
|
|
};
|
|
|
|
|
2015-05-31 12:18:06 +02:00
|
|
|
class RamseyConstraintsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2017-06-01 19:58:32 +02:00
|
|
|
struct Constraint
|
|
|
|
{
|
2015-05-31 12:18:06 +02:00
|
|
|
int endo;
|
|
|
|
BinaryOpcode code;
|
|
|
|
expr_t expression;
|
2017-06-01 19:58:32 +02:00
|
|
|
};
|
2018-06-04 14:07:13 +02:00
|
|
|
using constraints_t = vector<Constraint>;
|
2015-05-31 12:18:06 +02:00
|
|
|
private:
|
2017-02-08 18:29:57 +01:00
|
|
|
const SymbolTable &symbol_table;
|
2015-05-31 12:18:06 +02:00
|
|
|
const constraints_t constraints;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
RamseyConstraintsStatement(const SymbolTable &symbol_table_arg, constraints_t constraints_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2015-05-31 12:18:06 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class RamseyPolicyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2016-12-27 13:46:01 +01:00
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
const vector<string> ramsey_policy_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2016-12-27 13:46:01 +01:00
|
|
|
RamseyPolicyStatement(const SymbolTable &symbol_table_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
vector<string> ramsey_policy_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
2016-12-27 13:46:01 +01:00
|
|
|
void checkRamseyPolicyList();
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2011-03-13 21:19:55 +01:00
|
|
|
class DiscretionaryPolicyStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
DiscretionaryPolicyStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-03-13 21:19:55 +01:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class RplotStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit RplotStatement(SymbolList symbol_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-11-20 20:16:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class UnitRootVarsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 12:40:37 +02:00
|
|
|
UnitRootVarsStatement();
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PeriodsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int periods;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit PeriodsStatement(int periods_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DsampleStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int val1, val2;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit DsampleStatement(int val1_arg);
|
2008-02-03 11:28:36 +01:00
|
|
|
DsampleStatement(int val1_arg, int val2_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class EstimationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimationStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DynareSensitivityStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit DynareSensitivityStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class ObservationTrendsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using trend_elements_t = map<string, expr_t>;
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
const trend_elements_t trend_elements;
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
ObservationTrendsStatement(trend_elements_t trend_elements_arg,
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OsrParamsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2016-05-20 15:35:09 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
OsrParamsStatement(SymbolList symbol_list_arg, const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OsrStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
OsrStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2016-05-10 18:01:00 +02:00
|
|
|
//! Temporary structure used when parsing estimation_params* statements
|
|
|
|
class OsrParams
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string name;
|
|
|
|
expr_t low_bound, up_bound;
|
|
|
|
|
|
|
|
void
|
|
|
|
init(const DataTree &datatree)
|
|
|
|
{
|
|
|
|
name = "";
|
|
|
|
low_bound = datatree.MinusInfinity;
|
|
|
|
up_bound = datatree.Infinity;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OsrParamsBoundsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<OsrParams> osr_params_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit OsrParamsBoundsStatement(vector<OsrParams> osr_params_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2016-05-10 18:01:00 +02:00
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
class DynaTypeStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const string filename;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
DynaTypeStatement(SymbolList symbol_list_arg,
|
|
|
|
string filename_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class DynaSaveStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2008-04-07 15:14:40 +02:00
|
|
|
const SymbolList symbol_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
const string filename;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
DynaSaveStatement(SymbolList symbol_list_arg,
|
|
|
|
string filename_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModelComparisonStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using filename_list_t = vector<pair<string, string>>;
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
filename_list_t filename_list;
|
2008-02-03 11:28:36 +01:00
|
|
|
OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
ModelComparisonStatement(filename_list_t filename_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2009-01-22 16:05:38 +01:00
|
|
|
//! Temporary structure used when parsing estimation_params* statements
|
|
|
|
class EstimationParams
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
2009-01-22 16:05:38 +01:00
|
|
|
public:
|
2008-02-03 11:28:36 +01:00
|
|
|
int type;
|
2011-12-29 18:43:21 +01:00
|
|
|
string name, name2;
|
|
|
|
PriorDistributions prior;
|
2010-09-16 19:18:45 +02:00
|
|
|
expr_t init_val, low_bound, up_bound, mean, std, p3, p4, jscale;
|
2009-01-22 16:05:38 +01:00
|
|
|
|
2009-12-16 18:13:23 +01:00
|
|
|
void
|
|
|
|
init(const DataTree &datatree)
|
2008-02-03 11:28:36 +01:00
|
|
|
{
|
|
|
|
type = 0;
|
|
|
|
name = "";
|
|
|
|
name2 = "";
|
2018-07-18 16:52:12 +02:00
|
|
|
prior = PriorDistributions::noShape;
|
2009-01-22 16:05:38 +01:00
|
|
|
init_val = datatree.NaN;
|
|
|
|
low_bound = datatree.MinusInfinity;
|
|
|
|
up_bound = datatree.Infinity;
|
|
|
|
mean = datatree.NaN;
|
|
|
|
std = datatree.NaN;
|
|
|
|
p3 = datatree.NaN;
|
|
|
|
p4 = datatree.NaN;
|
|
|
|
jscale = datatree.NaN;
|
2008-02-03 11:28:36 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class EstimatedParamsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<EstimationParams> estim_params_list;
|
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsStatement(vector<EstimationParams> estim_params_list_arg,
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class EstimatedParamsInitStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<EstimationParams> estim_params_list;
|
|
|
|
const SymbolTable &symbol_table;
|
2013-11-06 10:36:58 +01:00
|
|
|
const bool use_calibration;
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsInitStatement(vector<EstimationParams> estim_params_list_arg,
|
2013-11-06 10:36:58 +01:00
|
|
|
const SymbolTable &symbol_table_arg,
|
|
|
|
const bool use_calibration_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class EstimatedParamsBoundsStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<EstimationParams> estim_params_list;
|
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
EstimatedParamsBoundsStatement(vector<EstimationParams> estim_params_list_arg,
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OptimWeightsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
using var_weights_t = map<string, expr_t>;
|
|
|
|
using covar_weights_t = map<pair<string, string>, expr_t>;
|
2008-02-03 11:28:36 +01:00
|
|
|
private:
|
2010-09-16 19:00:48 +02:00
|
|
|
const var_weights_t var_weights;
|
|
|
|
const covar_weights_t covar_weights;
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
OptimWeightsStatement(var_weights_t var_weights_arg,
|
|
|
|
covar_weights_t covar_weights_arg,
|
2008-02-03 11:28:36 +01:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlannerObjectiveStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2018-07-31 12:42:08 +02:00
|
|
|
StaticModel model_tree;
|
|
|
|
bool computing_pass_called{false};
|
2008-02-03 11:28:36 +01:00
|
|
|
public:
|
2018-07-31 12:42:08 +02:00
|
|
|
PlannerObjectiveStatement(SymbolTable &symbol_table,
|
|
|
|
NumericalConstants &num_constants,
|
2018-09-14 17:04:06 +02:00
|
|
|
ExternalFunctionsTable &external_functions_table);
|
2008-02-03 11:28:36 +01:00
|
|
|
/*! \todo check there are only endogenous variables at the current period in the objective
|
|
|
|
(no exogenous, no lead/lag) */
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
2008-10-29 16:10:51 +01:00
|
|
|
/*! \todo allow for the possibility of disabling temporary terms */
|
2018-06-04 12:53:26 +02:00
|
|
|
void computingPass() override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2018-07-31 12:42:08 +02:00
|
|
|
//! Return a reference the Planner Objective model tree
|
|
|
|
StaticModel &getPlannerObjective();
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class BVARDensityStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int maxnlags;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
BVARDensityStatement(int maxnlags_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class BVARForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const int nlags;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
BVARForecastStatement(int nlags_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2008-02-03 11:28:36 +01:00
|
|
|
};
|
|
|
|
|
2009-07-26 19:07:07 +02:00
|
|
|
class SBVARStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SBVARStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-07-26 19:07:07 +02:00
|
|
|
};
|
|
|
|
|
2011-05-11 19:02:39 +02:00
|
|
|
class MSSBVAREstimationStatement : public Statement
|
2009-07-26 19:07:07 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVAREstimationStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARSimulationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARSimulationStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARComputeMDDStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARComputeMDDStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARComputeProbabilitiesStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARComputeProbabilitiesStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARIrfStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2011-05-30 15:47:34 +02:00
|
|
|
const SymbolList symbol_list;
|
2011-05-11 19:02:39 +02:00
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
MSSBVARIrfStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARForecastStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-05-11 19:02:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class MSSBVARVarianceDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MSSBVARVarianceDecompositionStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-07-26 19:07:07 +02:00
|
|
|
};
|
|
|
|
|
2009-04-20 15:58:15 +02:00
|
|
|
class IdentificationStatement : public Statement
|
|
|
|
{
|
2009-10-14 18:16:43 +02:00
|
|
|
private:
|
2011-04-20 12:13:30 +02:00
|
|
|
OptionsList options_list;
|
2009-04-20 15:58:15 +02:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit IdentificationStatement(const OptionsList &options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-04-20 15:58:15 +02:00
|
|
|
};
|
|
|
|
|
2009-04-30 15:14:33 +02:00
|
|
|
class WriteLatexDynamicModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const DynamicModel &dynamic_model;
|
2017-04-04 15:28:27 +02:00
|
|
|
const bool write_equation_tags;
|
2009-04-30 15:14:33 +02:00
|
|
|
public:
|
2017-04-04 15:28:27 +02:00
|
|
|
WriteLatexDynamicModelStatement(const DynamicModel &dynamic_model_arg, bool write_equation_tags_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-04-30 15:14:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class WriteLatexStaticModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const StaticModel &static_model;
|
2017-08-24 15:35:10 +02:00
|
|
|
const bool write_equation_tags;
|
2009-04-30 15:14:33 +02:00
|
|
|
public:
|
2017-08-24 15:35:10 +02:00
|
|
|
WriteLatexStaticModelStatement(const StaticModel &static_model_arg, bool write_equation_tags_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-04-30 15:14:33 +02:00
|
|
|
};
|
|
|
|
|
2015-02-16 08:31:30 +01:00
|
|
|
class WriteLatexOriginalModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const DynamicModel &original_model;
|
2017-08-24 15:35:10 +02:00
|
|
|
const bool write_equation_tags;
|
2015-02-16 08:31:30 +01:00
|
|
|
public:
|
2017-08-24 15:35:10 +02:00
|
|
|
WriteLatexOriginalModelStatement(const DynamicModel &original_model_arg, bool write_equation_tags_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2015-02-16 08:31:30 +01:00
|
|
|
};
|
|
|
|
|
2017-08-30 11:32:01 +02:00
|
|
|
class WriteLatexSteadyStateModelStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SteadyStateModel &steady_state_model;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit WriteLatexSteadyStateModelStatement(const SteadyStateModel &steady_state_model_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2017-08-30 11:32:01 +02:00
|
|
|
};
|
|
|
|
|
2009-07-23 10:31:48 +02:00
|
|
|
class ShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
ShockDecompositionStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-07-23 10:31:48 +02:00
|
|
|
};
|
|
|
|
|
2017-03-21 14:58:15 +01:00
|
|
|
class RealtimeShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
RealtimeShockDecompositionStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2017-03-22 11:30:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlotShockDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
PlotShockDecompositionStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2017-03-21 14:58:15 +01:00
|
|
|
};
|
2017-03-22 11:30:35 +01:00
|
|
|
|
2017-03-31 12:50:17 +02:00
|
|
|
class InitialConditionDecompositionStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
InitialConditionDecompositionStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2017-03-31 12:50:17 +02:00
|
|
|
};
|
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
class ConditionalForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ConditionalForecastStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-10-16 19:23:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PlotConditionalForecastStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
2009-10-22 16:42:12 +02:00
|
|
|
//! A value of -1 indicates that the user didn't specify a value
|
2009-10-16 19:23:57 +02:00
|
|
|
const int periods;
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
PlotConditionalForecastStatement(int periods_arg, SymbolList symbol_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-10-16 19:23:57 +02:00
|
|
|
};
|
|
|
|
|
2012-05-30 16:28:00 +02:00
|
|
|
class CalibSmootherStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
CalibSmootherStatement(SymbolList symbol_list_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-05-30 16:28:00 +02:00
|
|
|
};
|
|
|
|
|
2012-06-08 17:36:32 +02:00
|
|
|
class ExtendedPathStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit ExtendedPathStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-06-08 17:36:32 +02:00
|
|
|
};
|
|
|
|
|
2009-12-04 22:32:19 +01:00
|
|
|
class SvarIdentificationStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 14:31:26 +02:00
|
|
|
// using svar_identification_exclusion_t = map<pair<int, int>, vector<int>>;
|
2011-10-10 11:45:55 +02:00
|
|
|
struct svar_identification_restriction
|
|
|
|
{
|
|
|
|
int equation;
|
|
|
|
int restriction_nbr;
|
|
|
|
int lag;
|
|
|
|
int variable;
|
|
|
|
expr_t value;
|
2017-06-01 19:58:32 +02:00
|
|
|
};
|
2011-10-10 11:45:55 +02:00
|
|
|
|
2018-06-04 14:07:13 +02:00
|
|
|
using svar_identification_restrictions_t = vector<svar_identification_restriction>;
|
2009-12-04 22:32:19 +01:00
|
|
|
private:
|
2011-10-10 11:45:55 +02:00
|
|
|
const svar_identification_restrictions_t restrictions;
|
2009-12-04 22:32:19 +01:00
|
|
|
const bool upper_cholesky_present;
|
|
|
|
const bool lower_cholesky_present;
|
2011-07-29 18:11:50 +02:00
|
|
|
const bool constants_exclusion_present;
|
2009-12-04 22:32:19 +01:00
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
int getMaxLag() const;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
SvarIdentificationStatement(svar_identification_restrictions_t restrictions_arg,
|
2009-12-04 22:32:19 +01:00
|
|
|
const bool &upper_cholesky_present_arg,
|
|
|
|
const bool &lower_cholesky_present_arg,
|
2017-06-01 19:58:32 +02:00
|
|
|
const bool &constants_exclusion_present_arg,
|
2009-12-04 22:32:19 +01:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-12-04 22:32:19 +01:00
|
|
|
};
|
|
|
|
|
2009-12-08 17:46:13 +01:00
|
|
|
class MarkovSwitchingStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
2011-12-19 17:32:02 +01:00
|
|
|
map <pair<int, int >, double > restriction_map;
|
2009-12-08 17:46:13 +01:00
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit MarkovSwitchingStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-12-08 17:46:13 +01:00
|
|
|
};
|
|
|
|
|
2009-12-09 01:38:53 +01:00
|
|
|
class SvarStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SvarStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2009-12-09 01:38:53 +01:00
|
|
|
};
|
|
|
|
|
2015-08-24 11:21:06 +02:00
|
|
|
class SvarGlobalIdentificationCheckStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SvarGlobalIdentificationCheckStatement();
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2015-08-24 11:21:06 +02:00
|
|
|
};
|
|
|
|
|
2011-11-29 17:14:26 +01:00
|
|
|
class SetTimeStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit SetTimeStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-11-29 17:14:26 +01:00
|
|
|
};
|
|
|
|
|
2011-12-06 15:42:57 +01:00
|
|
|
class EstimationDataStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit EstimationDataStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-06 15:42:57 +01:00
|
|
|
};
|
|
|
|
|
2012-03-28 16:19:10 +02:00
|
|
|
class SubsamplesStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//! Storage for declaring subsamples: map<subsample_name, <date1, date2 >
|
2018-06-04 14:31:26 +02:00
|
|
|
using subsample_declaration_map_t = map<string, pair<string, string>>;
|
2012-03-28 16:19:10 +02:00
|
|
|
private:
|
|
|
|
const string name1;
|
|
|
|
const string name2;
|
|
|
|
const subsample_declaration_map_t subsample_declaration_map;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2012-03-28 16:19:10 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
SubsamplesStatement(string name1_arg,
|
|
|
|
string name2_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
subsample_declaration_map_t subsample_declaration_map_arg,
|
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-03-28 16:19:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SubsamplesEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string to_name1;
|
|
|
|
const string to_name2;
|
|
|
|
const string from_name1;
|
|
|
|
const string from_name2;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2012-03-28 16:19:10 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
SubsamplesEqualStatement(string to_name1_arg,
|
|
|
|
string to_name2_arg,
|
|
|
|
string from_name1_arg,
|
|
|
|
string from_name2_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-03-28 16:19:10 +02:00
|
|
|
};
|
|
|
|
|
2015-03-03 15:08:33 +01:00
|
|
|
class JointPriorStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const vector<string> joint_parameters;
|
|
|
|
const PriorDistributions prior_shape;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
JointPriorStatement(vector<string> joint_parameters_arg,
|
|
|
|
PriorDistributions prior_shape_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
2015-03-03 15:08:33 +01:00
|
|
|
void writeOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2015-03-03 15:08:33 +01:00
|
|
|
};
|
|
|
|
|
2011-12-11 15:35:26 +01:00
|
|
|
class BasicPriorStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 12:53:26 +02:00
|
|
|
|
|
|
|
~BasicPriorStatement() override;
|
2011-12-11 15:35:26 +01:00
|
|
|
protected:
|
|
|
|
const string name;
|
2012-03-28 16:19:10 +02:00
|
|
|
const string subsample_name;
|
2011-12-29 18:43:21 +01:00
|
|
|
const PriorDistributions prior_shape;
|
2011-12-11 15:35:26 +01:00
|
|
|
const expr_t variance;
|
|
|
|
const OptionsList options_list;
|
2018-06-04 12:31:07 +02:00
|
|
|
BasicPriorStatement(string name_arg,
|
|
|
|
string subsample_name_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg,
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
2011-12-11 15:35:26 +01:00
|
|
|
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
2012-03-26 16:46:44 +02:00
|
|
|
void writeCommonOutput(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeCommonOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
2012-04-03 12:59:56 +02:00
|
|
|
void writePriorOutput(ostream &output, string &lhs_field, const string &name2) const;
|
2013-08-06 21:29:11 +02:00
|
|
|
bool is_structural_innovation(const SymbolType symb_type) const;
|
|
|
|
void writePriorIndex(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeVarianceOption(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
|
|
|
void writeShape(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeCOutputHelper(ostream &output, const string &field) const;
|
|
|
|
void writeCShape(ostream &output) const;
|
|
|
|
void writeCVarianceOption(ostream &output) const;
|
|
|
|
void writeCDomain(ostream &output) const;
|
2017-02-08 18:29:57 +01:00
|
|
|
void writeJsonShape(ostream &output) const;
|
|
|
|
void writeJsonPriorOutput(ostream &output) const;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class PriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
PriorStatement(string name_arg,
|
|
|
|
string subsample_name_arg,
|
|
|
|
PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg,
|
|
|
|
OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class StdPriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
private:
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2011-12-11 15:35:26 +01:00
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
StdPriorStatement(string name_arg,
|
|
|
|
string subsample_name_arg,
|
|
|
|
PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg,
|
|
|
|
OptionsList options_list_arg,
|
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CorrPriorStatement : public BasicPriorStatement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string name1;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2011-12-11 15:35:26 +01:00
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
CorrPriorStatement(string name_arg1,
|
2018-06-04 12:31:07 +02:00
|
|
|
string name_arg2,
|
2018-07-31 10:49:23 +02:00
|
|
|
string subsample_name_arg,
|
|
|
|
PriorDistributions prior_shape_arg,
|
|
|
|
expr_t variance_arg,
|
|
|
|
OptionsList options_list_arg,
|
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-03-30 14:55:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class PriorEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string to_declaration_type;
|
|
|
|
const string to_name1;
|
|
|
|
const string to_name2;
|
|
|
|
const string to_subsample_name;
|
|
|
|
const string from_declaration_type;
|
|
|
|
const string from_name1;
|
|
|
|
const string from_name2;
|
|
|
|
const string from_subsample_name;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2012-03-30 14:55:25 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
PriorEqualStatement(string to_declaration_type_arg,
|
|
|
|
string to_name1_arg,
|
|
|
|
string to_name2_arg,
|
|
|
|
string to_subsample_name_arg,
|
|
|
|
string from_declaration_type_arg,
|
|
|
|
string from_name1_arg,
|
|
|
|
string from_name2_arg,
|
|
|
|
string from_subsample_name_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2012-03-30 14:55:25 +02:00
|
|
|
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-11 15:35:26 +01:00
|
|
|
};
|
2011-11-29 17:14:26 +01:00
|
|
|
|
2011-12-14 17:19:14 +01:00
|
|
|
class BasicOptionsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-06-04 12:53:26 +02:00
|
|
|
|
|
|
|
~BasicOptionsStatement() override;
|
2011-12-14 17:19:14 +01:00
|
|
|
protected:
|
|
|
|
const string name;
|
2012-03-28 16:19:10 +02:00
|
|
|
const string subsample_name;
|
2011-12-14 17:19:14 +01:00
|
|
|
const OptionsList options_list;
|
2018-06-04 12:31:07 +02:00
|
|
|
BasicOptionsStatement(string name_arg,
|
|
|
|
string subsample_name_arg,
|
|
|
|
OptionsList options_list_arg);
|
2011-12-14 17:19:14 +01:00
|
|
|
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
2012-03-29 16:45:46 +02:00
|
|
|
void writeOptionsOutput(ostream &output, string &lhs_field, const string &name2) const;
|
2012-03-26 16:46:44 +02:00
|
|
|
void writeCommonOutput(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeCommonOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
2013-08-06 21:44:04 +02:00
|
|
|
bool is_structural_innovation(const SymbolType symb_type) const;
|
|
|
|
void writeOptionsIndex(ostream &output, const string &lhs_field) const;
|
|
|
|
void writeOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
|
|
|
|
void writeCOutputHelper(ostream &output, const string &field) const;
|
2017-02-08 18:29:57 +01:00
|
|
|
void writeJsonOptionsOutput(ostream &output) const;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class OptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
OptionsStatement(string name_arg, string subsample_name_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class StdOptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
private:
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2011-12-14 17:19:14 +01:00
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
StdOptionsStatement(string name_arg,
|
|
|
|
string subsample_name_arg,
|
|
|
|
OptionsList options_list_arg,
|
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CorrOptionsStatement : public BasicOptionsStatement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string name1;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2011-12-14 17:19:14 +01:00
|
|
|
public:
|
2018-07-31 10:49:23 +02:00
|
|
|
CorrOptionsStatement(string name_arg1, string name_arg2,
|
|
|
|
string subsample_name_arg,
|
|
|
|
OptionsList options_list_arg,
|
|
|
|
const SymbolTable &symbol_table_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeCOutput(ostream &output, const string &basename) override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2011-12-14 17:19:14 +01:00
|
|
|
};
|
|
|
|
|
2012-03-30 15:36:58 +02:00
|
|
|
class OptionsEqualStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const string to_declaration_type;
|
|
|
|
const string to_name1;
|
|
|
|
const string to_name2;
|
|
|
|
const string to_subsample_name;
|
|
|
|
const string from_declaration_type;
|
|
|
|
const string from_name1;
|
|
|
|
const string from_name2;
|
|
|
|
const string from_subsample_name;
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table;
|
2012-03-30 15:36:58 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
OptionsEqualStatement(string to_declaration_type_arg,
|
|
|
|
string to_name1_arg,
|
|
|
|
string to_name2_arg,
|
|
|
|
string to_subsample_name_arg,
|
|
|
|
string from_declaration_type_arg,
|
|
|
|
string from_name1_arg,
|
|
|
|
string from_name2_arg,
|
|
|
|
string from_subsample_name_arg,
|
2018-07-31 10:49:23 +02:00
|
|
|
const SymbolTable &symbol_table_arg);
|
2012-03-30 15:36:58 +02:00
|
|
|
void get_base_name(const SymbolType symb_type, string &lhs_field) const;
|
2018-06-04 12:53:26 +02:00
|
|
|
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-03-30 15:36:58 +02:00
|
|
|
};
|
|
|
|
|
2012-11-16 12:34:49 +01:00
|
|
|
class ModelDiagnosticsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ModelDiagnosticsStatement();
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2012-11-16 12:34:49 +01:00
|
|
|
};
|
|
|
|
|
2014-04-03 15:05:20 +02:00
|
|
|
class Smoother2histvalStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-10-04 15:17:13 +02:00
|
|
|
explicit Smoother2histvalStatement(OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2014-04-03 15:05:20 +02:00
|
|
|
};
|
|
|
|
|
2017-10-05 15:09:04 +02:00
|
|
|
class GMMEstimationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
GMMEstimationStatement(SymbolList symbol_list_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2017-10-05 15:09:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SMMEstimationStatement : public Statement
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SymbolList symbol_list;
|
|
|
|
const OptionsList options_list;
|
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
SMMEstimationStatement(SymbolList symbol_list_arg, OptionsList options_list_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2017-10-05 15:09:04 +02:00
|
|
|
};
|
|
|
|
|
2017-10-06 14:49:14 +02:00
|
|
|
class GenerateIRFsStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
private:
|
|
|
|
const OptionsList options_list;
|
|
|
|
const vector<string> generate_irf_names;
|
2018-06-04 14:17:36 +02:00
|
|
|
const vector<map<string, double>> generate_irf_elements;
|
2017-10-06 14:49:14 +02:00
|
|
|
public:
|
2018-06-04 12:31:07 +02:00
|
|
|
GenerateIRFsStatement(OptionsList options_list_arg,
|
|
|
|
vector<string> generate_irf_names_arg,
|
2018-06-04 14:17:36 +02:00
|
|
|
vector<map<string, double>> generate_irf_elements_arg);
|
2018-06-04 12:53:26 +02:00
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
2017-10-06 14:49:14 +02:00
|
|
|
};
|
|
|
|
|
2018-08-01 19:41:44 +02:00
|
|
|
class VarExpectationModelStatement : public Statement
|
|
|
|
{
|
|
|
|
public:
|
2018-08-22 16:57:36 +02:00
|
|
|
const string model_name, variable, aux_model_name, horizon;
|
2018-08-01 19:41:44 +02:00
|
|
|
const expr_t discount;
|
|
|
|
const SymbolTable &symbol_table;
|
|
|
|
// List of generated auxiliary param ids, in variable-major order
|
|
|
|
vector<int> aux_params_ids; // TODO: move this to some new VarModelTable object
|
|
|
|
|
|
|
|
public:
|
2018-08-22 16:57:36 +02:00
|
|
|
VarExpectationModelStatement(string model_name_arg, string variable_arg, string aux_model_name_arg,
|
2018-08-01 19:41:44 +02:00
|
|
|
string horizon_arg, expr_t discount_arg, const SymbolTable &symbol_table_arg);
|
|
|
|
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
|
|
|
void writeJsonOutput(ostream &output) const override;
|
|
|
|
};
|
|
|
|
|
2008-02-03 11:28:36 +01:00
|
|
|
#endif
|