You are here: ILRCourse overviewResearch CGEBOX - a modular CGE a GUI

CGEBox, a CGE toolbox with a Graphical User Interface


CGEBox provides a flexible, extendable and modular code basis for CGE modeling in GAMS drawing on the GTAP data base, combined with a powerful user interface based on GGIG (GAMS Graphical User Interface Generator). Its core draws on the GTAP Standard model version 7 in GAMS by Van der Mensbrugghe 2018. Like most global, multi-regioal CGE models, it assumes perfect markets for product and factors, suppliers and demanders without market power, cost-minimizing firms and utility maximizing consumers. A representative household owns the primary factors, which are allocated to firms such as to maximizes revenues. International trade is depicted by the Armington assumptions which assumes that each region produces a specific quality of a product. Specfic to the GTAP Standard model is the so-called global bank which distribute global savings such as maximize expected returns to capital for new investments. This mechanims allows for endogenous changes in the balance of trade in simulations. Some of these assumptions, such as assuming no market power, can be relaxed in specific modules. The same holds for the so-called regional household approach where all income is collected by a virtual agent in each region and distributed to government and private consumption as well as savings such as to maximize utility.

The code and user interface is open source and can be downloaded from the internet (SVN repo, userid and pwd cgebox, for details, see Documentation section). As the model draws on the GTAP data base, an appropriate GTAP license is required or the older, by now for-free versions of the data base can be used. The system aims at complex applications, including solving very large models, but the user interface and options to visualize and analyze results in tables, maps and graphs render it also useful for class-room use.

The model can be extended in a modular fashion where most modules are compatible with each other. The following basic set-ups are avaiable:

  • A recursive-dynamic long term version G-RDEM by Roberto Roson and Wolfgang Britz
  • A single region model with fixed import prices and FOB prices driving bi-lateral export demand
  • partial equilibrium set-up where only one or some commodity markets clear and the remaining cross-prices and input demands are fixed and accounts are not closed.
  • A two-level CET representation of distribution of supply to domestic use or exports, respectively to different export destination, mimicking the Armington CES representation on the demand side.
  • Non-diagonal make matrices where one sector can produce several outputs or one output can be produced by several sectors, with matching CET/CES nests.
  • Support for flexible nestings in the production function, for factor supply and CES-subnests under final demand, based on set-definitions in GAMS. Does not require additional coding of equations and variables.
  • Choice between CDE, CD, LES and MAIDADS as functional forms in final demand. The MAIDADS system is econometically estimated to capture structural changes in demand under larger income changes, relevant for G-RDEM (see below)

A pre-solve algorithm, careful scaling of the model's equations and substituting out linear relationships ensure that even the model in the full resolution of the GTAP 10 data base (e.g. 65 sectors and 141 regions) solves in a reasonable time under larger shocks. On demand, the model can be solved as a MCP to capture e.g. production and tariff rate quotas. The code supports the GTAP7, GTAP8, GTAP9 and GTAP10 data bases, including the landuse data linked to Agri-Ecological Zoning (AEZ) dis-aggregation and the GTAP9 version covering water as a primary factor in crop production as well as the CO2, Non-CO2 and air emissions data bases.

The data driver allows to use split factors to dis-aggregated the global SAM to more sector and commodity detail. That is currently applied in a project focusing on bio-plastics. The FABIO MRIO can be used to automatically generate split factor to increase the agri-food detail of a global SAM. Equally, post-model aggregation of the global SAM can be used to yield non-diagonal make structures.



