The initial value of the likelihood is complex

Dear everyone:
When I run the [dsgevar_forward_calibrate_lambda.mod ] file in dynare again,
it is coming up with the following message:

??? Error using ==> initial_estimation_checks
The initial value of the likelihood is complex

Error in ==> dynare_estimation_1 at 169
oo_=initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_para
ms_,options_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> dsgevar_forward_calibrate_lambda at 237
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

I am very confused,so I really hope you can help me to explain why?
Thanks
Yun

the dsgevar_forward_calibrate_lambda.mod file attachment as follows:
dsgevar_forward_calibrate_lambda.mod (3.08 KB)

I am not sure what you are doing. First of all, use Dynare 4.4.1. Then use

estimated_params_init(use_calibration); end;
Moreover, why are you using an HP-filter for data generation? Also, having a normal prior for standard deviations makes no sense.

Dear professor pfeifer:
Under the guidance of you,I added the block of estimated_params_init
(use_calibration)、remove the option of HP-filter and modify standard deviations;
when I run the [dsgevar_forward_calibrate_lambda.mod ] file in dynare again, it
is coming up with the same errors, try mode_compute=6,8, or 9,remain the
same errors:

??? Error using ==> chol
Matrix must be positive definite with real diagonal.

Error in ==> metropolis_hastings_initialization at 68
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 69
ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] = …

Error in ==> dynare_estimation_1 at 931
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,
options_,M_,estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> dsgevar_forward_calibrate_lambda at 247
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

I really hope you can help me to explain why? I am very puzzled .
Thanks
Yun
dsgevar_forward_calibrate_lambda.mod (3.19 KB)

Please post the results from the mode finding from the mode_check option.

Dear professor pfeifer:
Under the suggestion of you,I added the mode_check option in estimation
command.it is coming up with the same errors:

Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 2.942844e-018.

In DsgeVarLikelihood at 242
In dynare_estimation_1 at 616
In dynare_estimation at 70
In dsgevar_forward_calibrate_lambda at 248
In dynare at 120

Log data density [Laplace approximation] is -618.823446.

??? Error using ==> chol
Matrix must be positive definite with real diagonal.

Error in ==> metropolis_hastings_initialization at 68
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 69
[ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = …

Error in ==> dynare_estimation_1 at 931
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,
estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> dsgevar_forward_calibrate_lambda at 248
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

I don’t know what the problem is.I am very puzzled .
Thank you very much! Dear professor pfeifer!
Yun

the newest dsgevar_forward_calibrate_lambda.mod file attachment as follows:
dsgevar_forward_calibrate_lambda.mod (3.19 KB)