Skip to content
Snippets Groups Projects
Commit 2c00f3b4 authored by Marco Ratto's avatar Marco Ratto
Browse files

New option NumgradEpsilon, that can differ from options_.gradient_epsilon

parent 2d9c6ebc
No related branches found
No related tags found
1 merge request!2224enhancements and new robust feature in line search within optimizer=5
...@@ -288,6 +288,7 @@ switch minimizer_algorithm ...@@ -288,6 +288,7 @@ switch minimizer_algorithm
newratflag = options_.newrat.hess; %default newratflag = options_.newrat.hess; %default
end end
nit=options_.newrat.maxiter; nit=options_.newrat.maxiter;
epsilon = options_.gradient_epsilon;
Verbose = options_.newrat.verbosity; Verbose = options_.newrat.verbosity;
Save_files = options_.newrat.Save_files; Save_files = options_.newrat.Save_files;
if ~isempty(options_.optim_opt) if ~isempty(options_.optim_opt)
...@@ -303,6 +304,8 @@ switch minimizer_algorithm ...@@ -303,6 +304,8 @@ switch minimizer_algorithm
else else
newratflag=flag; newratflag=flag;
end end
case 'NumgradEpsilon'
epsilon = options_list{i,2};
case 'TolFun' case 'TolFun'
crit = options_list{i,2}; crit = options_list{i,2};
case 'verbosity' case 'verbosity'
...@@ -320,7 +323,7 @@ switch minimizer_algorithm ...@@ -320,7 +323,7 @@ switch minimizer_algorithm
end end
hess_info.gstep=options_.gstep; hess_info.gstep=options_.gstep;
hess_info.htol = 1.e-4; hess_info.htol = 1.e-4;
hess_info.h1=options_.gradient_epsilon*ones(n_params,1); hess_info.h1=epsilon*ones(n_params,1);
% here we force 7th input argument (flagg) to be 0, since outer product % here we force 7th input argument (flagg) to be 0, since outer product
% gradient Hessian is handled in dynare_estimation_1 % gradient Hessian is handled in dynare_estimation_1
[opt_par_values,hessian_mat,gg,fval,invhess,new_rat_hess_info] = newrat(objective_function,start_par_value,bounds,analytic_grad,crit,nit,0,Verbose,Save_files,hess_info,prior_information.p2,options_.gradient_epsilon,parameter_names,varargin{:}); %hessian_mat is the plain outer product gradient Hessian [opt_par_values,hessian_mat,gg,fval,invhess,new_rat_hess_info] = newrat(objective_function,start_par_value,bounds,analytic_grad,crit,nit,0,Verbose,Save_files,hess_info,prior_information.p2,options_.gradient_epsilon,parameter_names,varargin{:}); %hessian_mat is the plain outer product gradient Hessian
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment