GTAPinGAMS and GTAP-EG: Global Datasets for Economic Research and Illustrative Models - Chapter 4


Previous Section (Chapter 3)
Next Section (Appendix)
Back to the list of contents
Back to the GTAPinGAMS Homepage


4  Using the Datasets

This section describes a usage of the GTAPinGAMS package. There are two versions of the GTAP datasets in the package: the full versions (file gtap001.zip for the GTAPinGAMS and aspen.zip for the GTAP-EG) and the aggregated versions (file gtap_small.zip for the GTAPinGAMS and aspen_small.zip for the GTAP-EG). The full versions of the datasets have a restricted distribution. In order to use the full versions, a modeller needs to obtain the standard GTAP4 data file gsddat.har33, and then download the GTAPinGAMS distribution archive with a build routine which prepares the GTAP data for calibration, and combines the GTAP with the energy data. The instructions for using the GTAPinGAMS package are given below34. For testing purposes, aggregated versions of the GTAPinGAMS and GTAP-EG datasets are provided with the archive. A modeller can test the aggregated datasets by running illustrative models. The modeller can change the models to suit his specific purpose because he has a full access to the code of the build routines and the models.

4.1  System Requirements

You will need to have the following GAMS system components:

4.2  Download

The GAMSinGAMS package is distributed in a zip archive (gtapgams.zip) file. You can download it from gtapgams.zip. The archive has the directory structure presented in Tables 19 and 20.

Table 19: Structure of the archive GTAPGAMS.ZIP

Directory Purpose File Purpose
BUILD build aspen.bat Batch file to build the GTAP-EG dataset
dataset build.bat Batch file to build the GTAPinGAMS dataset
chkdata.bat Check benchmark data
chkdata.gms Check benchmark data
chkeq.gms Check equilibrium
filter.gms Filter data
gtapaggr.bat Aggregation
gtapaggr.gms Aggregation GAMS file
gtapsets.gms Make sets for aggregation
iea_vail.gms Calibration
ieo.dat IEO Projections Data
ieodata.gms IEO Projections
impose.bat New dataset creation
impose.gms New dataset creation
recalib.gms Recalibration
regbal.gms Regional Balance
relabel.gms Relabel to GAMS format
seehar.exe Read HAR-file utility
DATA initial and vail.dat Aggregated Energy Data
resulting aspen_small.zip 13x8 GTAP-EG dataset
data gtap_small.zip 10x10 GTAPinGAMS dataset
(gsddat.har) GTAP Data (not included)
(aspen.zip) Created after running ASPEN.BAT
(gtap001.zip) Created after running BUILD.BAT
DEFINES stores aspen.map Full GTAP-EG mapping
.set, .map, and .def aspen.set Full GTAP-EG sets
files aspen_small.map 13x8 GTAP-EG mapping
aspen_small.set 13x8 GTAP-EG sets
gtap_small.map 10x10 GTAPinGAMS sets
gtap_small.set 10x10 GTAPinGAMS sets
gtap.set GTAP4 sets
iea.map IEA-GTAP mapping
iea.set IEA-GTAP sets
notax.def New tax rates definitions

Table 20: Structure of the archive GTAPGAMS.ZIP (cont.)

INCLIB standard aggr.gms Aggregation
GAMS checkset.gms Check set
utilities chktarget.gms Check target
gams2har.gms Move to HAR format
gams2prm.gms Move to GAMS parameter
gams2tbl.gms Move to table
gams2txt.gms Move to text file
gdpreport.gms Report GDP
har2gams.gms Move from HAR format
mrtdata.gms GTAP parameters calculation
unzip.gms Call unzip
zip.gms Call zip
MODELS Illustrative gtap-eg.gms The GTAP-EG Model
models runall.bat Run all GTAPinGAMS Models
mrttest.gms Test all GTAPinGAMS Models
cnstest.gms Test CNS GTAPinGAMS Model
mcptest.gms Test MCP GTAPinGAMS Model
mgetest.gms Test MPSGE GTAPinGAMS Model
nlptest.gms Test NLP GTAPinGAMS Model
mrtcns.gms CNS GTAPinGAMS Model
mrtmcp.gms MCP GTAPinGAMS Model
mrtmge.gms MPSGE GTAPinGAMS Model
mrtnlp.gms NLP GTAPinGAMS Model
readme.txt Installation Directions