CGEBox already implements different modules which replicate variants of the GTAP model or provide new extensions which can be combined in applications:

  • GTAP-AGR: intermediate demand nests for feed use in livestock production and for primary agricultural products into food processing sector; a split-up into an agricultural and non-agricultural households; CET-driven factor supply between agriculture and non-agriculture and inside the agricultural sector. Note that water can be aded as primary factor a when using the GTAP-WATER data base.
  • GTAP-E: Multi-stage nesting for energy-capital composite in production and demand nests for energy use. CO2 emissions. The GTAP-WATER water data base supported by the data driver also covers additional sector detail in electricity production from the GTAP-Power data base.
  • GTAP-AEZ: Sub-regional pyhsical land supply based on CES/CET structures, supports both the 2007, 2011 and GTAP V10 releases of the AEZ land use data base, uses volume-preserving CET transformations, land supply from crop land buffer, supply elasticities Carbon stock accounting including conversion of natural vegetation to land in economic use. The module is maintained by Neus Escobar and Wolfgang Britz.
  • myGTAP: Support for several private households, replacement of regional household approach by separate accounts for the different agents. Can be used to define, for instance, a household drawing income from factor use in agricultural and non-agricultural activities. Supports modeling households at sub-national level with preferences for regionally produced output (subsistence production). Data and driver to FAO household data surveys covering 19 countries to define aggregate household types and/or perform post-model micro-simulations.
  • GMIG: Bi-lateral migration of labour force and population, remittances
  • GTAP-Melitz: Love of varieties linked to endogenous number of firms for each sector and operating on each bi-lateral trade link, increasing return-to-scale based on fixed costs, monopolistic power, separate technology nests for fixed and variable costs. Can be simplified to a Krugmann model. Which sectors are covered can be chosen by the user. The module is developed and maintained by Yaghoob Jafari and Wolfgang Britz. Two versions are supported: (1) a single Dietz-Stieglitz price index for domestic sales and bi-lateral trade links, or (2) a two-nested version close to the standard Armington implementation.
  • GTAP-MRIO: Bi-lateral import demand dis-aggregated to total intermediate demand and each final demand agent, split factors and agent specific ad-valorem tariffs from the GTAP-MRIO Data Base. Which sectors are covered can be chosen by the user.
  • Armginton with commitment terms: Allows to increase the subsitution elasticity on selected flows. Prototype version.
  • SPE: Bi-lateral import demand for selected products can be depicted as a spatial arbitrage problem, i.e. law of one price. Allows for emerging trade flows. Prototype version.
  • Tariff lines: This module allows to dis-aggregate selected bi-lateral trade flows to the tariff line level using an additional CES-CET structure.It supports bi-lateral Tariff-Rate-Quotas in combination with a MCP solver.
  • GTAP-NUTS2: Dis-aggregation of national production and factor markets to sub-regions. Currently, data area available for about 280 NUTS2 regions for European countries. Trial implementations for African countries.
  • GTAP-TIVA: Post model generation of a global Leontief-inverse to derive Trade-In-Value added indicators and to attributes global changes in CO2 / non-CO2 emissions to regional final demand.
  • ALTERTAX: Post-model generation of a global SAM to provide an updated benchmark, can be used in combination of G-RDEM to provide future benchmarks.
  • FABIO link: FABIO is a MRIO for Agri-Food products (192 countries and 130 products) derived from various FAO data bases by Martin Bruckner. CGEBox has a generic driver to split-up the global GTAP SAM based on FABIO and to post-model dis-aggregate to the full FABIO detail based on proportionality assumptions and application of the FABIO Leontief-Inverse. The post-model modules estimates protein and calories per capita supply in-line with the FAO Food Balance Sheets based on a Leontief-Inverse.
  • G-RDEM: A module for generation of long-term baselines which features (1) an econometrically estimated MAIDADS demand system with non-linear Engel curves, (2) debt accumulation and serving from foreign savings, (3) sector specific productivity growth, (4) macro-economic saving rates adjust to population and GDP dynamic, (5) income dependent IO-Coefficients and factor cost shares, (6) control for calorie uptake per capita depending on projected per capita income growth, (7) crop yields and crop land expansion from FAO projections, (8) different GVA growth per capita for European sub-regions based on econometric anaylsis G-RDEM uses as a default the GDP and population projection at single country level for SSP 1-5 from the IIASSA SSP data base which can be combined with climate change impacts on crop yields from various Global Circulation Models and Gridded Crop Growth models for different RCPs provided by EU-CLIM project.
    G-RDEM is maintained by Roberto Roson Wolfgang Britz.

