diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m index 669e84f20..fdc8525ab 100644 --- a/matlab/initial_estimation_checks.m +++ b/matlab/initial_estimation_checks.m @@ -44,6 +44,16 @@ if DynareDataset.vobs>length(find(diag(Model.Sigma_e)))+EstimatedParameters.nvn error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!']) end +if ~strcmpi(DynareOptions.proposal_distribution, 'rand_multivariate_student') || ... + ~strcmpi(DynareOptions.proposal_distribution, 'rand_multivariate_studuuent') + error(['initial_estimation_checks:: the proposal_distribution option to estimation takes either ' ... + 'rand_multivariate_student or rand_multivariate_normal as options']); +end + +if DynareOptions.student_degrees_of_freedom <= 0 + error('initial_estimation_checks:: the student_degrees_of_freedom takes a positive integer argument'); +end + old_steady_params=Model.params; %save initial parameters for check if steady state changes param values % % check if steady state solves static model (except if diffuse_filter == 1) diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy index bd9300e1f..5893b6dc1 100644 --- a/preprocessor/DynareBison.yy +++ b/preprocessor/DynareBison.yy @@ -87,9 +87,9 @@ class ParsingDriver; %token BVAR_DENSITY BVAR_FORECAST NODECOMPOSITION DR_DISPLAY_TOL HUGE_NUMBER %token BVAR_PRIOR_DECAY BVAR_PRIOR_FLAT BVAR_PRIOR_LAMBDA TARB_OPTIM %token BVAR_PRIOR_MU BVAR_PRIOR_OMEGA BVAR_PRIOR_TAU BVAR_PRIOR_TRAIN -%token BVAR_REPLIC BYTECODE ALL_VALUES_REQUIRED +%token BVAR_REPLIC BYTECODE ALL_VALUES_REQUIRED PROPOSAL_DISTRIBUTION %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 CONSIDER_ALL_ENDOGENOUS CONSIDER_ONLY_OBSERVED STUDENT_DEGREES_OF_FREEDOM %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 DIRNAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS LAST_OBS SET_TIME @@ -1719,6 +1719,8 @@ estimation_options : o_datafile | o_tarb_mode_compute | o_tarb_new_block_probability | o_tarb_optim + | o_proposal_distribution + | o_student_degrees_of_freedom ; list_optim_option : QUOTED_STRING COMMA QUOTED_STRING @@ -2633,6 +2635,8 @@ o_mh_drop : MH_DROP EQUAL non_negative_number { driver.option_num("mh_drop", $3) o_mh_jscale : MH_JSCALE EQUAL non_negative_number { driver.option_num("mh_jscale", $3); }; o_optim : OPTIM EQUAL '(' optim_options ')'; o_tarb_optim : TARB_OPTIM EQUAL '(' tarb_optim_options ')'; +o_proposal_distribution : PROPOSAL_DISTRIBUTION EQUAL symbol { driver.option_str("proposal_distribution", $3); }; +o_student_degrees_of_freedom : STUDENT_DEGREES_OF_FREEDOM EQUAL INT_NUMBER { driver.option_num("student_degrees_of_freedom", $3); }; o_mh_init_scale : MH_INIT_SCALE EQUAL non_negative_number { driver.option_num("mh_init_scale", $3); }; o_mode_file : MODE_FILE EQUAL filename { driver.option_str("mode_file", $3); }; o_mode_compute : MODE_COMPUTE EQUAL INT_NUMBER { driver.option_num("mode_compute", $3); }; diff --git a/preprocessor/DynareFlex.ll b/preprocessor/DynareFlex.ll index 5466487d3..92d52ecfe 100644 --- a/preprocessor/DynareFlex.ll +++ b/preprocessor/DynareFlex.ll @@ -371,6 +371,8 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2 unscented {return token::UNSCENTED;} montecarlo {return token::MONTECARLO;} distribution_approximation {return token::DISTRIBUTION_APPROXIMATION;} +proposal_distribution {return token::PROPOSAL_DISTRIBUTION;} +student_degrees_of_freedom {return token::STUDENT_DEGREES_OF_FREEDOM;} alpha { yylval->string_val = new string(yytext); diff --git a/tests/estimation/t_proposal/fs2000_student.mod b/tests/estimation/t_proposal/fs2000_student.mod index 47c90a403..e920b105a 100644 --- a/tests/estimation/t_proposal/fs2000_student.mod +++ b/tests/estimation/t_proposal/fs2000_student.mod @@ -17,7 +17,7 @@ */ /* - * Copyright (C) 2004-2010 Dynare Team + * Copyright (C) 2004-2015 Dynare Team * * This file is part of Dynare. * @@ -114,7 +114,4 @@ end; varobs gp_obs gy_obs; -options_.proposal_distribution='rand_multivariate_student'; -options_.student_degrees_of_freedom=5; - -estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=2002, mh_nblocks=2, mh_jscale=0.8,mode_compute=4); +estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=2002, mh_nblocks=2, mh_jscale=0.8,mode_compute=4, proposal_distribution=rand_multivariate_studuuent, student_degrees_of_freedom=5);