A question about Dynare and NK model

Hello,

I am working on a NK model with deferred compensation, and I need some help with Dynare code. Two of the first order conditions I have include the sum of past/future values, for example
image

I am not sure how to write down the equation for F3,t in Dynare and whether this would require a loop? I would appreciate any help.

You need to rewrite the equation in the form of a difference equation.

It seems the sum only contains finitely many terms. In that case, a loop like in the bkk.mod of Dynare’s examples folder is the way to go.

Yes, the sum is finite - thank you very much, Prof. Pfeifer.

Hi Prof. Pfeifer,

I’m sorry to bother you but I have another issue with the code - I wrote the code with the loop for the sum which generates the attached .mod file. But, I can’t figure out why .mod file does not work - I keep getting NaN for the residuals of static equations. I think the issue could be due to the equations below:
image

which hold for t=nu onwards, but I do not know how to specify the initial conditions for X^R_t and chi_t for t = 0 to nu? Thank you in advance for your help.

ebp_foc.mod (3.1 KB)

You are using

ws = w; 

before it has been defined. Also

pi = p/p(-1) - 1; 

implies your model has a unit root. Numerically solving for the steady state will typically fail due to there being infinitely many steady states.

Thank you!

Hi dear,
Excuse me, how did you code Sigma?

I did not find bkk.mod in the Diner folder

Every Dynare installation has that folder. You can see it at examples · master · Dynare / dynare · GitLab