Dear All,
I am trying to estimate a model with particle filtering. My model at order 1 (mode_compute=9) works, so I tried to switch to order 2. These are the steps I followed:

I used (log) first differenced data instead of (log) onesideHPfiltered series (to avoid the mean=0 problem).

I used undemeaned observation equations as suggested in Chapter 8 of Pfeifer’s paper “Guide to Specifying Observation Equations for the
Estimation of DSGE Models”. 
I added measurement errors to the observation equations.
Unfortunately, I keep getting the error “Matrix must be positive definite”. Since the model works in order 1, I suspect I have a problem with my data.
Please find the .mod file and data attached (I am using Dynare 4.5.7). Thank you in advance
prova99OW_estimation_particle.mod (7.5 KB)
data2.mat (7.2 KB)