You are here: ILREconomic Modeling of Agricultural SystemsResearch CGEBOX - a modular CGE a GUI
(Logo)

CGEBox, a CGE toolbox with a Graphical User Interface

Overview

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). 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 following options are available along with the modules mentioned 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 9 data base (e.g. 57 sectors and 140 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 and Non-CO2 emission 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.

(Logo)

Modules

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 and 2011 releases of the AEZ land use data base, uses volume-preserving CET transformations, land supply from crop land buffer, supply elasticities calibrated to match FAO long term outlooks. 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

  • 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.

  • GTAP-MRIO: Bi-lateral import demand dis-aggregated to total intermediate demand and each final demand agent, split factors courtesy of the OECD secretariate in Paris as used in the OECD's METRO model. Which sectors are covered can be chosen by the user.

  • Tariff lines: A prototype module allows to dis-aggregate selected bi-lateral trade flows to the tariff line level using an additional CES-CET structure. It supports multiple 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.

  • 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) dynamic IO-Coefficients and factor cost shares. G-RDEM uses as a default the GDP and population projection at single country level for SSP 1-5 form 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 e.g. 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. That 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.

Background

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

CGEBox is operational under Version 10 of the GTAP data base. Missing auxiliary data needed for certain modules ask for some words of caution. So far, the GTAP center has not released land use data matching the GTAP V10 data base. The GTAP-AEZ module building on these data is hence not operational for CGEBox combined with GTAP Version 10. While the 2011 release of the land use data could be used technically with GTAP Version 10 to provide split factors from country level to the level of AEZs, adding one region in GTAP Version 10 (Takijistan) will mean that the GAMS code of the data driver will throw an error and refuse to work. This shields the user from unwanted consequences of mixing data sets which differ not only in the underlying base year but might also be derived based on different methodological approaches.

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. As these changes are recent. It cannot be excluded that flaws have been introduced. We therefore caution users to double-check any results and recommend to run the same analysis under GTAP Version 9 and compare key findings. The CGEBox team will do its best to react quickly if users run into obvious flaws which are not related to the GTAP data base itself but are due to code changes related to the update to GTAP Verison 10 in the responsibility of the CGEBox team.

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.

Documentation:

Current projects

By the team in Bonn:

Staff working at ILR on the project

Documents

Papers:

Conference contributions, discussion papers and reports:

    2020

    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.

    2019

    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.

    2018

    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

    before

    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

Videos:

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: Friday, July 10, 2020