Skip to main content

An open sourece DSGE solver under uncertainty

Project description

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). It follows the algorithm in Exploring Recursive Utility to approximate the model solution under uncertainty.

Jupyter Notebook Illustrations

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

  • 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

  • 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

  • Defines the linear-quadratic variable structure to facilitate operations in expansion solvers and elasticity calculation with LinQuadVar class.

lin_quad_util.py

  • Integrated operation tools on LinQuadVar.

utilities.py

  • Matrix and linear algebra operation functions facilitate the computation.

derivatives.py

  • Functions to compute numerical derivatives used in the expansion solver.

uncertain_expansion.py

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

elasticity.py

  • Functions to compute shock elasticities.

BY_example_sol.py

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

  1. 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.
      γ = 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, lin_quad_util.py, BY_example_sol.py

    • New functions and methods added
  3. 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.

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

mfrpy-0.0.1.tar.gz (29.2 kB view hashes)

Uploaded Source

Built Distribution

mfrpy-0.0.1-py3-none-any.whl (30.9 kB view hashes)

Uploaded Python 3

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