Add interface to set zero_moments_tolerance

Useful in identification and method_of_moments toolbox to set the tolerance which replaces very small numbers by hard zeros in unconditional second moments (particularly in pruned_state_space_system.m and disp_moments.m)
issue#70
Willi Mutschler 2021-02-16 16:29:26 +01:00
parent 2781e3e6f6
commit 071a46a798
No known key found for this signature in database
GPG Key ID: 91E724BF17A73F6D
2 changed files with 5 additions and 1 deletions

View File

@ -173,7 +173,7 @@ class ParsingDriver;
%token ANALYTICAL_GIRF IRF_IN_PERCENT EMAS_GIRF EMAS_DROP EMAS_TOLF EMAS_MAX_ITER
%token NO_IDENTIFICATION_STRENGTH NO_IDENTIFICATION_REDUCEDFORM NO_IDENTIFICATION_MOMENTS
%token NO_IDENTIFICATION_MINIMAL NO_IDENTIFICATION_SPECTRUM NORMALIZE_JACOBIANS GRID_NBR
%token TOL_RANK TOL_DERIV TOL_SV CHECKS_VIA_SUBSETS MAX_DIM_SUBSETS_GROUPS
%token TOL_RANK TOL_DERIV TOL_SV CHECKS_VIA_SUBSETS MAX_DIM_SUBSETS_GROUPS ZERO_MOMENTS_TOLERANCE
%token MAX_NROWS SQUEEZE_SHOCK_DECOMPOSITION WITH_EPILOGUE
%token <vector<string>> SYMBOL_VEC
@ -1329,6 +1329,7 @@ method_of_moments_option : o_mom_method
| o_qz_criterium
| o_qz_zero_threshold
| o_schur_vec_tol
| o_zero_moments_tolerance
| o_mode_check
| o_mode_check_neighbourhood_size
| o_mode_check_symmetric_plots
@ -2192,6 +2193,7 @@ identification_option : o_ar
| o_max_dim_subsets_groups
| o_order
| o_schur_vec_tol
| o_zero_moments_tolerance
;
model_comparison : MODEL_COMPARISON mc_filename_list ';'
@ -3752,6 +3754,7 @@ o_tol_deriv : TOL_DERIV EQUAL non_negative_number { driver.option_num("tol_deriv
o_tol_sv : TOL_SV EQUAL non_negative_number { driver.option_num("tol_sv", $3); };
o_checks_via_subsets : CHECKS_VIA_SUBSETS EQUAL INT_NUMBER { driver.option_num("checks_via_subsets", $3); };
o_max_dim_subsets_groups : MAX_DIM_SUBSETS_GROUPS EQUAL INT_NUMBER { driver.option_num("max_dim_subsets_groups", $3); };
o_zero_moments_tolerance : ZERO_MOMENTS_TOLERANCE EQUAL non_negative_number { driver.option_num("zero_moments_tolerance", $3); };
range : symbol ':' symbol
{ $$ = $1 + ':' + $3; }

View File

@ -710,6 +710,7 @@ DATE -?[0-9]+([ya]|m([1-9]|1[0-2])|q[1-4])
<DYNARE_STATEMENT>tol_sv {return token::TOL_SV;}
<DYNARE_STATEMENT>checks_via_subsets {return token::CHECKS_VIA_SUBSETS;}
<DYNARE_STATEMENT>max_dim_subsets_groups {return token::MAX_DIM_SUBSETS_GROUPS;}
<DYNARE_STATEMENT>zero_moments_tolerance {return token::ZERO_MOMENTS_TOLERANCE;}
<DYNARE_STATEMENT>max_nrows {return token::MAX_NROWS;}
<DYNARE_STATEMENT>with_epilogue {return token::WITH_EPILOGUE;}