Dear All,

I am trying to estimate a non-linear small new-Keynesian model using cubature Kalman filter.

I have written a code and tested it with linear estimation. It went through.

When moving to non-linear filters, the following message pops up.

(measurement errors have been included in the block for prior definition)

What would you do to overecome it?

Here, please, find attached code, data and results for the linear and non-linear case.

NK_test.zip (824.1 KB)

Many thanks in advance.

```
Error using chol
Matrix must be positive definite.
Error in nonlinear_kalman_filter (line 116)
StateVectorVarianceSquareRoot =
chol(ReducedForm.StateVectorVariance)';
Error in non_linear_dsge_likelihood (line 334)
LIK =
feval(DynareOptions.particle.algorithm,ReducedForm,Y,start,DynareOptions.particle,DynareOptions.threads);
Error in initial_estimation_checks (line 137)
[fval,info] =
feval(objective_function,xparam1,DynareDataset,DatasetInfo,DynareOptions,Model,EstimatedParameters,BayesInfo,BoundsInfo,DynareResults);
Error in dynare_estimation_1 (line 165)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
Error in NKt_estYPIR (line 301)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 235)
evalin('base',fname) ;
```