GTAP6inGAMS

Thomas F. Rutherford
January, 2006

The GTAP Consortium (http://www.gtap.org) provides a documented, publicly available, global, general equilibrium data base. It also conduts seminars on a regular basis to inform the research community about how to use the data in applied economic analysis. This page contains an implementation of the GTAP6 model in GAMS. Cleverly, this package is called "GTAP6inGAMS".

The GTAP version 6 database represents global production and trade for 89 country/regions, 59 commodities and 5 primary factors. The data characterize intermediate demand and bilateral trade in 2001, including tax rates on imports and exports and other indirect taxes.

The principal programming language for GTAP data and modeling work is GEMPACK. In the GEMPACK framework the model is solved as a system of nonlinear equations. The present paper describes a third version of the GTAP model implemented in GAMS. The GAMS model is essentially implemented as a nonlinear system of equations, although it can be posed either as a CNS (constrained nonlinear system) or MCP (mixed complementarity problem). The models are provided here with GAMS tools which permit users to aggregate, filter and adjust benchmark datasets.

This version of GTAPinGAMS differs in a couple of ways from GTAPEG and GTAPinGAMS. First, this implementation more closely adheres to the GEMPACK implementation of GTAP 6. The GAMS model now accounts for differentiated import value shares in final demand, government demand and every intermediate demand coefficient. As in the GEMPACK implementation, the GAMS model now applies differentiated tax rates on all domestic and imported inputs. In addition, this implementation incorporates elastities in production, trade, and factor supply which are consistent with the GEMPACK implementation.

There are a few substatantive differences betwwen the GEMPACK and GAMS version of the model. One of these is the final demand system. Whereas the GEMPACK model is based on a CDE demand system, the GAMS model employs Cobb-Douglas preferences. Second, there are differences in units of account. Values in the GAMS implementation differ from the GEMPACK model by a factor of 1000. The GTAP database measures all transactions in millions of dollars whereas GTAP6inGAMS measures transactions in billions of dollars. Third, the two models differ in their representation of investment demand and global capital markets. The GEMPACK model assumes that a "global bank" allocates international capital flows in response to changes in regional rates of return. The GTAP6inGAMS model makes the simplest possible assumptions regarding investment demand, international capital flows and the time path of adjustment: all of these variables are exogenously fixed at base year levels. For more information on this model, you may want to read this paper

System Requirements

You will need to have the following:

Getting Started

The GTAPinGAMS package is distributed as a zip file containing the directory structure and GAMS programs which unzips into a new directory. (If you have not installed GAMS-F, you can find documentation and installation files here.

GAMS source code for model management, several aggregate datasets, and some template applications are provided with the distribution directory. The GTAP source data is not distributed with the GTAPinGAMS system. In order to generate large scale models with the GTAPinGAMS tools, it is necessary to obtain the GTAP 6 distribution data files, either from the FlexAgg or GTAPAgg packages. When working with FlexAgg, the following source data files are required:: gsdset.har, gsddat.har, gsdpar.har and gsdvole.har. When working with GTAPAgg, any .zip archive can be translated into GTAP6inGAMS format.

Here are the steps involved in installing GTAP6inGAMS:

  1. Create an empty root directory for the GTAP6 model.
  2. Unzip gtap6ingams.zip in the root directory. The resulting directory should have the following subdirectories:
  3. Install the GTAP6 data and run the build script (optional) The steps involved in building GTAP6 from scratch are documented in build.bat (or build.gms), both of which are in the build subdirectory.
  4. Solve the sample models. The steps involved in testing the installation are in the model subdirectory. See run.bat (or run.gms).

Filtering of Small Values

The GTAP6 source data presents substantial challenges for calibrated models processed using direct solution methods (e.g., PATH, CONOPT or MINOS). In my experience, most numerical problems with GTAPinGAMS models can be traced to the presence of large numbers of small coefficients in the source data. These coefficients portray economic flows which are a negligible share of overall economic activity, yet they impose a significant computational burden during matrix factorization.

GTAP6inGAMS includes a GAMS program (FILTER.GMS) which removes small values and recalibrates the resulting dataset. An input to this program (TOL) determines the filter tolerance. Values of TOL would normally range from 0.0001 to 0.01. Smaller values of TOL retain a larger number of small coefficients in the filtered dataset. Filtering makes a GTAP database smaller, as illustrated in the following figure:

As indicated, filtering reduces the size of a GTAP database by somewhere between 20% and 80%, depending on the filtering tolerance.

The filtering procedure has differential impacts on various components of the database. The largest proportional reduction in parameter density occurs in public demand, arrays vdgm and vigm. There are also substantial reductions in the density of international trade and intermediate input arrays, as is indicated here:

Rounding to zero depends on relative tolerances. Domestic demands which are smaller than tol/10 times total demand are set to zero:

*	Filter small values here:

vifm(j,i,r)$(vifm(j,i,r) < tol/10 * vom(i,r)) = 0;
vdfm(j,i,r)$(vdfm(j,i,r) < tol/10 * vom(i,r)) = 0;
vipm(i,r)$(vipm(i,r)     < tol/10 * vpm(r)) = 0;
vdpm(i,r)$(vdpm(i,r)     < tol/10 * vpm(r)) = 0;
vigm(i,r)$(vigm(i,r)     < tol/10 * vgm(r)) = 0;
vdgm(i,r)$(vdgm(i,r)     < tol/10 * vgm(r)) = 0;
vdim(i,r)$(vdim(i,r)     < tol/10 * sum(j,vdim(j,r))) = 0;
Bilateral trade flows are filtered on the basis of relative tolerances which account for the sizes of both importing and exporting economies.

Most of the reduction in nonzeros results from the elimination of small intermediate inputs and bilateral trade flows:

I would expect that individual researchers will have their own opinions about how to select parameter values should be rounded to zero. The version of FILTER.GMS provided with the GTAP6inGAMS distribution is intended to provide a starting point for this step in the dataset development process.

Complete Installation

If you wish to be able to run GTAP models from various directories on your hard disk, you will need to copy the following files to you GAMS system directory: gdxiomh.dll, har2gdx.exe, and the unzipped contents of gams-f.zip. In addition, you may wish to copy the file gtap6data.gms to your GAMS Libinclude directory.