These extensions can be generally freely combined. Additionally, the first stage Armington nest can be aggregated across agents, or alternatively, all intermediate demand can be aggregated.

Graphical User Interface

A Graphical User Interface (GUI) allows experienced modelers to work more efficiently with models and to analyze their results while students can step more rapidly into application and analysis.

One major advantage of using models in combination with a suitable GUI is that far less technical knowledge is needed to analyze result, see, for instance, Perez et al. 2013 and Britz et al. 2015. That allows using even a complex model such as GTAP in a class without spending time on GAMS or GEMPACK and code implementation - only the concepts matters.

Using the GUI, students can define, run and explore scenarios without in-depth knowledge of the model code, which clearly motivates them to make further steps. The combination of GTAP's flexible aggregation possibilities, the stable and fast implementation of the standard GTAP model as a global, trade oriented CGE in GAMS and a hopefully easy to use interface to run simulations and exploit results thus provides an entry point in the amazing world of CGE analysis. This combination is especially inviting for class use, but might be also interesting in a research environment.

In order to benefit from the explotation possibilities of the GUI, the GAMS code was extended with post-model processing code which maps the simulated values back into a SAM like structure which differentiates values, prices, quantities, tax revenues and tax rates. That structure allows for easy analysis of results. The exploitation part offers a set of structured views, and allows to compare the results to the benchmark point, to produce graphs from the results and to export e.g. to clipboard or EXCEL. Equally, tools for systematic sensitivity anaylsis were added, using a combination of R-scripts and GAMS code, running model solves in parallel. It also comprises a powerful tool to provide maps.

I would like to thank Arne Drud for his continuous support over the years, not only for the CGEBox project to make best use of the CONOPT solver. It is also worth to mention Mark Horridge's HAR2GDX utility distributed with GAMS which allows to convert the GTAP data base into a GAMS readable format.


In the context of the class "Applied modeling of agricultural systems" in the winter terms 2013/2014 and 2014/2015 where students develop their own project related to economic modeling, the students decided to work with a global, trade oriented CGE. Dr. Tom Rutherford has developed a version of the GTAP model realized in GAMS, which is called GTAP in GAMS, available in different versions and can be downloaded for free. Tom Rutherford's code was the logical choice for their project,as the students had already some basic knowledge of GAMS, while the GTAP data base is unique in coverage and content. In order to ease especially analyzing results, Tom Rutherford's code was slightly modified to interact with the GAMS Graphical User Interface Generator. This model version, with extensions, was also used in several master thesis projects.

Since 2015, the work on a GAMS based version of GTAP with a user interface intensified when Dominique Van der Mensbrugghe, director of the GTAP center, prepared a release of the GTAP standard model coded in GAMS. The code version using GTAPinGAMS was abandoned and instead CGEBox was kicked off as joined efforts. First trial implementations of GTAP modules (GTAP-AGR, GTAP-AEZ) of specific interest to agriculture and land use were integrated in the code base along with intensive testing. That new CGE modeling system was presented in June 2016 as a pre-conference event to the 19th GTAP conference. In parallel, a project jointly with ZEF started in summer 2015 to analyze with a GTAP variant land use changes in the long-run due to changes in global demand for biomass, with a focus on Brazil and Indonesia. A project for JRC-IPTS looked into food waste issues at European level, using also the GTAP-NUTS2 extenion, while post-doc research applies the model of analyze larger market penetration of bio-plastics. A project for the EU's joint research center contributed a variant called DEMETRA in CGEBox with households at sub-national level and subsistence production, features now freely available. A project for FAO on trade and poverty currently links the myGTAP module to household surveys and develops a post-model micro-simulation module, equally open source and access. The model was already used in different master theses to analyze e.g FTAs or carbon tax recycling. Current model developments focus on the land-use extension, the long-run version and depicting trade at tariff line level.

