Skip to content

A unified framework to solve and analyze heterogeneous-agent macro models.

License

Notifications You must be signed in to change notification settings

M-Naderitabar/sequence-jacobian

 
 

Repository files navigation

Sequence-Space Jacobian (SSJ)

SSJ is a toolkit for analyzing dynamic macroeconomic models with (or without) rich microeconomic heterogeneity.

The conceptual framework is based on our paper Adrien Auclert, Bence Bardóczy, Matthew Rognlie, Ludwig Straub (2021), Using the Sequence-Space Jacobian to Solve and Estimate Heterogeneous-Agent Models, Econometrica 89(5), pp. 2375–2408 [ungated copy].

Requirements and installation

SSJ runs on Python 3.7 or newer, and requires Python's core numerical libraries (NumPy, SciPy, Numba). We recommend that you first install the latest Anaconda distribution. This includes all of the packages and tools that you will need to run our code.

To install SSJ, open a terminal and type

pip install sequence-jacobian

Optional package: There is an optional interface for plotting the directed acyclic graph (DAG) representation of models, which requires Graphviz for Python. With Anaconda, you can install this by typing conda install -c conda-forge python-graphviz.

Using SSJ: introductory notebooks

To learn how to use the toolkit, it's best to work through our introductory Jupyter notebooks, which show how SSJ can be used to represent and solve various models. We recommend working through the notebooks in the order listed below. Click here to download all notebooks as a zip.

  • RBC
    • represent macro models as collections of blocks (DAG)
    • write SimpleBlocks and CombinedBlocks
    • compute linearized and non-linear (perfect-foresight) impulse responses
  • Krusell-Smith
    • write HetBlocks to represent heterogeneous agents
    • construct general-equilibrium Jacobians manually
    • compute the log-likelihood of the model given time-series data
  • One-asset HANK
    • adapt an off-the-shelf HetBlock to any macro environment using helper functions
    • see a more advanced example of calibration
  • Two-asset HANK
    • write SolvedBlocks to represent implicit aggregate equilibrium conditions
    • re-use saved Jacobians
    • fine tune options of block methods
  • Labor search
    • example with multiple exogenous states
    • shocks to transition matrix of exogenous states

Resources

If you'd like to learn more about Python, its numerical libraries, and Jupyter notebooks, the introductory lectures at QuantEcon are a terrific place to start. More advanced tutorials for numerical Python include the SciPy Lecture Notes and the Python Data Science Handbook. There are many other good options as well: thanks to Python's popularity, nearly limitless answers are available via Google, Stack Overflow, and YouTube.

If you have questions or issues specific to this package, consider posting them on our GitHub issue tracker.

For those who used our pre-1.0 toolkit, which had a number of differences relative post-1.0, you can go back to our early toolkit page if needed.

Team

The current development team for SSJ is

  • Bence Bardóczy
  • Michael Cai
  • Matthew Rognlie

with contributions also from Adrien Auclert, Martin Souchier, and Ludwig Straub.

About

A unified framework to solve and analyze heterogeneous-agent macro models.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 66.4%
  • Python 33.6%