After downloading the file gtapgams.zip into your computer, unzip the file making sure that the archive's directory structure is preserved36. Both the GTAPinGAMS and GTAP-EG have two versions: full and aggregated. In order to get the full versions, a user needs to run the build routines BUILD.BAT and ASPEN.BAT described below. The aggregated datasets are provided for testing purposes. They are located in the DATA subdirectory and ready to use. A description of the aggregated datasets is given below.

4.3  The build routine BUILD.BAT

The GTAPinGAMS dataset is built on the standard GTAP4 database, which is not distributed freely. In order to construct the full GTAP datasets, a user needs to contact GTAP at:
http://www.agecon.purdue.edu/gtap to obtain the GTAP4 dataset (the file gsddat.har).

The file gsddat.har should be placed into the DATA subdirectory of the GTAPinGAMS package. To create the full version of the GTAPinGAMS, a user needs to run build.bat file. For this, in MS-DOS prompt37 type build and press Enter. Run time on Pentium 500 is about 8 minutes 38.

The file build.bat is intended to:

Once you successfully run the BUILD routine, you can use the full GTAPinGAMS dataset which is placed in the DATA subdirectory. Your computer may not have enough memory to run your models on the full dataset. Therefore, the aggregation routine GTAPAGGR.BAT (described below) can aggregate the original GTAP data into the smaller datasets. You can choose what aggregation is appropriate for studying your particular application.

4.4  The build routine ASPEN.BAT

The GTAP-EG dataset is built on the standard GTAP4 database and calibrated to energy quantity and price data. In order to construct the full GTAP-EG dataset, a user needs to run aspen.bat file. For this, In MS-DOS prompt, type aspen and press Enter. Run time on Pentium 500 is about 4 minutes. If the full version of the GTAPinGAMS dataset has not been created yet, then the BUILD routine (described above) will be automatically called.

The file aspen.bat is intended to:

Users can edit aspen.bat to suit their specific applications. In particular, a pause option can be uncommented for every step to see all the stages of the dataset creation39. The original build routine has a pause in one place only - before the aggregation and running the illustrative model. At this point you'll see a message

 Aggregate to 13x8, include energy
projections and create aspen_small.zip Will aggregate to
aspen_small.zip: Press any key to continue . . .  
If you press any key, then in addition to the full dataset an aggregated dataset will be created (a new file aspen_small.zip will replace an old one) and an illustrative model will run on an aggregated data. If you press ``Ctrl-C'', then the following message appears.
 Terminate batch job (y/n)?  
If you terminate the batch job at this time (by pressing ``y'' and then ``Enter''), aspen.bat will stop and only the full version of the GTAP-EG dataset will be created and placed into DATA subdirectory under the name aspen.zip.

In the process of building the dataset, several echo files are placed in the ASPEN subdirectory:

4.5  The Aggregated GTAPinGAMS Dataset: GTAP_SMALL.ZIP

The GTAPinGAMS package contains an aggregated version of the GTAPinGAMS dataset. It is provided for testing purposes. A user can check the installation by running the models on the aggregated dataset (file gtap_small.zip), which is located in the DATA subdirectory and ready to use. The archive contains the data file GTAP_SMALL.GMS, and associated SET and MAP files. The dataset has 10 sectors, 10 regions, and 5 primary factors. Table 21 lists the set definitions. The dataset is provided by the DOE and is intended to focus on competitiveness impacts of measures intended to reduce global carbon dioxide emissions. The regional aggregation for the DOE dataset is motivated by the nature of Kyoto agreement with separate representation of the US, Japan, the EU and China. Aggregate regions in the model include Other OECD, Former Soviet Union, Central European Associates, Other Asia, Mexico plus OPEC and Rest of World. Commodities in the DOE dataset include the investment aggregate, five energy goods, metals-related industry, other energy-intensive, other manufactures and services.

Table 21: Set Definitions for The Aggregated GTAPinGAMS Dataset

SET   I   Sectors/
        MTL     Metals-related industry (IRONSTL & NONFERR)
        EIS     Other energy intensive (CHEMICAL & PAPERPRO)
        MFR     Other manufactures 
        SER     Other Services
        COL     Coal
        OIL     Petroleum and coal products (refined)
        CRU     Crude oil
        GAS     Natural gas
        ELE     Electricity
        CGD     Savings good /;

SET R Aggregated Regions /
        USA     United States
        JPN     Japan
        EUR     Europe
        OOE     Other OECD
        CHN     China
        FSU     Former Soviet Union
        CEA     Central European Associates
        ASI     Other Asia
        MPC     Mexico plus OPEC
        ROW     Other countries /;

