SW two sector model issue with singularity

Dear all,

I am working with a two-sector model version of Smets and Wouters 2007.

I keep getting the following problem in the estimation.

"The rank condition is verified.

MODEL_DIAGNOSTICS:  The Jacobian of the static model is singular
MODEL_DIAGNOSTICS:  there is 1 colinear relationships between the variables and the equations
Colinear variables:
Colinear equations
    29    30    31
MODEL_DIAGNOSTICS:  The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS:  as the absolute value of one eigenvalue is in the range of +-1e-6 to 1.
MODEL_DIAGNOSTICS:  If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS:  but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS:  The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS:  redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS:  is missing. The problem often derives from Walras Law.

======== Identification Analysis ========

Testing prior mean
The model does not solve for prior_mean (info = 3: Blanchard & Kahn conditions are not satisfied: no stable equilibrium.)
Try sampling up to 50 parameter sets from the prior.

Identification stopped:
The model did not solve for any of 50 attempts of random samples from the prior".

Checked up some previous posts but can’t seem to figure it out.

Once the estimation of parameters goes through in the end gives that Blanchard & Kahn conditions are not satisfied: no stable equilibrium.

This problem was not present in previous versions of Matlab such as Matlab 2017 and older versions of dynare.

Any suggestions are welcomed.

Thank you in advance,

SW_model_sticky_2_sector.mod (16.6 KB)
usmodel_data.mat (13.1 KB)

Your model has a unit root. That requires a diffuse initialization of the type you are requesting in estimation. That explains the identification error message. You need the diffuse_filter-option.

Thanks a lot, Prof. Pfeifer for your answer. Unfortunately, this didn’t work. I keep getting the follwoing messages.

dynare_estimation_init.m:: diffuse filter is incompatible with a qz_criterium<=1. Resetting it to 1+1e-6.
Error using dynare_estimation_init
analytic derivation is incompatible with diffuse filter
Error in dynare_estimation_1 (line 110)
dynare_estimation_init(var_list_, dname, , M_, options_, oo_, estim_params_, bayestopt_);
Error in dynare_estimation (line 118)
Error in SW_model_sticky_2_sector.driver (line 827)
Error in dynare (line 278)
evalin(‘base’,[fname ‘.driver’]);

Is there a problem with the model?

No, as the message suggests, that is a problem with incompatible settings of options. You are asking for analytic derivatives of the likelihood, which is not available with the diffuse filter.

I see the problem. That was really helpful. It works now with the diffuse_filter. Thank you.