Basic New Keynesian model - nonlinear

Dear Dynare forum,

I would like to ask, whether somebody could share with me a link to some lecture notes, that provides derivation of simple three equations New Keynesian model in full nonlinear form. Thanks in advance!

Best,
Honza

I would recommend Gali’s textbook together with https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2015/Derivation_Recursive_Pricing_Equation.pdf

Thank your very much!

Dear Prof. Pfeifer,

I am trying to implement a very basic NKE in its nonlinear form because ultimately I would like to conduct welfare analysis. Unluckily, I am getting stuck at the very beginning when I try to include the price dispersion equations set. Although I did it before reading your very detailed derivation of Gali’s chapter 3, I still don’t know where I am getting it wrong.

I have solved the SS version of the model analytically and everything seems to be fine. However, I don’t manage to meet the BK condition. I have tried two alternative approaches:

  1. using an explicit variable for inflation (as most of the people do) I get 7 eigenvalues >1 for 6 foreward-looking variables
    M02_NKE_NonLinear3.mod (2.5 KB)
  2. just using quotients of P/P(-1) instead of defining a new variable PI. In this case I get 5 eigenvalues>1 for 6 foreward-looking variables.
    M02_NKE_NonLinear2.mod (2.4 KB)

I have also tried the MODEL_DIAGNOSTICS command: It says that the Jacobian is singular. However, I don’t see where I have the unit root. Is there a way to find out which is the “redundant” equation creating problems? So far it lists 5 colinear variables and 6 colinear.

I am attaching my derivation notes so you can see how I arrived at the equations:
NKE_Baseline.pdf (180.3 KB)

Thanks in advance!

UPDATE:
Now, I am even more confused. I have slightly modified the model to drop one equation, the resource constraint C+I=Y, by putting it implicitly within the rest of equations. It still solves the SS with the same values as before but now the error message says that there are 6 eigenvalues larger than 1 in modulus for 6 forward-looking variables and that the rank condition is not verified. I am really puzzled. M02_NKE_NonLinear4.mod (2.8 KB)

Where is the Taylor rule in your model?

Good question…back to paper and pencil
Thanks!

It works!!! I can only say God bless you.
I was so much paying attention to the pricing equations that I completely overlooked this…I added a standard Taylor rule and dropped the production function (since I can derive Y without using it).
Although I get a nice IRF for inflation (PI), the line for price dispersion (S) seems to be a bit weird. Does it look plausible to you? Do you have a reference where I could learn more how to interpret these results?

Price dispersion is zero up to order=1. At order=2, you really need a lot of replications to get anything smooth.

I tried with replic=50000 and got a smoother IRF.
Thanks a million!!!

It looks I could not go a lot further without getting stuck again. I have tried to extend the model by including a government sector that has 2 policy instruments: government consumption G (which is part of aggregate demand) and taxes on consumption and private investment (with a tax rate tauC).
At first, I was really happy because I thought I made it work. However, when I was cleaning the code, I realized that I had a typo in the Taylor rule. It originally read:

RB/RBss=S_M((RB(-1)/RB)^gammaRB)(((PI/PIss)^gammaPI)((Y/Yss)^gammaY))^(1-gammaRB);*

But it should have been (at least this is what makes sense to me since it is a deviation from SS):

RB/RBss=S_M((RB(-1)/RBss)^gammaRB)(((PI/PIss)^gammaPI)((Y/Yss)^gammaY))^(1-gammaRB);*

Where the suffix ss denotes the steady-state value.

To my surprise, when I fixed the typo it stopped to work because the BK conditions are not met. I don’t really know what is wrong. I have more eigenvalues larger than one than forward-looking variables (8 vs 7) so I understand that there is an infinite number of solutions. However, both the misspecified and the right Taylor equations have RB and RB(-1) included (they just are raised to a different exponent).

Should I try proposing a different type of Taylor rule? Something not multiplicative?

I am attaching the code, the rule that works is in line 122, and the version that does not work in line 124 (commented).
M02_NKE_G_NonLinear.mod (5.1 KB)

Thanks!

That is indeed strange. Have you compared you model setup to other standard implementations like https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2015/Gali_2015_chapter_3_nonlinear.mod