SET   F   Factors of production
/       LND     Land,
        SKL     Skilled labor,
        LAB     Unskilled labor,
        CAP     Capital,
        RES     Natural resources /;

4.6  The Aggregated GTAP-EG Dataset: ASPEN_SMALL.ZIP

The GTAPGAMS.ZIP archive contains an aggregated version of the GTAP-EG dataset. It is located in DATA subdirectory and named ASPEN_SMALL.ZIP. The archive contains the data file ASPEN_SMALL.GMS, and associated SET and MAP files. The aggregated dataset has 13 regions, 8 goods, and two primary factors. The identifiers for the aggregated GTAP-EG dataset are contained in the SET file, which is provided in Table 22.

Table 22. Set Definitions for The Aggregated GTAP-EG Dataset

SET   I   Sectors/
	Y	Other manufactures and services 
	EIS	Energy-intensive sectors
	COL	Coal
	OIL     Petroleum and coal products (refined)
	CRU	Crude oil
	GAS	Natural gas
	ELE	Electricity
	CGD	Savings good/;

SET R Aggregated Regions /
	USA	United States
	CAN	Canada
	EUR	Europe
	JPN	Japan
	OOE	Other OECD
	FSU	Former Soviet Union
	CEA	Central European Associates
	CHN	China (including Hong Kong + Taiwan)
	IND	India
	BRA	Brazil
	ASI	Other Asia
	MPC	Mexico + OPEC 
	ROW	Rest of world /

Set   F  Aggregated factors /
       LAB      Labor,
       CAP      Capital /;

4.7  The Aggregation Routine GTAPAGGR.BAT

Once you have built the initial GTAPinGAMS or GTAP-EG dataset, you can begin to think about a particular application and which aggregations of the original GTAP-EG data would be appropriate for studying those issues. Typically it is useful to create two aggregations for any new model, one with a minimal number of regions and commodities and another with a larger number of dimensions. The small aggregation can then be used for model development.

The gtapaggr.bat program is used to aggregate the GTAPinGAMS and the GTAP-EG datasets. A command line argument defines the name of the target aggregation. You only need to provide the batch file with the target because the target's mapping file defines the source. Before running gtapaggr.bat, you must create two files, one defining the sets of commodities, regions and primary factors in the target dataset, and another defining the name of the source dataset and a correspondence between elements of the source and target. The aggregation routine produces a brief report of GDP and trade shares in the new dataset. The SET and MAP files for a new dataset are GAMS-readable files located in the DEFINES subdirectory. An example of aggregating the full GTAP-EG dataset to ASPEN_SMALL is given below.

Step 1. Creating SET and MAP files. Appendix 6 shows a sample set file aspen_small.set defining the identifiers of the resulting dataset ASPEN_SMALL. The file defines the sets of goods, regions, and primary factors which are in the model. Appendix 7 presents the associated mapping file, aspen_small.map. The file provides a definition of the source dataset together with mapping definitions for commodities and factors. When no mapping is defined for the set of regions, the aggregation routine retains the same set as in the source data. In order to run the GTAP-EG model on the aggregated dataset two requirements40 should be fulfilled: (a) commodity CGD, the investment-savings composite, must be included in every aggregation; (b) primary factors should be aggregated into capital and labor. For aggregating the GTAPinGAMS dataset only the requirement (a) should be met.

Step 2. Placing the files into the proper subdirectories. The files should placed into the proper subdirectories: the files aspen_small.set and aspen_small.map into the DEFINES subdirectory, and the source datafile aspen.zip into the DATA subdirectory. Make sure that you have the files gtapaggr.bat, gtapaggr.gms, and gtapsets.gms in the BUILD subdirectory.

Step 3. Running the aggregation routine. To run the aggregation routine, go to BUILD subdirectory, type gtapaggr aspen_small at MS-DOS prompt, and press ``Enter''. The target dataset aspen_small.zip will be placed in the DATA subdirectory 41. Now you can define your own SET and MAP and create your own aggregated datasets using gtapaggr.bat. It should be noted that the aggregation routine also includes the energy projections into the aggregated dataset if the source file is aspen.zip.

4.8  The recalibration routine IMPOSE.BAT

The program impose.bat is used to create a new balanced dataset by imposing a new set of benchmark tax rates on an existing GTAP dataset. The syntax of the command is: impose target source, where target is the name of the new dataset which is going to be created and source is the name of the dataset from which the data is taken. An example of creation the dataset in which all domestic taxes are eliminated is given below. The newly created dataset is called notax. We use gtap_small.zip as a source file.

