GDSGE: A Toolbox for Solving DSGE Models with Global Methods
Welcome to GDSGE’s documentation!
GDSGE is a toolbox that solves nonlinear Dynamic Stochastic General Equilibrium (DSGE) models with a global method based on the Simultaneous Transition and Policy Function Iteration (STPFI) algorithm introduced in Cao, Luo, and Nie (2023). It allows users to define economic models in compact and intuitive scripts, called gmod files (gmod stands for global model). It parses the script into dynamic libraries which implement the actual computations (policy function iterations and Monte Carlo simulations) efficiently in C++, and provides a convenient MATLAB interface to researchers.
The toolbox can be used to solve models in macroeconomics, international finance, asset pricing, and related fields.
GDSGE can now run on MATLAB Online! Log into the MATLAB Online. And run in the MATLAB command window
websave('gdsge.zip','https://github.com/gdsge/gdsge/archive/refs/tags/v0.1.4.zip')
unzip gdsge.zip
mex -setup c++
cd gdsge-0.1.4/tests
runtests
These commands download the latest version of the toolbox, setup the mex compiler, and run the test examples. These produce all results in the companion paper Cao, Luo, and Nie (2023).
With MATLAB on a local machine, try running the leading example, Heaton and Lucas (1996),
by downloading the toolbox source code gdsge_master.zip
and compiling the gmod file HL1996
by running in MATLAB
gdsge_codegen('HL1996')
The toolbox source code can be found at: https://github.com/gdsge/gdsge, where you can download the latest version of the toolbox, find detailed instructions for setting up the compiler, and submit issues.
Examples and documentation of the toolbox are provided below.
Lectures on the toolbox can be found at Lectures.
If you have comments, suggestions or coding questions for us, or would like to contribute GDSGE examples, please reach out to us at: gdsge.cln2020@gmail.com
- Home
- Lectures
- Getting Started - A Simple RBC Model
- Comparison with OccBin: A Simple Model with an Occasionally Binding Interest Rate ZLB
- An RBC Model with Irreversible Investment
- Heaton and Lucas (1996): Incomplete Markets with Portfolio Choices
- Guvenen (2009): Asset Pricing with Heterogeneous IES
- Bianchi (2011): Sudden Stops in Open Economies
- Barro et al. (2017): Safe Assets with Rare Disasters
- Guerrieri et al. (2022): Negative Supply Shocks That Cause Demand Shortages
- A Multi-country Business Cycle Model
- A New-Keynesian Model with an Occasionally Binding Interest Rate Zero Lower Bound
- Toolbox API
- Additional Examples
- Huggett (1997): Steady States and Transition Paths in Heterogeneous Agent Models
- Krusell and Smith (1998): Heterogeneous Agent Models with Aggregate Uncertainty
- Mendoza (2010): Sudden Stops with Asset Price Deflation
- Cao and Nie (2017): Amplification and Asymmetry without Collateral Constraint
- Cao (2018): Speculation and Wealth Distribution under Beliefs Heterogeneity
- Cao (2020): Continuum versus Finite Agents in Krusell and Smith (1998)
- Contributed Examples