Commit 3c79e231 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Removed penalty_hessian routine.

 + Code factorization.
 + Added an option for using the penalized objective when computing numerically
 the hessian at the mode.

Previous behaviour (introduced with penalty_hessian routine) was to compute the
hessian matrix at the mode with the penalized objective function (instead of
the original objective function). This behaviour hides problematic situations,
where the computed hessian (using the original objective) would not be full
rank. For instance, if the estimation ends up with a parameter on (or very
close to) the bounds of its possible values (which is often not a desirable
outcome), the estimated posterior variance would be zero for this
parameter (with the original objective) because the hessian is not finite in
this direction, while the posterior variance would be positive if the penalized
objective is used instead. But this estimate would not be reliable by
construction of the penalty which is quite ad-hoc (more fundamentally I do not
think that there exists any rational for approximating the covariance matrix
with the inverse of the hessian matrix if the mode is on the border of the set
of possible values).

This commit restore the behaviour previous to 2446ab02ba4b3ed88c9c5021aced076078d96007.

An option is available for computing the hessian with the penalized
objective function.
parent ea774b3f
......@@ -113,6 +113,7 @@ class ParsingDriver;
%token CPF_WEIGHTS AMISANOTRISTANI MURRAYJONESPARSLOW
%token FILTER_ALGORITHM PROPOSAL_APPROXIMATION CUBATURE UNSCENTED MONTECARLO DISTRIBUTION_APPROXIMATION
%token <string_val> NAME
%token USE_PENALIZED_OBJECTIVE_FOR_HESSIAN
%token NAN_CONSTANT NO_STATIC NOBS NOCONSTANT NODISPLAY NOCORR NODIAGNOSTIC NOFUNCTIONS NO_HOMOTOPY
%token NOGRAPH POSTERIOR_NOGRAPH POSTERIOR_GRAPH NOMOMENTS NOPRINT NORMAL_PDF SAVE_DRAWS
%token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS MAX_DIM_COVA_GROUP ADVANCED OUTFILE OUTVARS OVERWRITE
......@@ -1825,6 +1826,7 @@ estimation_options : o_datafile
| o_posterior_sampling_method
| o_posterior_sampler_options
| o_keep_kalman_algo_if_singularity_is_detected
| o_use_penalized_objective_for_hessian
;
list_optim_option : QUOTED_STRING COMMA QUOTED_STRING
......@@ -3232,6 +3234,7 @@ o_mcmc_jumping_covariance : MCMC_JUMPING_COVARIANCE EQUAL HESSIAN
| MCMC_JUMPING_COVARIANCE EQUAL filename
{ driver.option_str("MCMC_jumping_covariance", $3); }
;
o_use_penalized_objective_for_hessian : USE_PENALIZED_OBJECTIVE_FOR_HESSIAN { driver.option_num("hessian.use_penalized_objective","true"); };
o_irf_plot_threshold : IRF_PLOT_THRESHOLD EQUAL non_negative_number { driver.option_num("impulse_responses.plot_threshold", $3); };
o_dr_display_tol : DR_DISPLAY_TOL EQUAL non_negative_number { driver.option_num("dr_display_tol", $3); };
o_consider_all_endogenous : CONSIDER_ALL_ENDOGENOUS { driver.option_str("endo_vars_for_moment_computations_in_estimation", "all_endogenous_variables"); };
......
......@@ -400,6 +400,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>distribution_approximation {return token::DISTRIBUTION_APPROXIMATION;}
<DYNARE_STATEMENT>proposal_distribution {return token::PROPOSAL_DISTRIBUTION;}
<DYNARE_STATEMENT>no_posterior_kernel_density {return token::NO_POSTERIOR_KERNEL_DENSITY;}
<DYNARE_STATEMENT>use_penalized_objective_for_hessian {return token::USE_PENALIZED_OBJECTIVE_FOR_HESSIAN;}
<DYNARE_STATEMENT>alpha {
yylval->string_val = new string(yytext);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment