Solver matrix (close to) singular: how to troubleshoot

I am new to Dynare and have been very impressed with its capabilities. At the moment, I am trying to replicate the results in Aoki Benigno Kiyotaki (2016) Monetary and Financial Policies in EMEs working paper. Since I am still learning a lot, I decided to go slow: from simple to more complex. I am trying to replicate the basic closed economy model in their set-up, then add sticky prices, then open up the economy, then add “bankers.” I am fine with former, but when I add Rotemberg’s sticky prices equations, I am running into a lot of problems.

  1. Steady state solver reaches maxit and fails to converge.

[quote]Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of steady states,
or the guess values are too far from the solution

Error in steady (line 92)
print_info(info,options_.noprint, options_);[/quote]

  1. When I specify steady_state_model, everything goes throw but I get a warning:

and IRFs are explosive

[quote]stoch_simul:: The simulations conducted for generating IRFs to eA were explosive.
stoch_simul:: No IRFs will be displayed. Either reduce the shock size,
stoch_simul:: use pruning, or set the approximation order to 1.[/quote]

that is with second order perturbation, when I drop the order to 1, I get matrix singularity

[quote]One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than 1e-06!
If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.[/quote]

How would suggest me to troubleshoot this? What I am doing appears to be quite standards and I am just replicating paper. I don’t thing it is just the model’s steady state that is problematic here.

Thank you so much in advance for your help. I hope that with time, I could contribute to this great forum as well!

p.s. here is the link to the paper: … 4-2016.pdf
abk_replic_Rotemberg.mod (3.38 KB)
abk_replic_no_Rotemberg.mod (2.45 KB)

there must be fundamental singularity problem in your model. You can forget about all other problems, they are just symptoms. If you run model_diagnostics, you get

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: L w Y C K I mc pi Colinear equations 1 5 6 7 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.
Focus on those equations.

Hi ryoanji,
I looked at your code. I think you need to specify a monetary policy rule to pin down “pi”, in addition to the NKPC. See the last equation in the paper. Right now, I can combine your equation 6 and 7 together and make the system with more endogenous variables than equations (i.e. 11 endo var versus 10 non-redundant equations). I think this is where your singularity problem coming from.
Hope this helps.