Added the possibility to pass a dseries object to the data command (the user can manipulate the data in the mod file, using dseries class methods, and use them for estimation without writing the data on disk).

issue#70
Stéphane Adjemian (Charybdis) 2014-06-17 16:03:30 +02:00
parent 2adc349bea
commit 78c72dad5f
3 changed files with 14 additions and 3 deletions

View File

@ -1876,9 +1876,17 @@ EstimationDataStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon
exit(EXIT_FAILURE);
}
if (options_list.string_options.find("file") == options_list.string_options.end())
if ((options_list.string_options.find("file") == options_list.string_options.end()) &&
(options_list.string_options.find("series") == options_list.string_options.end()))
{
cerr << "ERROR: The file option must be passed to the data statement." << endl;
cerr << "ERROR: The file or series option must be passed to the data statement." << endl;
exit(EXIT_FAILURE);
}
if ((options_list.string_options.find("file") != options_list.string_options.end()) &&
(options_list.string_options.find("series") != options_list.string_options.end()))
{
cerr << "ERROR: The file and series options cannot be used simultaneously in the data statement." << endl;
exit(EXIT_FAILURE);
}
}

View File

@ -90,7 +90,7 @@ class ParsingDriver;
%token BVAR_REPLIC BYTECODE ALL_VALUES_REQUIRED
%token CALIB_SMOOTHER CHANGE_TYPE CHECK CONDITIONAL_FORECAST CONDITIONAL_FORECAST_PATHS CONF_SIG CONSTANT CONTROLLED_VAREXO CORR COVAR CUTOFF CYCLE_REDUCTION LOGARITHMIC_REDUCTION
%token CONSIDER_ALL_ENDOGENOUS CONSIDER_ONLY_OBSERVED
%token DATAFILE FILE DOUBLING DR_CYCLE_REDUCTION_TOL DR_LOGARITHMIC_REDUCTION_TOL DR_LOGARITHMIC_REDUCTION_MAXITER DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE CALIBRATION DIFFERENTIATE_FORWARD_VARS
%token DATAFILE FILE SERIES DOUBLING DR_CYCLE_REDUCTION_TOL DR_LOGARITHMIC_REDUCTION_TOL DR_LOGARITHMIC_REDUCTION_MAXITER DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE CALIBRATION DIFFERENTIATE_FORWARD_VARS
%token END ENDVAL EQUAL ESTIMATION ESTIMATED_PARAMS ESTIMATED_PARAMS_BOUNDS ESTIMATED_PARAMS_INIT EXTENDED_PATH ENDOGENOUS_PRIOR
%token FILENAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS LAST_OBS SET_TIME
%token <string_val> FLOAT_NUMBER DATES
@ -1366,6 +1366,7 @@ data_options_list : data_options_list COMMA data_options
;
data_options : o_file
| o_series
| o_data_first_obs
| o_data_last_obs
| o_data_nobs
@ -2493,6 +2494,7 @@ o_simul_seed : SIMUL_SEED EQUAL INT_NUMBER { driver.error("'simul_seed' option i
o_qz_criterium : QZ_CRITERIUM EQUAL non_negative_number { driver.option_num("qz_criterium", $3); };
o_qz_zero_threshold : QZ_ZERO_THRESHOLD EQUAL non_negative_number { driver.option_num("qz_zero_threshold", $3); };
o_file : FILE EQUAL filename { driver.option_str("file", $3); };
o_series : SERIES EQUAL symbol { driver.option_str("series", $3); };
o_datafile : DATAFILE EQUAL filename { driver.option_str("datafile", $3); };
o_nobs : NOBS EQUAL vec_int
{ driver.option_vec_int("nobs", $3); }

View File

@ -604,6 +604,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
<DYNARE_STATEMENT>simul_replic {return token::SIMUL_REPLIC;}
<DYNARE_STATEMENT>xls_sheet {return token::XLS_SHEET;}
<DYNARE_STATEMENT>xls_range {return token::XLS_RANGE;}
<DYNARE_STATEMENT>series {return token::SERIES;}
<DYNARE_STATEMENT>mh_recover {return token::MH_RECOVER;}
<DYNARE_STATEMENT>planner_discount {return token::PLANNER_DISCOUNT;}
<DYNARE_STATEMENT>calibration {return token::CALIBRATION;}