HANK model in Dynare

Hello Dynare comminity,

Recently I got interested in using HANK models for non-linear fiscal multipliers. But the problem lies in practical part of it.

I came across few sources of codes which solves the HANK model in Dynare. First is Thomas Winberry’s codes ( which I found on Dynare forum) and another one is presentation by Normann Rion and Sébastien Villemot (/https://sebastien.villemot.name/pdf/talks/2024/hank.pdf). Which also includes codes in Dynare.

In both cases I failed to successfully execute those codes in Dynare.

As for Thomas Winberry’s codes, the dynamics.m file runs into the error.

As for Normann Rion and Sébastien Villemot case, when trying to write it as a model (from codes given in presentation, but I could not fully build all blocks of model from the presentation) using latest stable Dynare. But I am not quite sure the commands given in presentation are yet implemented in Dynare. If so can someone help me on this issue to finish the all blocks of the model for HANK model (I am attaching the model file).

Thanks in advance

HANK.mod (958 Bytes)

  1. The Dynare HANK codes should arrive for public consumption some time in December. A first draft version is already online at Draft: Implements solution methods for models with rich heterogeneity. (!2414) · Merge requests · Dynare / dynare · GitLab
  2. What is the error message for Winberry’s codes? The version I maintain at GitHub - JohannesPfeifer/winberryAlgorithmCodes: Dynare codes for A Method for Solving and Estimating Heterogeneous Agent Macro Models should work in Dynare 7.
2 Likes

Thank you very much for reply professor Pfeifer, looking forward to addition of HANK codes in December.

As for error message for Windberry’s codes here is the snapchat of it

(I tried running it on dynare 5.5 and 6.4 with matlab R2018b).

That very much looks like a path conflict.

(1) is a great development! I have a couple of questions:

What algorithm does Dynare use to solve for the steady state of the model? Time iteration on the Euler equation?

In the example on the slides, Dynare is able to handle a constraint like k’>=0. What about discrete choices like owning vs renting or occupational choice?

Thanks in advance!

@normann can say more about this. The current draft at Draft: Add experimental steady-state computation for heterogeneous-agent models (!2428) · Merge requests · Dynare / dynare · GitLab for solving the steady state uses a solver that:

  1. Solves the household problem via time iteration to compute policy functions
  2. Computes the stationary distribution using transition matrices and a forward iteration loop
  3. Compute the aggregate residuals of equations involving aggregated heterogeneous variables

Discrete choices are not yet supported, I think.

1 Like