About gEcon

gEcon is a framework for developing and solving large scale dynamic (stochastic) & static general equilibrium models. It consists of model description language and an interface with a set of solvers in R.

Publicly available toolboxes used in RBC/DSGE modelling require users to derive the first order conditions (FOCs) and linearisation equations by pen & paper (e.g. Uhlig’s tool-kit) or at least require manual derivation of the FOCs (e.g. Dynare). Derivation of FOCs is also required by GAMS and GEMPACK — probably the two most popular frameworks used in CGE modelling. Owing to the development of an algorithm for automatic derivation of first order conditions and implementation of a comprehensive symbolic computations library, gEcon allows users to describe their models in terms of optimisation problems of agents. To authors' best knowledge there is no other publicly available framework for writing and solving DSGE & CGE models in this natural way. Writing models in terms of optimisation problems instead of the FOCs is far more natural to an economist, takes off the burden of tedious differentiation, and reduces the risk of making a mistake. gEcon allows users to focus on economic aspects of the model and makes it possible to design large-scale (100+ variables) models. To this end, gEcon provides template mechanism (similar to those found in CGE modelling packages), which allows to declare similar agents (differentiated by parameters only) in a single block. Additionally, gEcon can automatically produce a draft of LaTeX documentation for a model.

The model description language is simple and intuitive. Given optimisation problems, constraints and identities, computer derives the FOCs, steady state equations, and linearisation matrices automatically. Numerical solvers can be then employed to determine the steady state and approximate equilibrium laws of motion around it.

gEcon was initially developed (2012–2015) at the Department for Strategic Analyses at the Chancellery of the Prime Minister of the Republic of Poland as a part of a project aiming at construction of large scale DSGE & CGE models of the Polish economy. Since March 1, 2015 gEcon is no longer developed and maintained at the Chancellery of the Prime Minister, but it is still maintained and developed by its original authors.

About current release

Version 1.0 (new!)

gEcon 1.0 was released on October 9, 2016 This version concludes four years of gEcon development and testing. R code has been reviewed and reorganised, all reported bugs (mostly in the template and reference mechanisms) have been fixed.

Note: the revision of the R code has led to numerous changes in the interface. In particular, functions compute_moments and get_moments changed their names to compute_model_stats and get_model_stats respectively and argument lists of the following functions have been changed: par_info, initval_calibr_par, get_par_values, var_info, initval_var, get_ss_values, shock_info, set_shock_cov_mat, random_path, compute_irf, simulate_model, plot_simulation. A more detailed list of amendments can be found here. Please adjust your code accordingly.

Please note that gEcon is NOT DISTRIBUTED THROUGH CRAN. You have to download the package file appropriate for you system, save it on your disk, and install gEcon package from this file.

gEcon extensions (new!)

Two packages extending gEcon functionality (CGE calibration and DSGE model estimation) can be found under the gEcon.iosam and gEcon.estimation tabs.

Development team

gEcon is developed by: Grzegorz Klima, Karol Podemski and Kaja Retkiewicz-Wijtiwiak.


Please send bugs, comments, suggestions to: gklima<AT>users<DOT>sourceforge<DOT>net.

Please note that we are developing and maintaining gEcon in our spare time, so before asking any questions, please read the Users' guide (which can be found under the documentation tab).