preprocessor: add dirname option to estimation. closes #910

time-shift
Houtan Bastani 2015-04-27 11:50:25 +02:00
parent 17e03a82e3
commit 18e9521450
6 changed files with 12 additions and 3 deletions

View File

@ -4671,6 +4671,11 @@ a @uref{http://www.java.com/download,Java Runtime Environment}). Note that the
base name (ie without extension) of the datafile has to be different from the
base name of the model file.
@item dirname = @var{FILENAME}
Directory in which to store @code{estimation} output. To pass a
subdirectory of a directory, you must quote the argument. Default:
@code{<mod_file>}
@item xls_sheet = @var{NAME}
@anchor{xls_sheet}
The name of the sheet with the data in an Excel file

View File

@ -56,7 +56,7 @@ nnobs = length(nobs);
horizon = options_.forecast;
if nargin<2 || ~exist(dname) || isempty(dname)
dname = M_.fname;
dname = options_.dirname;
end
M_.dname = dname;

View File

@ -33,6 +33,7 @@ global oo_ M_ options_ estim_params_ bayestopt_ estimation_info ex0_ ys0_
estim_params_ = [];
bayestopt_ = [];
options_.datafile = '';
options_.dirname = M_.fname;
options_.dataset = [];
options_.verbosity = 1;
options_.terminal_condition = 0;

View File

@ -92,7 +92,7 @@ class ParsingDriver;
%token CONSIDER_ALL_ENDOGENOUS CONSIDER_ONLY_OBSERVED
%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 FILENAME DIRNAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS LAST_OBS SET_TIME
%token <string_val> FLOAT_NUMBER DATES
%token DEFAULT FIXED_POINT OPT_ALGO
%token FORECAST K_ORDER_SOLVER INSTRUMENTS SHIFT MEAN STDEV VARIANCE MODE INTERVAL SHAPE DOMAINN
@ -1712,6 +1712,7 @@ estimation_options : o_datafile
| o_filter_algorithm
| o_proposal_approximation
| o_distribution_approximation
| o_dirname
;
list_optim_option : QUOTED_STRING COMMA QUOTED_STRING
@ -2546,6 +2547,7 @@ o_qz_zero_threshold : QZ_ZERO_THRESHOLD EQUAL non_negative_number { driver.optio
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_dirname : DIRNAME EQUAL filename { driver.option_str("dirname", $3); };
o_nobs : NOBS EQUAL vec_int
{ driver.option_vec_int("nobs", $3); }
| NOBS EQUAL vec_int_number

View File

@ -236,6 +236,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>dates {dates_parens_nb=0; BEGIN DATES_STATEMENT; yylval->string_val = new string("dates");}
<DYNARE_STATEMENT>file {return token::FILE;}
<DYNARE_STATEMENT>datafile {return token::DATAFILE;}
<DYNARE_STATEMENT>dirname {return token::DIRNAME;}
<DYNARE_STATEMENT>nobs {return token::NOBS;}
<DYNARE_STATEMENT>last_obs {return token::LAST_OBS;}
<DYNARE_STATEMENT>first_obs {return token::FIRST_OBS;}

View File

@ -87,4 +87,4 @@ oy (log(eta));
oc (log(eta));
end;
estimation(datafile=idata,mode_compute=1,nograph);
estimation(datafile=idata,mode_compute=1,nograph,dirname='MYDIR/mysubdir');