Skip to main content

Solve and estimate linearized DSGE models

Project description

dsgepy

This is a Python library to specify, calibrate, solve, simulate, estimate and analyze linearized DSGE models. The specification interface is inpired by dynare, which allows for symbolic declarations of parameters, variables and equations. Once a model is calbrated or estimated, it is solved using Sims (2002) methodology. Simulated trajectories can be generated from a calibrated model. Estimation uses bayesian methods, specifically markov chain monte carlo (MCMC), to simulate the posterior distributions of the parameters. Analysis tools include impulse-response functions, historical decompostion and extraction of latent variables.

This library is an effort to bring the DSGE toolset into the open-source world in a full python implementation, which allows to embrace the advantages of this programming language when working with DSGEs.


Installation

You can install this development version using:

pip install dsgepy

Example

A full example on how to use this library with a small New Keynesian model is available in this Jupyter notebook. The model used in the example is descibred briefly by the following equations:

Model Especification

For now, the model equations have to be linearized around its steady-state. Soon, there will be a functionality that allows for declaration with non-linearized equilibrium conditions.

Model Solution

The solution method used is based on the implementation of Christopher A. Sims' gensys function. You can find the author's original matlab code here. The paper explaining the solution method is this one.

Model Estimation

The models are estimated using Bayesian methdos, specifically, by simulating the posterior distribution using MCMC sampling. This process is slow, so there is a functionality that allows you to stop a simulation and continue it later from where it stoped.

Analysis

There are functionalities for computing Impulse-Response funcions for both state variables and observed variables. Historical decomposition is also available, but only when the number of exogenous shocks matches the number of observed variables.


Drawbacks

Since there is symbolic declaration of variables and equations, methdos involving them are slow. Also, MCMC methods for macroeconomic models require many iterations to achieve convergence. Clearly, there is room for improvement on the efficiency of these estimation algorithms. Contributions are welcome. Speaking of contributions...


Contributing

If you would like to contribute to this repository, plese check the contributing guidelines here. A list of feature suggestions is available on the projects page of this repository.


More Information and Help

If you need more information and help, specially about contributing, you can contact Gustavo Amarante on developer@dsgepy.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsgepy-1.0.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

dsgepy-1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file dsgepy-1.0.tar.gz.

File metadata

  • Download URL: dsgepy-1.0.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for dsgepy-1.0.tar.gz
Algorithm Hash digest
SHA256 f28ca8acd910b0d93447b0bc730d19feb8f2311d50f7b12d250f60e861db21b3
MD5 9f22ece8cf4575cbf30baa10ceb47214
BLAKE2b-256 6d7e801e38538e48688e031acd181749682dbb1ea1064f3c6af7dd2f223ff4b9

See more details on using hashes here.

File details

Details for the file dsgepy-1.0-py3-none-any.whl.

File metadata

  • Download URL: dsgepy-1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for dsgepy-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3df56000fb0e61cac6fc26fb0f9f54bb4c311e5efbc8f1033716d51ac32d475d
MD5 805eac93c0eac3df5bbc6bf25335e118
BLAKE2b-256 b9d09e2bd32f54378a27cb996a1353b6414fb2c365c2ce7a22516a8dfca30682

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page