Getting Ready: Structure of the UNI-CGE Model

Download a PDF version of this Getting Ready exercise here:  Getting Ready: Structure of the UNI-CGE Model. (PDF document152.0 KB)

Organization of Model Code into Sections

A CGE model is a system of equations. The model's code can become lengthy because it not only defines the equations but also must include information on items that support the equations. For example, model commands are needed to select a country database, calibrate equation parameters, prepare model results, and more. 

Because even simple models can become large, they are typically organized in logical sections.  Each section has a different function. For example, different sections address the definitions of variables and parameters, equations for consumer demand and producer supply, model calibration, equilibrium constraints, and report-writing. 

Folded Sections of Model Code

To facilitate viewing a model's structure, its sections of code can be "folded" up, similar to closing an accordion. Folding provides a summary view of the structure of the model, which aids modelers in understanding the role of each section.  

Table 1 describes the structure of the UNI-CGE model by listing its folded sections and their functions. 

STRUCTURE OF THE UNI-CGE MODEL

INTRODUCTION

 

1.    SETS

Defines the sets in the UNI-CGE model

2.    INPUT AND SAM DATA

Defines the country data file that will be used in the UNI-CGE model

3.    MODEL PARAMETERS

Defines all parameters

4.    MODEL VARIABLES

Defines all variables

5.    MODEL EQUATIONS

Presents all equations in the model, divided into sections

a.       DEMAND

Consumption choices by  households, government, and investors

b.      PRODUCTION

Output, demand for intermediate and factor inputs

c.       TRADE

 

 Export supply and import demand

d.      EQUILIBRIUM CONSTRAINTS

 

Market clearing conditions that ensure supply and demand are in equilibrium in all markets – commodities, factors, and trade with the Rest of the World

e.       PRICE INDICES

 

Model numeraire options – CPI, DPI

 

5. PARAMETER ESTIMATION AND CALIBRATION

Calibration process calculates the coefficients used in demand and supply equations. The code is in an include file, 1Calibaration-UNI.inc

6. VARIABLE INITIALIZATION

Variables are initialized at their base values in the SAM, to make it easier for the model to solve.

7. MODEL CLOSURES

 

Modeler selects appropriate closures for investment-savings, government fiscal balance, the trade balance, and factor markets.  

8. MODEL SOLUTION

Run the model using the PATH solver in GAMS. Output is baseline equilibrium.

9. REPORT BASE MODEL

The base data is generated and reported in GDX files.

EXPERIMENTS

Experiments are defined.  Model is re-solved.  Output is equilibrium following the shock.

Folding and Unfolding Sections of Code

You can fold and unfold all sections of the model at once using these commands:

ALT + O    folds the entire model into its sections

ALT + Shift + O  unfolds the entire model

You can also choose to unfold or fold only one section.  Click on the arrow next to any "$onfold" statement and only that section will unfold.  Click on the $onfold arrow again to fold it up. 

 

An Exercise:  The UNI-CGE Model will be unfolded when you download it from the course website.  Try to fold and unfold it and compare its folded structure with the sections described in Table 1. 


Last modified: Wednesday, 4 September 2024, 10:16 PM