Getting Ready: Run the UNI-CGE Model
Download a PDF version of the Getting Ready guide here:
1. A Checklist Before Running a CGE Model
As you prepare to carry out an analysis, you might make changes to
the model, such as changing elasticity parameter values, or changing a macro
closure. You will then define experiments, run the model, and examine results. It
is easy to forget what changes you have made or experiments you have run, before
running more experiments. This (common) oversight can lead to experiment
results that incorporate assumptions or shocks you had not intended to include.
To avoid
this, make it a practice to follow this checklist before running your model:
In this course, the database for each country is held in an Excel file, with a
title that includes the name of the country. You need to specify in the UNI-CGE
model which Excel country file to call and use in the model. The modeling
exercises in our course mostly use a
database for the United States, held in an Excel file named SAM-USA333.xlsx.
To check that the model is
using the country database that you are interested in, search for the command
in the model that calls in the Excel data file. Hit CTRL
+ F and search for the term “Read SAM Data.”
In the example in Figure 1, we are checking that the UNI-CGE model is calling
in the US data file. The GAMS code command
GDXXRW requests a conversion of the input file I (the Excel file SAM-USA333.xlsx)
into the output file, o, which is a GDX file that is readable by the
model.
Figure 1. Selecting the county data file
Model closure is an important decision that will to some extent predetermine the results of your experiments. You may need to change closures to selections that best represent the economy you are studying and that are appropriate for your research questions.
To avoid forgetting that you have changed a closure, review your choices of model closure before running the model (Figure 2). Ensure that the selections are the ones that you want to use for that experiment.
To check your
closure choices, hit CTRL + F and search for the term “Select the
Closure Settings.” Check that the
closure selections are correct. Note
that the default closures used in this course are:
SICLOS savings-investment closure (fixed savings rate) /1/
GOVCLOS government expenditure closure (fixed budget balance) /2/
ROWCLOS foreign exchange market closure (fixed trade balance) /1/
Figure 2. Closure options
in the UNI-CGE model
1c.
Checklist:
Check the Elasticity Parameter Values
The country databases in this course include default values for elasticities. The values are mid-range estimates based on commonly used parameter values. You may change the elasticities if you have better information on them, or if you want to explore how sensitive your results are to various parameter values. Some modeling exercises ask you to change elasticities as part of an experiment.
Before running your model, check the elasticity parameter values in your country data file. Ensure they are the appropriate selection for your experiment. Elasticities are defined in the Excel country data file. Look at the worksheets for LES and ELAST (Figure 3).
Figure 3. Elasticity worksheets in the country data file
The initial solve statement in your model calculates and
calibrates parameters and then solves the model equations. The results of the
initial solve statement replicate the data in the SAM and serve as the baseline
for your experiments. The model code that defines your experiment is placed
after the initial solve statement, and followed by a second solve statement.
The results from the second solve statement describe the economy following the
shock. You compare results from your
experiment solution to the base values, to define the effects of the shock. (These
values are reported as percent changes from the base in the results files.)
You are likely to define many experiments in your research project. Avoid having old experiments still running in the model by checking the model code between the first and second solve statements. Check that experiments that you do not intend to include are turned off (by placing a star in front of that line of code) and that the experiment you want to run is turned on (remove the star).
The model code in Figure 4 shows that the experiment that redefines the capital account balance (FSAV) is turned off. The experiment that redefines the tariff rate (TM) is turned on.
Figure 4. Turning
Experiments On and Off
2.
RUN THE UNI-CGE MODEL
2a. Run the Model with GDX Creation
In a Getting-Ready exercise, you downloaded and opened the UNI-CGE model in
GAMS. The first time you run the model, click on the green arrow, and scroll
down the submenu to select “Run with GDX creation” (Figure 5) This option creates GDX files with model
results. You can thereafter run the
model by simply clicking on the green arrow and the GDX results file will be
automatically repopulated. As your skills develop further, you will learn how
to use GDX to read and export model output.
Figure 5: Run the model
with GDX creation
As the model runs, a Process Log window will open on the right side of
the screen. You can observe the
progression as GAMS searches for a model solution. After the run is completed,
the process log reports that either a solution has been found (Figure 6 – shown
in yellow), or that there are errors in the model that prevent a successful
solution. If the model run is successful, the process log will identify where
the output files have been placed on your computer (Figure 6 – shown in
blue).
If there are
errors, the process log will list them. Your skills in interpreting and
correcting errors in GAMS will develop over time. The GAMS manual available on
the GAMS website is helpful, and you can also do an internet search to earn
about errors.
Figure 6: Process Log reports results of model run
2c. Model
Output
GAMS generates three output files after the model run is completed (Figure 7).
- The listing (.lst) file
The .lst file reports the full model and model results. Because you chose a GAMS setting that opens the .lst file after running the model (see “Getting Ready; Download GAMS and the UNI-CGE Model), the .lst file will pop open in the main display window in GAMS. The .lst also displays any data for which the model has a display command.
- GDX output file
Because you specified that the model run with GDX creation, a GDX results file will be populated when the model solves.
- UNI-RESULTS.xlsx file
This file is updated with your model results. Close the file after you view it. GAMS cannot overwrite with new model results unless the .xlsx file is closed.
Figure 7. GAMS creates .LST
and .GDX output files
You can learn more about how to locate and view relevant results in the “How To” exercises on reading model results