dsgepy


Namedsgepy JSON
Version 1.0 PyPI version JSON
download
home_pageNone
SummarySolve and estimate linearized DSGE models
upload_time2024-05-26 19:39:13
maintainerNone
docs_urlNone
authorGustavo Amarante
requires_pythonNone
licenseNone
keywords dsge macroeconomics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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](https://github.com/gusamarante/pydsge/blob/master/Example/example_snkm.ipynb). The model used 
in the example is descibred briefly by the following equations:

<img src="http://latex.codecogs.com/gif.latex?\tilde{y}_{t}=E_{t}\left(\tilde{y}_{t+1}\right)-\frac{1}{\sigma}\left[\hat{i}_{t}-E_{t}\left(\pi_{t+1}\right)\right]+\psi_{ya}^{n}\left(\rho_{a}-1\right)a_{t}" />

<img src="http://latex.codecogs.com/gif.latex?\pi_{t}=\beta E_{t}\left(\pi_{t+1}\right)+\kappa\tilde{y}_{t}+\sigma_{\pi}\varepsilon_{t}^{\pi}" />

<img src="http://latex.codecogs.com/gif.latex?\hat{i}_{t}=\phi_{\pi}\pi_{t}+\phi_{y}\tilde{y}_{t}+v_{t}" />

<img src="http://latex.codecogs.com/gif.latex?a_{t}=\rho_{a}a_{t-1}+\sigma_{a}\varepsilon_{t}^{a}" />

<img src="http://latex.codecogs.com/gif.latex?v_{t}=\rho_{v}v_{t-1}+\sigma_{v}\varepsilon_{t}^{v}" />


# 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](https://dge.repec.org/codes/sims/linre3a/). The paper explaining the solution 
method is [this one](https://dge.repec.org/codes/sims/linre3a/LINRE3A.pdf).

# 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](https://github.com/gusamarante/pydsge/blob/master/CONTRIBUTING.md) here. A 
[list of feature suggestions](https://github.com/gusamarante/pydsge/projects) 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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dsgepy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "dsge, macroeconomics",
    "author": "Gustavo Amarante",
    "author_email": "developer@dsgepy.com",
    "download_url": "https://files.pythonhosted.org/packages/6d/7e/801e38538e48688e031acd181749682dbb1ea1064f3c6af7dd2f223ff4b9/dsgepy-1.0.tar.gz",
    "platform": null,
    "description": "\n# dsgepy\nThis is a Python library to specify, calibrate, solve, simulate, estimate and \nanalyze linearized DSGE models. The specification interface is inpired by \ndynare, which allows for symbolic declarations of parameters, variables and \nequations. Once a model is calbrated or estimated, it is solved using Sims \n(2002) methodology. \nSimulated trajectories can be generated from a calibrated model. Estimation \nuses bayesian methods, specifically markov chain monte carlo (MCMC), to \nsimulate the posterior distributions of the parameters. Analysis tools include \nimpulse-response functions, historical decompostion and extraction of latent \nvariables.\n\nThis library is an effort to bring the DSGE toolset into the open-source world \nin a full python implementation, which allows to embrace the advantages of this \nprogramming language when working with DSGEs.\n\n---\n# Installation\nYou can install this development version using:\n```\npip install dsgepy\n```\n\n---\n# Example\nA full example on how to use this library with a small New Keynesian model is available in \n[this Jupyter notebook](https://github.com/gusamarante/pydsge/blob/master/Example/example_snkm.ipynb). The model used \nin the example is descibred briefly by the following equations:\n\n<img src=\"http://latex.codecogs.com/gif.latex?\\tilde{y}_{t}=E_{t}\\left(\\tilde{y}_{t+1}\\right)-\\frac{1}{\\sigma}\\left[\\hat{i}_{t}-E_{t}\\left(\\pi_{t+1}\\right)\\right]+\\psi_{ya}^{n}\\left(\\rho_{a}-1\\right)a_{t}\" />\n\n<img src=\"http://latex.codecogs.com/gif.latex?\\pi_{t}=\\beta E_{t}\\left(\\pi_{t+1}\\right)+\\kappa\\tilde{y}_{t}+\\sigma_{\\pi}\\varepsilon_{t}^{\\pi}\" />\n\n<img src=\"http://latex.codecogs.com/gif.latex?\\hat{i}_{t}=\\phi_{\\pi}\\pi_{t}+\\phi_{y}\\tilde{y}_{t}+v_{t}\" />\n\n<img src=\"http://latex.codecogs.com/gif.latex?a_{t}=\\rho_{a}a_{t-1}+\\sigma_{a}\\varepsilon_{t}^{a}\" />\n\n<img src=\"http://latex.codecogs.com/gif.latex?v_{t}=\\rho_{v}v_{t-1}+\\sigma_{v}\\varepsilon_{t}^{v}\" />\n\n\n# Model Especification\nFor now, the model equations have to be linearized around its steady-state. \nSoon, there will be a functionality that allows for declaration with \nnon-linearized equilibrium conditions.\n\n# Model Solution\nThe solution method used is based on the implementation of Christopher A. Sims' `gensys` function. You can find the \nauthor's original matlab code [here](https://dge.repec.org/codes/sims/linre3a/). The paper explaining the solution \nmethod is [this one](https://dge.repec.org/codes/sims/linre3a/LINRE3A.pdf).\n\n# Model Estimation\nThe models are estimated using Bayesian methdos, specifically, by simulating the posterior distribution using MCMC \nsampling. This process is slow, so there is a functionality that allows you to stop a simulation and continue \nit later from where it stoped.\n\n# Analysis\nThere are functionalities for computing Impulse-Response funcions for both state variables and observed variables. \nHistorical decomposition is also available, but only when the number of exogenous shocks matches the number of \nobserved variables.\n\n---\n# Drawbacks\nSince there is symbolic declaration of variables and equations, methdos \ninvolving them are slow. Also, MCMC methods for macroeconomic models require \nmany iterations to achieve convergence. Clearly, there is room for improvement \non the efficiency of these estimation algorithms. Contributions are welcome.\nSpeaking of contributions...\n\n---\n# Contributing\nIf you would like to contribute to this repository, plese check the \n[contributing guidelines](https://github.com/gusamarante/pydsge/blob/master/CONTRIBUTING.md) here. A \n[list of feature suggestions](https://github.com/gusamarante/pydsge/projects) is available on the projects page of this\nrepository.\n\n---\n# More Information and Help\nIf you need more information and help, specially about contributing, you can \ncontact Gustavo Amarante on developer@dsgepy.com\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Solve and estimate linearized DSGE models",
    "version": "1.0",
    "project_urls": null,
    "split_keywords": [
        "dsge",
        " macroeconomics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9d09e2bd32f54378a27cb996a1353b6414fb2c365c2ce7a22516a8dfca30682",
                "md5": "805eac93c0eac3df5bbc6bf25335e118",
                "sha256": "3df56000fb0e61cac6fc26fb0f9f54bb4c311e5efbc8f1033716d51ac32d475d"
            },
            "downloads": -1,
            "filename": "dsgepy-1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "805eac93c0eac3df5bbc6bf25335e118",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 33063,
            "upload_time": "2024-05-26T19:39:11",
            "upload_time_iso_8601": "2024-05-26T19:39:11.823011Z",
            "url": "https://files.pythonhosted.org/packages/b9/d0/9e2bd32f54378a27cb996a1353b6414fb2c365c2ce7a22516a8dfca30682/dsgepy-1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d7e801e38538e48688e031acd181749682dbb1ea1064f3c6af7dd2f223ff4b9",
                "md5": "9f22ece8cf4575cbf30baa10ceb47214",
                "sha256": "f28ca8acd910b0d93447b0bc730d19feb8f2311d50f7b12d250f60e861db21b3"
            },
            "downloads": -1,
            "filename": "dsgepy-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9f22ece8cf4575cbf30baa10ceb47214",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 33338,
            "upload_time": "2024-05-26T19:39:13",
            "upload_time_iso_8601": "2024-05-26T19:39:13.303935Z",
            "url": "https://files.pythonhosted.org/packages/6d/7e/801e38538e48688e031acd181749682dbb1ea1064f3c6af7dd2f223ff4b9/dsgepy-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-26 19:39:13",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dsgepy"
}
        
Elapsed time: 0.25206s