I’m trying to replicate their particle filter estimation. Prof. Schorfheide uploaded replication code written in Matlab and I’m trying to translate it. My problem is I can’t compute mode. The following error occurs.
ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):
Error using chol
Matrix must be positive definite.
I am wondering anyone could kindly give me some indication about this. Thank in advance. I’m attaching my mod file and data.
abs_nonlinear2.mod (10.3 KB)
usdat.m (15.3 KB)
Dynare’s particle filter implementation requires you to have measurement error.
Thank you for your quick response, Prof. Pfeifer, but I thought I included measurement errors and don’t understand where is wrong. I’d appreciate you correct me.
In your monograph titled by “A Guide to Specifying Observation Equations for the
Estimation of DSGE Models”, you explain there are two ways to treat measurement error. I tried to follow the method in section 6.1, i.e. treating measurement errors as a special case of exogenous variables. I defined measurement equation as follows.
// Parameter setting blocks
cstd_eYobs = sqrt( 8.3678e-050.2); // variance is calculated from data
cstd_eINFLobs = sqrt(3.3761e-050.2);
cstd_eRobs = sqrt( 7.5464e-050.2);
cstd_eDNWobs = sqrt( 6.4472e-050.2);
// MEASUREMENT EQUATION
dY_obs = (DYtil + Atil)+cstd_eYobseYobs;// + eYobs;
dNW_obs = DNW + cstd_eDNWobseDNWobs;
INFL_obs = INFL + cstd_eINFLobseINFLobs;
R_obs = R + cstd_eRobseRobs; //
However, I treated the standard deviation params (cst_eYobs, eDNWobs, eINFobs, eRobs) as fixed parameter. Is this problematic? Or, are there other mistake?
Thank you in advance.
Dynare’s current implementation of the particle filter relies on using measurement error specified with Dynare’s syntax. But my hunch is that this alone will not solve the issue. Regardless, please change the specification and then provide the updated mod-file for further debugging.
I have changed the specification of measurement errors, but it doesn’t work.
abs_nonlinear2.mod (10.5 KB)
usdat.m (15.3 KB)
I will ask the person responsible for the particle filter codes to have a look.
Thank you again. I very much look forward to your reply.
Was there any response to this matter after the last interaction? I am interested in this too.
You should set
nonlinear_filter_initialization = 2,
abs_nonlinear2.mod (10.6 KB)
On top of that, in Dynare 4.6.3 there is this problem is due to a bug in error handling in Dynare. See the change in non_linear_dsge_likelihood.m .