Step 1. Creating DEF file. A user needs to create a definitions file and place it into the DEFINES subdirectory. The new dataset will have the same name as the definitions file. An example of the file where all domestic taxes are eliminated is provided in the DEFINES subdirectory of the GTAPinGAMS package and presented in Table 23.

Table 23. Benchmark Tax Definitions File: notax.def

* Set up a benchmark equilibrium in which we eliminate all domestic taxes:
 
ty(i,r) = 0;
tp(i,r) = 0;
tf(f,i,r) = 0;
tg(i,r) = 0;
ti(i,j,r) = 0;

When you write the definitions file for adjusting tax rates, bear in mind that a gross basis tax (ty) is defined as a percentage of the gross-of-tax price, hence these tax rates have a maximum value of 100% and no minimum. A net basis tax, such as tf, tp, tg, tx or tm is defined as a percentage of the net-of-tax price, hence these tax rates have no maximum value and a minimum value of -100%.

Step 2. Running the recalibration routine. Before running the impose.bat, check that you have the following files: gtap_small.map, gtap_small.set, and notax.def in the DEFINES subdirectory; gtap_small.zip in the DATA subdirectory. Then, in MS-DOS prompt type: impose notax gtap_small and press ``Enter''.

The impose command generates a dataset named notax.zip from gtap_small.zip using information from a benchmark revision file notax.def in the DEFINES subdirectory. This command also copies the set definition file gtap_small.set to notax.set and the mapping file gtap_small.map to notax.map, all in the DEFINES subdirectory.42 The program also generates a summary echo-print of trade and GDP shares for the new dataset and places this file in the BUILD subdirectory.

4.9  The benchmark data testing routine CHKDATA.BAT

The program chkdata.bat reads the dataset and checks benchmark consistency, producing an echoprint of base year GDP and trade shares. The syntax is: chkdata dataset, where dataset is the name of the dataset which is going to be checked for consistency.

4.10  The model testing routine RUNALL.BAT

The program runall.bat tests the GTAPinGAMS model in four different formulations and compares the results. These four models files are located in the MODELS subdirectory. They are:

To test the GTAPinGAMS installation, type in MS-DOS prompt: runall gtap_small. It calls the mrttest.gms program. This GAMS program processes four other programs, mgetest.gms, mcptest.gms, cnstest.gms, and nlptest.gms each of which executes a benchmark replication check, a benchmark clean-up and a single counter-factual scenario. Output from these four programs is collected in mrt.sol and the results are compared by mrttest.gms. If your installation is correct, you should see the message:

No difference detected in the solutions from alternative solvers.

displayed on the screen.43

These tests are conducted with the gtap_small dataset. You can choose to use a different existing dataset (for example, called another) for the test if you change the argument of the batch file call to: runall another.

The GTAPinGAMS models also can be called directly. For example, if you need to run MPSGE formulation of the model, type in MS-DOS prompt: gams mrtmge.gms. By default, the models are set to the aggregated GTAPinGAMS dataset. The dataset can be changed by correcting the following line in the model GAMS code: $IF NOT SETGLOBAL dataset $SETGLOBAL dataset gtap_small

4.11  Running the GTAP-EG model

An illustrative static GTAP-EG model (file gtap-eg.gms) is included in the GTAPinGAMS package. It recreates the benchmark equilibrium and also calculates a leakage rate, which is the ratio of total increased carbon emissions by non-Annex B countries to total emissions abatement by the Annex B.

In the GTAP-EG illustrative model, we restrict carbon emissions by 25% and calculate the leakage rate. You can run the model by typing gams gtap-eg in MS-DOS prompt. The results are placed in the listing file gtap-eg.lst. There is an option of using global (GK) or region-specific (RSK) capital in the model. By default, region-specific capital option is used, which is defined by the following GAMS scalar.

SCALAR  RSK     Flag for region-specific capital /1/,
        GK      Flag for global capital          /0/;

A switch to the global capital specification may be done by changing the scalars. The GTAP-EG model is set for the calculations based on the aggregated ASPEN_SMALL dataset. A user may run the model on a dataset created from his own aggregation. It can be done by changing the name of the dataset in the line $setglobal dataset aspen_small in the file gtap-eg.gms.


Previous Section (Chapter 3)
Next Section (Appendix)
Back to the list of contents
Back to the GTAPinGAMS Homepage


Maintained by Sergey Paltsev
Last Updated 01/20/01
rutherford@colorado.edu