CGEBox and GTAP Version 10

The GAMS code underlying CGEBox was updated where needed such as to reflect the improved detail with 65 sectors now available in GTAP Version 10 compared to 57 sectors in GTAP Version 9. This required in some case repeating econometric work. Please be aware that the GTAP-Water Data base for V10 is not yet released.

Access and documentation

In line with the general philosophy of the GTAP center, the code and the user interface can be used by anybody interested. The code is distributed via a Software Versioning Repository, downloads require a SVN client such as TortoiseSVN. The GUI is based on Java, running under Java Run Time Environment 1.8. Running the code clearly requires a GAMS license (23.5 or newer), results analysis doesn't. It should also be noted that the by now outdated version 7 of the GTAP data base along with aggregation utility can be downloaded for free, while GTAP offers special free licenses for a their GTAP Africa data base.


Current projects

By the team in Bonn:

Staff working at ILR on the project

    Wolfgang Britz, GUI development, modular concept

    Yaghoob Jafari, Melitz extension

    Salwa Haddad, PhD, application to global land use issues

    Jingwen Li, land use and global footprint issue

    Rienne Wilts, PhD, global long-run scenarios of land use in the context of the SSPs



Conference contributions, discussion papers and reports:


    Britz, W. (2020): Comparing three penalty functions - Cross Entropy, Quadratic and Linear Loss – in SAM splitting applications, selected paper presented at the 23rd Annual Conference on Global Economic Analysis (Virtual Conference), Link.

    Jafari, Y., Britz, W., Guimbard, H., Beckman, J. (2020): Properly Capturing Trade Liberalization: Impacts of CETA, selected paper presented at the 23rd Annual Conference on Global Economic Analysis (Virtual Conference), Link.

    Britz, W., Jafari, Y., Nekhay, O., Roson, R. (2020): Modeling Trade and Income Distribution in Six Developing Countries A Dynamic General Equilibrium Analysis up to the Year 2050, in: University Ca' Foscari of Venice, Dept. of Economics Research Paper Series No. 03/WP/2020, Link.

    Britz, W. (2020): Maintaining plausible calorie intakes, crop yields and crop land expansion in long-run simulations with Computable General Equilibrium Models. Discussion Paper 2020:.
    Download: Discussion Paper.

    Jafari, Y., Britz, W., Dudu, H., Roson, R., Sartori, M. (2020): Can Food Waste Reduction in Europe Help to Increase Food Availability and Reduce Pressure on Natural Resources Globally?. Discussion Paper 2020:.
    Download: Discussion Paper.


    Britz, W., Dudu, H., Roson, R., Fusacchi, I., Jafari, Y., Salvatici, L., Sartori, M. (2019): Economy-wide analysis of food waste reductions and related costs, in: JRC technical reports, JRC113395, Link (Download).

    Britz, W., Roson, R., Sartori, M. (2019): SSP Long Run Scenarios for European NUTS2 Regions, in: Working Papers Department of Economics Ca’ Foscari University of Venice, No. 22/WP/ 201 9, Link.

    Escobar, N., Haddad, S., Börner, J., Britz, W. (2019): Country-specific CO2 emission factors of bioplastics, considering Induced Land Use Change, selected paper presented at the 13th Int. Conf. European Society for Ecological Economics, 18-21 June 2019 Turku (Finland).

    Ferrari, E., Britz, W., Dudu, H., Roson, R. (2019): An extented myGTAP model to address subsistence production and sub-national households as a module in CGEBox, selected paper presented at the 22nd Annual Conference on Global Economic Analysis "Challenges to Global, Social, and Economic Growth", Warsaw (Poland), June 19-21, 2019, Link.

    Haddad, S., Escobar, N., Brucker, M., Britz, W. (2019): Global land use impacts from a subsidy on grassland-based ruminant livestock production in the European Union, selected paper presented at the 22nd Annual Conference on Global Economic Analysis "Challenges to Global, Social, and Economic Growth", Warsaw (Poland), June 19-21, 2019, Link.

    Jafari, Y., Himics, M., Britz, W. (2019): Welfare and trade effects of the Canada-European Union Comprehensive Economic and Trade Agreement considering tariff line detail for agri-food sectors, selected paper presented at the 22nd Annual Conference on Global Economic Analysis "Challenges to Global, Social, and Economic Growth", Warsaw (Poland), June 19-21, 2019, Link.

    Roson, R., Sartori, M., Britz, W. (2019): SSP long run scenarios for European NUTS2 regions, selected paper presented at the 22nd Annual Conference on Global Economic Analysis "Challenges to Global, Social, and Economic Growth", Warsaw (Poland), June 19-21, 2019, Link.


    Britz, W., Roson, R. (2018): Exploring Long Run Structural Change with a Dynamic General Equilibrium Model, selected paper presented at the 21st Annual Conference on Global Economic Analysis, Cartagena de Indias (Colombia), Link.

    Britz, W., Roson, R. (2018): Exploring Long Run Structural Change with a Dynamic General Equilibrium Model, presented at the University Ca' Foscari of Venice, Dept. of Economics Research Paper Series No. 12/WP/2018, Download.

    Escobar, N., Haddad, S., Britz, W. (2018): Economic and environmental implications of a target for bioplastics consumption: A CGE analysis, selected paper presented at the 21st Annual Conference on Global Economic Analysis, Cartagena de Indias (Colombia), Link.

    Escobar, N., Haddad, S., Gerber, N., Börner, J., Britz, W. (2018): SDG trade-offs of increasing bioplastics consumption in a Computable General Equilibrium analysis, selected paper presented at the 22th ICABR CONFERENCE The World Bank, Washington DC June 12-15, 2018 DISRUPTIVE INNOVATIONS, VALUE CHAIN AND RURAL DEVELOPMENT.

    Britz, W., Roberto, R. (2018): G-RDEM: A GTAP-Based Recursive Dynamic CGE Model for Long-Term Baseline Generation and Analysis , in: University Ca' Foscari of Venice, Dept. of Economics Research Paper Series No. 11/WP/2018,
    Note: The content is also part of the model documentation


    Britz, W., Van der Mensbrugghe, D. (2017): A flexible, modular and extendable framework for CGE analysis in GAMS. Slided presented at the at the 20th Annual Conference on Global Economic Analysis "Global Economic Analysis in the 21st Century: Challenges and Opportunities", West Lafayette, Indiana, USA, June 7-9 2017. The underlying paper can be found at GTAP resource 5192.

    Britz, W., Jafari, Y. (2017): Introducing Firm Heterogeneity Theory into CGEBox, working paper, ILR 2017
    Note: The content is now part of the model documentation

    Jafari, Y., Britz, W. (2017): Brexit - an economy-wide Impact Assessment looking into trade, immigration, and Foreign Direct Investment Slides presented at the at the 20th Annual Conference on Global Economic Analysis "Global Economic Analysis in the 21st Century: Challenges and Opportunities", West Lafayette, Indiana, USA, June 7-9 2017. The underlying paper can be found at GTAP resource 5214

    Jafari, Y., Britz, W. (2016): Prospects of the Food Processing Sector under Tariff and Non-Tariff Measures Liberalization in the Transatlantic Trade and Investment Partnership. Discussion Paper 2016:1

    Britz, W., Drud, A., and van der Mensbrugghe, D. (2015), Reducing unwanted consequences of aggregation in large -scale economic models - a systematic empirical evaluation with the GTAP model, Discussion paper 2015:4, Institute for Food and Resource Economics


Please note that details of the implementation have changed since the vidoes were recorded.

First time setup

Loading data from GTAPAGG

Running a simulation

Looking at results

Last updated: Thursday, September 02, 2021