dsgepy


Namedsgepy JSON
Version 0.1 PyPI version JSON
download
home_page
SummarySolve and estimate linearized DSGE models
upload_time2022-12-30 13:31:48
maintainer
docs_urlNone
authorGustavo Amarante
requires_python
license
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 calibrate, estimate and analyze linearized DSGE models. The interface is inpired by the 
dynare interface which allows for symbolic declarations of the variables and equations. The implemented bayesian 
estimation method uses markov chain monte carlo (MCMC) to simulate the posterior distributions of the parameters. 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
```

### Kalman Filter
Computing the likelihood of models involve using the kalman filter. `pykalman` is available for python, but some 
adjustments to the original library are needed to use with this library. So **in order for `dsgepy` to work you need 
the corrected version of `pykalman`, available [here](https://github.com/gusamarante/pykalman). Make sure to clone this 
version and add it to the interpreter befor using `dsgepy`**. The corrections here correct the way `pykalman` handles 
masked numpy arrays and deals with ill-estimated covariance matrices. 

---
# 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 non-linearized declaration 
of the 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. Simulations are typically long, 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, so the MCMC methods 
typically take a long time to run. Although there is room for improvement for the efficiency of these estimation
algorithms.

---
# 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": "",
    "name": "dsgepy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "dsge,macroeconomics",
    "author": "Gustavo Amarante",
    "author_email": "developer@dsgepy.com",
    "download_url": "https://files.pythonhosted.org/packages/29/6a/4b4bc787532fa8c1475254f246675c7a9fede934b01a11fcd607ae7b6a1b/dsgepy-0.1.tar.gz",
    "platform": null,
    "description": "\n# dsgepy\nThis is a Python library to calibrate, estimate and analyze linearized DSGE models. The interface is inpired by the \ndynare interface which allows for symbolic declarations of the variables and equations. The implemented bayesian \nestimation method uses markov chain monte carlo (MCMC) to simulate the posterior distributions of the parameters. This \nlibrary is an effort to bring the DSGE toolset into the open-source world in a full python implementation, which allows \nto embrace the advantages of this programming language when working with DSGEs.\n\n---\n# Installation\nYou can install this development version using:\n```\npip install dsgepy\n```\n\n### Kalman Filter\nComputing the likelihood of models involve using the kalman filter. `pykalman` is available for python, but some \nadjustments to the original library are needed to use with this library. So **in order for `dsgepy` to work you need \nthe corrected version of `pykalman`, available [here](https://github.com/gusamarante/pykalman). Make sure to clone this \nversion and add it to the interpreter befor using `dsgepy`**. The corrections here correct the way `pykalman` handles \nmasked numpy arrays and deals with ill-estimated covariance matrices. \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 non-linearized declaration \nof the 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. Simulations are typically long, 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 involving them are slow, so the MCMC methods \ntypically take a long time to run. Although there is room for improvement for the efficiency of these estimation\nalgorithms.\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 contact Gustavo Amarante on \ndeveloper@dsgepy.com\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Solve and estimate linearized DSGE models",
    "version": "0.1",
    "split_keywords": [
        "dsge",
        "macroeconomics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "003614cd070d0f87666905472ac0a56b",
                "sha256": "47ae78e20079eea54e148245031e93424c775774981a061101dfe26ed53691b6"
            },
            "downloads": -1,
            "filename": "dsgepy-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "003614cd070d0f87666905472ac0a56b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19687,
            "upload_time": "2022-12-30T13:31:46",
            "upload_time_iso_8601": "2022-12-30T13:31:46.971607Z",
            "url": "https://files.pythonhosted.org/packages/e5/ae/8f5b302e5f707e31e135251e0fe0d7a7a4539b61b773faa1be1e5234bbb4/dsgepy-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "40022ca4eec2629a448b13cfb177a79f",
                "sha256": "0fc6382031d8932249c097fa8fb138a2a431cbd2bec3b66c56c483aca02a90a8"
            },
            "downloads": -1,
            "filename": "dsgepy-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "40022ca4eec2629a448b13cfb177a79f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20651,
            "upload_time": "2022-12-30T13:31:48",
            "upload_time_iso_8601": "2022-12-30T13:31:48.846514Z",
            "url": "https://files.pythonhosted.org/packages/29/6a/4b4bc787532fa8c1475254f246675c7a9fede934b01a11fcd607ae7b6a1b/dsgepy-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-30 13:31:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "dsgepy"
}
        
Elapsed time: 0.02461s