- Courses Summer Term 2017
- Master of Agricultural and Food Economics (AFECO)
- Theodor-Brinkmann-Graduate School
- Modeling structural change and agricultural nutrient flows across scales in regions of North Rhine-Westphalia Gefördert durch das Ministerium für Klimaschutz, Umwelt, Landwirtschaft, Natur- und Verbraucherschutz des Landes Nordrhein-Westfalen im Rahmen des Lehr- und Forschungsschwerpunktes "Umweltverträgliche und Standortgerechte Landwirtschaft", 2016-2018
- Further projects
Back to mainpage
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). The system aims at class room use as well as basis for complex applications, including solving very large models. The work started in 2013 when a CGE for projects with students was required, drawing at that time on the GTAP6inGAMS model by Thomas F. Rutherford.
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, started work on a release of the GTAP standard model in GAMS. Efforts were joined, and 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.
In opposite to Tom Rutherford's code originaly used, the new implementation offers a truthfull replica of the GTAP Standard model. Using either switches on the interface or by changing the parameterization or the data base underlying the model, different additional features or variants can be derived:
- A recursive-dynamic version with various shifters instead of the standard comparative-static one
- A single region model with fixed import prices and FOB prices driving bi-lateral export demand
- A 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
- Substitution between intermediates instead of the standard Leontief assumption
- Substitution between value added and total intermediate demand instead of the standard Leontief assumption
- Different closures for final, government, investment demand and foreign savings, a version with endogenous exchange rates
- 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
A pre-solve algorithm, careful scaling of the model's equations and substituting out linear relationsships ensures that even the model in the full resolution of the GTAP 8.1 data base (e.g. 57 sectors and 134 regions) can be solved in 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 GTAP7, GTAP8 and GTAP9 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.
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 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 cover additional sector detail in electricity production from the GTAP-Power data base.
- GTAP-AEZ: Sub-regional land supply linked with CES/CET structures, support to both the 2007 and 2011 releases of the landuse data base
- 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.
- 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 simplifited to a Krugmann model. Which sectors are covered can be chosen by the user.
- 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 250 NUTS2 regions for European countries.
These extensions can be combined. In the case where the GTAP-NUTS2 dis-aggregation is used, the GTAP-AEZ breakdown for that country is automatically switched off. Additionally, the first stage Armington nest can be aggregated across agents, or alternatively, all intermediate demand can be aggregated.
A Graphical User Interface (GUI) allows experienced modlers 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 knowlege 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 benachmark 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.
I would like to thank Arne Drud for his continuous support over the years, not only for the GTAPinGAMS 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.
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. It provides a standard template for a trade oriented, global CGE based on the GTAP data base, is well documented, and loads results from user defined aggregations (GTAPAGG) of versions 6 to 9 of the GTAP data base and converts them into GAMS format. It allows to filter out small values from the GTAP data base while keeping the SAMs and international data base consistent, such that the model solves quite fast even in full resolution (57 sector, and, depending on the version of the data base, up to 134 regions). Not we used originally the GtapInGams6 version and have not checked any later vriosn.
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. 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. That model version, with extensions, was also used in several master thesis projects. The GUI link and further extensions to Tom Rutherford's code is not longer available and was replaced, as mentioned above, by GAMS code derived from ENVISAGE.
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, 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. Detailed information on how to install and use the model can be found in the user manual.
Wolfgang Britz, GUI development, modular concept
Yaghoob Jafari, Melitz extension
Salwa Haddad, PhD, Application to land use issues
Van der Mensbrugghe, D. (2015), GTAP in GAMS, Version 6.2, 25 pages, GTAP Center. Provides the methodological documentation of the GTAP standard Model in GAMS in mathematical notation as the core base of CGEBOX. It compares also some technical aspects with a GEMPACK implemenation. For an equation by an equation documentation of the actual GAMS code, refer to the full model documentation
Britz, W., (2016), CGEBOX model documentation, 203 pages, PDF (installation instructions, GUI user guide, technical and methodological documentation), matches revision 950 of the SVN repository
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
Britz, W., van der Mensbrugghe, D. . (2016): Reducing unwanted consequences of aggregation in large-scale economic models - A systematic empirical evaluation with the GTAP model , Economic Modeling 59: 462-473 ,
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., 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
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: Monday, September 18, 2017
- Best Paper Award for Böcker, T., Britz, W. and Finger, R. (2017): "Modelling the Effects of a Ban of Glyphosate on Weed Management Strategies in Maize Production" at the GEWISOLA conference 2017
- New resarch project SUSTAINBEEF, 2017-2020
- Economic Modeling of Agricultural Systems Group contribution to 2017 EAAE congress
- Flexible Load of Existing Biogas Plants: A Viable Option to Reduce Environmental Externalities and to Provide Demand-driven Electricity? (2017) Schäfer, D., Britz, W., Kuhn, T. (2017): Flexible Load of Existing Biogas Plants: A Viable Option to Reduce Environmental Externalities and to Provide Demand-driven Electricity? , German Journal of Agricultural Economics 66(2): 109-123
- Climate change impacts on crop yields, land use and environment in response to crop sowing dates and thermal time requirements (2017) Zimmermann, A., Webber, H., Zhao, G., Ewert, F., Kros, H., Wolf, J., Britz, W., de Vries, W. (2017): Climate change impacts on crop yields, land use and environment in response to crop sowing dates and thermal time requirements , Agricultural Systems (online, print version forthcoming
- Reducing unwanted consequences of aggregation in large-scale economic models - A systematic empirical evaluation with the GTAP model (2016) Britz, W., Van der Mensbrugghe, D.(2016):
"Reducing unwanted consequences of aggregation in large-scale economic models - A systematic empirical evaluation with the GTAP model", Economic Modelling2016: 462-473, first published online October 2016
- Simulating the viability of water institutions under volatile rainfall conditions - The case of the Lake Naivasha Basin (2016) Kuhn, A., Britz, W., WillY, D., van Oel, P.(2016):
"Simulating the viability of water institutions under volatile rainfall conditions - The case of the Lake Naivasha Basin", Environmental Modelling and Software 75, p. 373-387