Generalised Schur decomposition in dynare


My question is about how dynare carries out the generalised schur decomposition used to find the policy functions.

I am trying to solve the ‘Pbar’ model by McCallum in dynare, as well as manually, as an exercise to understand dynare’s solution method at each step. The mod file is attached here, and so is the small code I am using to solve the same model by Blanchard-Kahn method. The (absolute) eigenvalues of the system from the dynare solution are the same as the eigenvalues calculated by the small program. (The model solution using the BK method requires me to introduce a dummy variable, so there is one additional eigenvalue in that case.)

So my question is that if the eigenvalues are same, doesn’t it imply that the Q and Z matrices are also the same? If I try to calculate the policy functions using my code, the matrices become singular, but dynare does provide the solution, which confused me. I have checked numerical accuracy of the code by solving Hansen’s RBC model, and it works. Could anyone please help out with this? If I could pin down exactly what I am doing wrongly to be unable to generate dynare’s solution, it would be really helpful.

(A possibility is that I am inputting the model wrongly in the BK solution method, which might well be the case, but I can consider that only if this query can be addressed!)

Thank you very much for any suggestions.

pbar1.mod (502 Bytes)
BK_Pbar_III_dynarecompare.m (2.38 KB)

  1. Have you checked wither the Dynare results coincide with the published version of the paper? If yes, you have a correct benchmark.
  2. Could it be that you mean QZ-decomposition and not Blanchard-Kahn. The BK method usually relies on the Jordan decomposition.
  3. I have a hard time following your m-file. Please outline the variable ordering and equation ordering as it is not the same as in Dynare.
  4. How did you treat y
    in your code? It is both forward looking and predetermined as it shows up in three different periods.

Thank you for your response, Prof. Pfeifer.

  1. I could not find any results which would be comparable to the results from dynare. The paper only explains how it would work but does not provide any comparable results. This is the main reason I have had issues with the solution. Also, as you can see, the model has issues with determinacy for standard parameter values, primarily the inflation coefficient in the Taylor rule.

  2. The BK method for solution is what I adopted from George McCandless’ book ‘ABCs of RBCs’ (Ch. 6 appendix). That is how I wrote the MATLAB code to match his BK solution in the book (where he uses QZ decomposition). This code can replicate his solution, so I assumed that it might be reliable. I was not aware of the Jordan method instead of the QZ method. I will also look into that as a possible alternative to solving the model manually.

  3. Apologies for the m file quality. I am uploading a modified one which clearly lists the order of equations, as well as the variables in the coefficient matrices.

  4. The variable ‘y’ appears as a forward looking variable in the usual IS curve, but also with a lag in the pricing equation (equation 2. in the m file). I have created the dummy ‘m’ to account for this lag in ‘y’.

Thank you very much once again Prof. Pfeifer. Your inputs have always been very helpful. In case there is some theory I need to study for better understanding the issue, please could you point me to a reference?

pbar1.mod (502 Bytes)
BK_Pbar_III_dynarecompare.m (2.67 KB)

Dear Prof. Pfeifer,

I managed to sort out the issue and replicate the dynare solution. The issue was that I was putting the model into the BK representation erroneously. Specifically, I made y predetermined and changed the dummy accordingly. The model still has determinacy issues for usual parameter values, but I plan to address that next.

Thank you for your help.


I am glad to hear it worked