How to Run the UNI-CGE Model


This guide shows you how to use a checklist as you prepare to run a model, and how to run the UNI-CGE model.  You can download a PDF version of this guide  HERE (PDF document458.2 KB) .

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:

This image provides a checklist of steps to take before you run a CGE model.

Checklist: Check That You are Using the Right Database

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

This image shows the model code that calls in a country data set.

Checklist: Check the Model Closure

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.  Macro closure options in the UNI-CGE model

This image shows options for three macro closures in the UNI-CGE model.

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

Figure shows the elasticity worksheets in the country data file.

Checklist:  Search for Extraneous Experiments

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

In the model code in Figure 4, 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

This image shows how experiments are turned on and off by placing a star in front of a line of code.

Run the UNI-CGE Model

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

Image shows a finger pointing to the button that starts a model run.

After the model runs, three files are created or updated with the model output (Figure 6).  

(1) The .lst file reports the full model and results.  It displays other useful information if you have entered a command to display it, such as the initial values of variables, and the values of calibrated parameters and coefficients. 

(2)  Because you specified that the model run with GDX creation, a GDX results file will be populated when the model solves.

3)  A third file, the UNI-RESULTS.xlsx file, will be updated with your model results and placed in your directory.

You can view the .lst and GDX files within the GAMS software.  You must use Excel to view the .xlsx file. 

You can learn more about how to locate and view relevant results in the “How To” exercises on reading model results.

Figure 6.  GAMS creates .LST and .GDX output files

Image shows a finger pointing to the list of output files created in GAMS after running the model.

Copyright Cornerstone CGE, 2024 CC 4.0 BY-NC-SA) 



Last modified: Wednesday, 1 May 2024, 12:45 PM