[quote=“jpfeifer”]1. The first part just means we are doing maximum likelihood instead of Bayesian estimation. That can easily be changed.
2. Please have a look at the manual of the unstable version where most of the options should be (implicitly) defined. The gstep
sets the gradient step size for numerical gradients and should usually not be altered.[/quote]
- I change your shared code in the block of estimated_params; by specifying the distribution AND keep other commands unchanged. In this case, I guess we are doing bayesian estimation.
[code]estimated_params;
a1, , , , normal_pdf, 0.5, 0.05;
a2, , , , normal_pdf, 0.0, 0.05;
a3, , , ,normal_pdf, 0.7, 0.05;
a4, , , ,normal_pdf, 0.4, 0.05;
b1, , , , normal_pdf, 0.9, 0.05;
b2, , , ,normal_pdf, 0.0, 0.05;
b3, , , ,normal_pdf, 0.8, 0.05;
c1, , , , normal_pdf, 0.95, 0.05;
stderr u, , , , gamma_pdf, 0.05, 0.05;
stderr v, , , , gamma_pdf, 0.05, 0.05;
stderr y, , , ,gamma_pdf, 0.05, 0.05;
stderr z, , , ,gamma_pdf, 0.05, 0.05;
end;[/code]
Running this mode file results in the following error message:
*Error using chol
Matrix must be positive definite.
Error in sequential_importance_particle_filter (line 74)
StateVectorVarianceSquareRoot =
chol(ReducedForm.StateVectorVariance)’;%reduced_rank_cholesky(ReducedForm.StateVectorVariance)’;
Error in non_linear_dsge_likelihood (line 333)
LIK =
feval(DynareOptions.particle.algorithm,ReducedForm,Y,start,DynareOptions.particle,DynareOptions.threads);
Error in cmaes (line 948)
fitness.raw(k) = feval(fitfun, arxvalid(:,k), varargin{:});
Error in dynare_minimize_objective (line 361)
[x, fval, COUNTEVAL, STOPFLAG, OUT, BESTEVER] =
cmaes(func2str(objective_function),start_par_value,H0,cmaesOptions,varargin{:});
Error in dynare_estimation_1 (line 199)
[xparam1, fval, exitflag, hh, options_, Scale, new_rat_hess_info] =
dynare_minimize_objective(objective_function,xparam1,options_.mode_compute,options_,[bounds.lb
bounds.ub],bayestopt_.name,bayestopt_,hh,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
Error in linear_model (line 185)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 223)
evalin(‘base’,fname) ; *
I checked the user manual and it says “mode_compute=9” call an evolutionary algorithm for difficult non-linear non-convex optimization and “mode_compute=6” uses a Monte-Carlo based optimization routine. In this case, it seems using “mode_compute=6” is still acceptable. Then I change the estimation options and use mode_compute=6
instead of mode_compute=9
. The modified mod file could be called without error message. But the system is ineffective and updated the mode after several hours. Is it proper to modify the code in this way?
- I search the user manual for unstable version using key words “options” and “particle”. It seems that the manual mentions these key words in the estimation command. Yet, it does not mention “options_.particle”. Yet I guess the following matlab file helps to understand why we need to specify the options. dynare.org/dynare-matlab-m2html/matlab/global_initialization.html