RBC model with distortionary taxes

Hello, I’m a graduate student working with DSGE models and dynare for the first time, and I’m having a bit of trouble getting my model to run.

It’s a standard RBC model which incorporates a government which raises lump sum and distortionary taxes and spends on a consumption good. I’ve combed through everything a hundred times over, and I’m fairly confident my model is specified correctly, just when it comes to putting it into dynare and log-linearizing it, I’m not sure if there may be something off in my syntax. Previously in the class, we used the loglinear option of stoch_simul, but now there’s a (potentially non-positive) bond, so I’m almost positive my issues are coming from where I’m log-linearizing.

More specifically, I’m getting residuals in the 11th and 15th equations, but I’ve tried every adjustment I think I might need to make and have gotten nowhere. If someone could take a quick look and just give some feedback on how to improve, I would greatly appreciate it. My files are attached.RBC_MainPS5.m (1.3 KB) RBC_ModelPS5.mod (3.5 KB)

This is the helper function I created to numerically solve for the steady state n. This forum would only allow 2 links attached so I’m plugging it in the replies.

rbc_steadystate_helper.m (284 Bytes)

Only do the exp()-substitution once the model works. You may want to go for auxiliary variables, see option 3 in
Question about understanding irfs in dynare

Also, are you sure your model is well-defined. It seems you are setting target levels for lump sum taxes and the bonds. Usually, lump-sum taxes balance the budget.

I was under the impression that my model didn’t work BECAUSE I didn’t exp()-substitute the variables.

When writing the model in the levels and using the “loglinear” option, the model didn’t meet all the Blanchard-Kahn conditions, so I thought that transforming the variables was the solution to this.

No, exp()-substitutions when done correctly only reexpress the model variables in different units. They don’t affect any other properties.

I’ve removed all the exp()s from my model in an attempt to start from the beginning, and I’ve also adjusted my ss lumpsum taxes and bonds to be 0, and I’m still getting residuals.

Do you have any suggestions on where else to look to get the model running?