mfrpy


Namemfrpy JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryAn open sourece DSGE solver under uncertainty
upload_time2023-01-27 07:28:30
maintainer
docs_urlNone
authorMFR Uchicago
requires_python>=3.7
license
keywords macroeconomics finance dsge uncertainty recursive utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Risk Uncertainty Value

`Expansion Suite` is an open source Python toolbox for macro-finance research. It solves the nonlinear DSGE model with recursive utility formulation motivated by robustness or risk concerns based on the small-noise expansion method.



`Expansion Suite` is built on the Linear Quadratic framework proposed by [Borovička and Hansen (2014)](https://larspeterhansen.org/wp-content/uploads/2016/10/Examining-Macroeconomic-Models-through-the-Lens-of-Asset-Pricing.pdf). It follows the algorithm in [Exploring Recursive Utility](https://larspeterhansen.org/class-notes/) to approximate the model solution under uncertainty. 



## Jupyter Notebook Illustrations

[uncertainexpansion.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/uncertainexpansion.ipynb)

- A guide to solve the DSGE model with `Expansion Suite`. 

- An example of the Adjustment Cost Model is provided in the notebook.

[shockelasticity.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/shockelasticity.ipynb)

- A guide to compute shock elasticities with `Expansion Suite` 

- An example of the Bansal Yaron Long-run Risk Model is provided in the notebook.

[quickguide.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/quickguide.ipynb)

- Provides a five-minute guide to solve the DSGE model using the expansion suite, as well as how to 
  - compute shock elasticities and IRF
  - approximate and simulate variables based on model solutions. 
- Provides some examples for `LinQuadVar` computations

## Source Files

[lin_quad.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad.py)
- Defines the linear-quadratic variable structure to facilitate operations in expansion solvers and elasticity calculation with `LinQuadVar` class.

[lin_quad_util.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad_util.py)
- Integrated operation tools on `LinQuadVar`.

[utilities.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/utilities.py)
- Matrix and linear algebra operation functions facilitate the computation.

[derivatives.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/derivatives.py)
- Functions to compute numerical derivatives used in the expansion solver.

[uncertain_expansion.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/uncertain_expansion.py)

- Functions to implement first and second order expansion, approximate the continuation values, change of probability measure, and iteration schemes.

[elasticity.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/elasticity.py)
- Functions to compute shock elasticities.

[BY_example_sol.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/BY_example_sol.py)

- Produce the solutions for the Bansal Yaron Long-run Risk Model used in the [shockelasticity.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/shockelasticity.ipynb).



## Recent Updates, by Jan. 27, 00:12, CT

1. [uncertainexpansion.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/uncertainexpansion.ipynb)
   - remove `gb_tp1` as a state variable

   - parameters updating for the adjustment cost model example, which are consistent with the homework.

     - Note the $\gamma=1$ cannot be solved by the `Expansion Suite`, the reason is that $1-\gamma$ will show in denominators of the recursive utility adjustment terms, we can try to use values close to $1$, `γ=1+1e-5`, for example.

     ```python
     γ = 10.
     ρ = 4./3
     β = np.exp(-0.0025)
     a = 0.0288
     ϕ_2 = 88.
     ϕ_1 = 1/ϕ_2
     α_k = 0.0088
     σ_k = np.array([[0.477],[0]]) * 0.01
     A = np.exp(-0.014)
     B = np.array([[0.011,0.025]]) * 0.01
     ```

2. [uncertain_expansion.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/uncertain_expansion.py), [lin_quad_util.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad_util.py), [BY_example_sol.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/BY_example_sol.py)
   - New functions and methods added

3. [quickguide.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/quickguide.ipynb)
   - New notebook added
   - Section 1 is a five-minute guide for the `Expansion Suite` as a DSGE solver. 
   - Section 2 are examples for the computations in `LinQuadVar`.





















            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mfrpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Macroeconomics,Finance,DSGE,Uncertainty,Recursive Utility",
    "author": "MFR Uchicago",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/04/cc/a79ee628fd738de6bd486df813c523c309e437435070207c62c0d76e4ec5/mfrpy-0.0.1.tar.gz",
    "platform": null,
    "description": "# Risk Uncertainty Value\n\n`Expansion Suite` is an open source Python toolbox for macro-finance research. It solves the nonlinear DSGE model with recursive utility formulation motivated by robustness or risk concerns based on the small-noise expansion method.\n\n\n\n`Expansion Suite` is built on the Linear Quadratic framework proposed by [Borovi\u010dka and Hansen (2014)](https://larspeterhansen.org/wp-content/uploads/2016/10/Examining-Macroeconomic-Models-through-the-Lens-of-Asset-Pricing.pdf). It follows the algorithm in [Exploring Recursive Utility](https://larspeterhansen.org/class-notes/) to approximate the model solution under uncertainty. \n\n\n\n## Jupyter Notebook Illustrations\n\n[uncertainexpansion.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/uncertainexpansion.ipynb)\n\n- A guide to solve the DSGE model with `Expansion Suite`. \n\n- An example of the Adjustment Cost Model is provided in the notebook.\n\n[shockelasticity.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/shockelasticity.ipynb)\n\n- A guide to compute shock elasticities with `Expansion Suite` \n\n- An example of the Bansal Yaron Long-run Risk Model is provided in the notebook.\n\n[quickguide.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/quickguide.ipynb)\n\n- Provides a five-minute guide to solve the DSGE model using the expansion suite, as well as how to \n  - compute shock elasticities and IRF\n  - approximate and simulate variables based on model solutions. \n- Provides some examples for `LinQuadVar` computations\n\n## Source Files\n\n[lin_quad.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad.py)\n- Defines the linear-quadratic variable structure to facilitate operations in expansion solvers and elasticity calculation with `LinQuadVar` class.\n\n[lin_quad_util.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad_util.py)\n- Integrated operation tools on `LinQuadVar`.\n\n[utilities.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/utilities.py)\n- Matrix and linear algebra operation functions facilitate the computation.\n\n[derivatives.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/derivatives.py)\n- Functions to compute numerical derivatives used in the expansion solver.\n\n[uncertain_expansion.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/uncertain_expansion.py)\n\n- Functions to implement first and second order expansion, approximate the continuation values, change of probability measure, and iteration schemes.\n\n[elasticity.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/elasticity.py)\n- Functions to compute shock elasticities.\n\n[BY_example_sol.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/BY_example_sol.py)\n\n- Produce the solutions for the Bansal Yaron Long-run Risk Model used in the [shockelasticity.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/shockelasticity.ipynb).\n\n\n\n## Recent Updates, by Jan. 27, 00:12, CT\n\n1. [uncertainexpansion.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/uncertainexpansion.ipynb)\n   - remove `gb_tp1` as a state variable\n\n   - parameters updating for the adjustment cost model example, which are consistent with the homework.\n\n     - Note the $\\gamma=1$ cannot be solved by the `Expansion Suite`, the reason is that $1-\\gamma$ will show in denominators of the recursive utility adjustment terms, we can try to use values close to $1$, `\u03b3=1+1e-5`, for example.\n\n     ```python\n     \u03b3 = 10.\n     \u03c1 = 4./3\n     \u03b2 = np.exp(-0.0025)\n     a = 0.0288\n     \u03d5_2 = 88.\n     \u03d5_1 = 1/\u03d5_2\n     \u03b1_k = 0.0088\n     \u03c3_k = np.array([[0.477],[0]]) * 0.01\n     A = np.exp(-0.014)\n     B = np.array([[0.011,0.025]]) * 0.01\n     ```\n\n2. [uncertain_expansion.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/uncertain_expansion.py), [lin_quad_util.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/lin_quad_util.py), [BY_example_sol.py](https://github.com/lphansen/RiskUncertaintyValue/blob/main/src/BY_example_sol.py)\n   - New functions and methods added\n\n3. [quickguide.ipynb](https://github.com/lphansen/RiskUncertaintyValue/blob/main/quickguide.ipynb)\n   - New notebook added\n   - Section 1 is a five-minute guide for the `Expansion Suite` as a DSGE solver. \n   - Section 2 are examples for the computations in `LinQuadVar`.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An open sourece DSGE solver under uncertainty",
    "version": "0.0.1",
    "split_keywords": [
        "macroeconomics",
        "finance",
        "dsge",
        "uncertainty",
        "recursive utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb26bf068df75e158688d79323a69c20879a3bf3f6c5ef581b83572f476de875",
                "md5": "4dbc9cec5de1726328640bd788e75987",
                "sha256": "60359ca825e479065c20c3d1ee339dd4d5d8f2e555462dd1845c526bb5554f3f"
            },
            "downloads": -1,
            "filename": "mfrpy-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4dbc9cec5de1726328640bd788e75987",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 30937,
            "upload_time": "2023-01-27T07:28:28",
            "upload_time_iso_8601": "2023-01-27T07:28:28.298761Z",
            "url": "https://files.pythonhosted.org/packages/eb/26/bf068df75e158688d79323a69c20879a3bf3f6c5ef581b83572f476de875/mfrpy-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04cca79ee628fd738de6bd486df813c523c309e437435070207c62c0d76e4ec5",
                "md5": "ef9b5944ed3ea0688d7219175e505102",
                "sha256": "c5a0b8c3617f8acf660056cbbffa045be40e4218a54c8119b4a04c3c5d8b841d"
            },
            "downloads": -1,
            "filename": "mfrpy-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ef9b5944ed3ea0688d7219175e505102",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 29202,
            "upload_time": "2023-01-27T07:28:30",
            "upload_time_iso_8601": "2023-01-27T07:28:30.204156Z",
            "url": "https://files.pythonhosted.org/packages/04/cc/a79ee628fd738de6bd486df813c523c309e437435070207c62c0d76e4ec5/mfrpy-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-27 07:28:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "mfrpy"
}
        
Elapsed time: 0.04458s