General equilibrium economic modelling language and solution framework
The models in gEcon are written using a language suited for writing economic dynamic optimisation problems. gEcon model file consists of blocks describing agents optimization problems, exogenous shocks and market clearing conditions. Within each optimisation block, the user specifies objective, control variables and constraints of a particular agent. Blocks can be also created for declaring market clearing conditions and behaviour of exogenous variables. Blocks can be “templated”, which means that problems of similar agents can be written and solved only once.
The parameters of models can be set either in a .gcn file or by using R interface later on. Parameters can be also calibrated based on the user-supplied steady-state relationships between variables.
Deriving model equations
gEcon reduces pen & paper derivations of model equations thanks to the following functionality:
- template mechanism (similar to those found in CGE modelling software) which allows to declare similar agents (differentiated by parameters only) in a single block,
- reference mechanism allowing to easily constrain optimisation problem of an agent by solution to other agents' problems — actual equations are inserted automatically,
- automatic derivation of first order conditions (FOCs),
- automatic generation and reduction (after deriving FOCs) of Lagrange multipliers,
- automatic reduction of user-selected variables,
- automatic derivation of first order perturbation matrices,
- automatic log-linearisation of model equations.
R class gecon_model
gEcon has a user-friendly interface written in R. A model file written by the shared library is read from R environment and an object of gecon_model class is created. The user can solve and analyze models by using facilities implemented in gEcon:
- calibration utilities,
- steady–state and perturbation solvers,
- tools for IRFs and statistics computations.
Model documentation and diagnostics
gEcon reduces time required for documenting the model and time spent on debugging it through the following features:
- automatically created LaTeX documentation,
- automatically created text logfiles,
- a set of functions for retrieving information about variables, shocks and parameters.
Numerical solvers employed
- nleqslv for solving systems of non-linear equations using Newton or Broyden methods with line searches,
- gensys for solving the first order perturbation.