How gustavohm/dsgelab works
dsgelab is a Python toolkit for declaring DSGE models once and solving, simulating, estimating, and analyzing them. The main workflow is model declaration → steady state → first-order solution → simulation, impulse responses, and moments; the same model also supports higher-order perturbation and deterministic transitions. Separate branches provide global and heterogeneous-agent methods, regime switching, policy optimization, and statistical estimation. The graph includes README-documented capabilities whose implementation was not sampled; edges are limited to documented workflows or references visible in the source index, so unsampled internals are not asserted.
Main entry points: model.py Model declaration · solve.py First-order solve · solution.py Solution analysis · estimation.py Bayesian estimation
Components 30
Model and solutions
- Model declaration
src/dsgelab/model.py - Steady state
src/dsgelab/steady.py - Linearization
src/dsgelab/linearize.py - Klein solver
src/dsgelab/klein.py - First-order solve
src/dsgelab/solve.py - Solution analysis
src/dsgelab/solution.py - Second-order
src/dsgelab/secondorder.py - Third-order
src/dsgelab/thirdorder.py - Derivative tensors
src/dsgelab/tensors.py - Text equations
src/dsgelab/symbolic.py
Global and transitions
- Global projection
src/dsgelab/projection.py - Time iteration
src/dsgelab/time_iteration.py - Value iteration
src/dsgelab/value_iteration.py - Endogenous grid
src/dsgelab/egm.py - Perfect foresight
src/dsgelab/foresight.py - Extended path
src/dsgelab/extended_path.py
Agents and regimes
- Heterogeneous agents
src/dsgelab/heterogeneous.py - Regime switching
src/dsgelab/switching.py
Inference and analysis
- BVAR and DSGE-VAR
src/dsgelab/bvar.py - State-space filters
src/dsgelab/kalman.py - Bayesian estimation
src/dsgelab/estimation.py - Moment estimation
src/dsgelab/moment_estimation.py - Identification
src/dsgelab/identification.py - Particle filters
src/dsgelab/particle.py - Kim filter
src/dsgelab/kim.py - Plots
src/dsgelab/plots.py
Policy and interoperability
- Optimal policy
src/dsgelab/optimal.py - Dynare import
src/dsgelab/dynare.py
Other components
- Modeler
- Results consumer
Connections 33
- Modeler → Model declaration: declares
README.md - Model declaration → Steady state: solves steady state
README.md - Model declaration → First-order solve: solves model
README.md - Steady state → First-order solve: anchors solution
README.md - First-order solve → Klein solver: uses solver
- First-order solve → Solution analysis: returns solution
README.md - Model declaration → Linearization: linearizes equations
src/dsgelab/linearize.py - Linearization → Derivative tensors: computes derivatives
src/dsgelab/linearize.py - Solution analysis → Results consumer: provides responses
README.md - Model declaration → Second-order: solves second order
README.md - Model declaration → Third-order: solves third order
README.md - Modeler → Text equations: declares equations
README.md - Model declaration → Global projection: solves globally
README.md - Model declaration → Time iteration: iterates policies
README.md - Model declaration → Value iteration: optimizes value
README.md - Model declaration → Endogenous grid: solves by EGM
README.md - Model declaration → Perfect foresight: computes transitions
README.md - Model declaration → Extended path: computes expectations paths
README.md - Perfect foresight → Model declaration: uses model
src/dsgelab/foresight.py - Extended path → Perfect foresight: uses transitions
src/dsgelab/extended_path.py - Model declaration → Heterogeneous agents: solves agent blocks
README.md - Model declaration → Regime switching: solves switching model
README.md - Model declaration → State-space filters: builds state space
src/dsgelab/kalman.py - State-space filters → Bayesian estimation: supplies likelihood
src/dsgelab/estimation.py - Bayesian estimation → BVAR and DSGE-VAR: uses DSGE-VAR
src/dsgelab/estimation.py - Bayesian estimation → Particle filters: uses particle filter
src/dsgelab/estimation.py - Model declaration → Moment estimation: fits moments
README.md - Model declaration → Identification: checks identification
README.md - Regime switching → Kim filter: filters regimes
README.md - Solution analysis → Plots: plots results
- Model declaration → Optimal policy: optimizes policy
README.md - Modeler → Dynare import: imports model
README.md - Dynare import → Model declaration: creates declaration
src/dsgelab/dynare.py