Spring 2026

Course Web Page
Computable General Equilibrium Modeling

Instructor: Olga Kiuila

Basic rule of programming: If it works, don't touch it


The course is based on examples written in GAMS software and MPSGE economic modeling language. Alternative CGE modeling softwares - GEMPACK, AIMMS, EXCEL, MATLAB - will not be discussed here. There is available a free student version of GAMS. This is a limited version, but fully sufficient for learning the basics of CGE modeling. For instalation on macOS, if you encounter any problems, use the WineBottler package.

The examples presented here were prepared by Thomas F. Rutherford, Bruce A. McCarl, Rob Dellink, Andres Ramos, Hodjat Ghadimi, and myself. They were prepared in the classic GAMS environment, called IDE - Integrated Development Environmnet (based on Pascal/Delphi). The current environment is STUDIO (based on C++). However, the core logic remains compatible regardless of the GAMS environment because the modeling language (AML - Algebraic Modeling Language) and the engine (sending a DOS instruction to the GAMS executable) remain the same. For those interested to skip graphical interface (Studio or IDE), the command-line interface (DOS) can be used to run GAMS and MPSGE. For this purporse I recommend the free software Emacs, although I use the paid one Epsilon (such softwares allow to use one and only one editor for different tasks - Gams, Latex, Python, R, etc. - instead of having to learn several editors). For executing GAMS from other environments (Python, Matlab, Visual Basic, R, etc.) is possible without using APIs (Application Programming Interfaces).
The solutions to the exercises were prepared by my students and myself.

Techniques for estimating SAM will not be discussed in these lectrues. Examples of such techniques are available in the GAMS model library (CESAM.gms and CESAM2.gms) and the PEP model library (SAMBAL, GPCEMA). Details of entropy theory and matrix balancing techniques are described by M.Thissen and H.Loefgren, R.A.McDougall, A.Golan. The baselines for dynamic CGE models are explained in the Journal of Global Economic Analysis.


  •   Lecture 1a: History of CGE modeling (Polish version)
  •  Lecture1b: Basic rules to formulate model in GAMS 
  • EXAMPLE 0: Estonian Model and I/O Table

  •  Lecture 2a: Using GAMS  
  •  Lecture 2b: Steps to prepare MPSGE models 
  • EXAMPLE 1: numeraire (part I), MRS (part I), endowment, calibration point (part I), scaling (part I), reference prices (part I), multipliers, results interpretation, results reporting (part I), price index, $ondotl, jump to another line, ignoring equation, functional forms (part I), joint production (part I) - solution; supplement solutions (in Polish): 1, 2, 3; answers 1a, b, c (see also exercises for lecture 5)
    Example 1* (algebraic version & exercises)


  •  Lectures 3&4: Calibration point  
  • EXAMPLE 2: uniform scaling (part II), MRS(part II), reference prices (part II), normalization of variables - solution; supplement solution (in Polish): 1; answers 2a, b (see also exercises for lecture 5)
    EXAMPLE 3: leisure (part I), productivity, elasticity of substitution (part I), functional forms (part II), loops - solution answers 3a, b

  •  Lecture 5: GAMS-IDE (the alternative interface is GAMS-Studio)  
  • EXERCISES: benchmark versus counterfactual equilibrium - solution; answers 1, 2, 3, 4

  •  Lecture 6: Simple Exachange Model  
  • EXAMPLE 4: autarchy versus open economy, second welfare theorem, elasticity of substitution (part II), loop, money illusion (part I) - solution; answers 4a, b, c

  •   Lecture 7: Steps to prepare GAMS models & EXERCISES - answers  
  • EXAMPLE 5a: market clearing, errors, log file
    EXAMPLE 5b: sets, tables, alias


  •  Lecture 8: Social Accounting Matrix 
  • EXAMPLE 6a: numeraire (part II), money illusion (part II), typo, taxes (part I) - solution; answers 6a(a), 6a(b)
    Example 6a* (algebraic version using calibrated share form) and Example 6a** (algebraic version using general form)

    EXAMPLE 6b: MCP versus LP

  •   Lecture 9a: General remarks for using GAMS 
  • EXAMPLE 7a: basic notation, Walras' Law, complementarity
    EXAMPLE 7b: model of 2 consumers & 2 producers & 2 inputs


  •   Lecture 9b: Why is it worth using models?  
  • EXAMPLE 8a: good modeling practices with GAMS
    EXAMPLE 8b: Cournot model with GAMS


  •  Lecture 10: Producers (part I)  
  • EXAMPLE 9a: nested function, intermediate demand (part I), consumer as a "producer", welfare, numeraire (part III), algebraic version (part III), results reporting (part II), taxes (part II) - solution; answers 9a(a), 9a(b)
    EXAMPLE 9b: intermediate demand (part II), social accounting matrix (part II), calibration point (part II) - solution
    EXAMPLE 9c (description): joint production (part II), elasticity of transformation, default numeraire (part IV), taxes (part III) - solution; answer 9c(a)
    Example 9c* (algebraic version)


  •  Lecture 11: Government interventions  (reading)
  • EXAMPLE 10a : taxes (part IV - benchmark taxation, tax on input, tax on output), results reporting (part III) - solution...
    EXAMPLE 10b : tax reform, equal yield constraint (part I) - solution...

    EXAMPLE 10c (description): public goods, public consumption, transfers, equal yield constraint (part II) - solution...

  •  Lecture 12: International trade  
  • EXAMPLE 11: import tariffs - solution...; answers 11a, b

  •  Lecture 13: Households  
  • EXAMPLE 12 - 12*: leisure (part II) - answer; solution...
    EXAMPLE 13 : two households - answer; solution...


  •   Lecture 14: Financial module  
  • EXAMPLE 14:

  •  Lecture 15: Producers (part II)  
  • EXAMPLE 15a : economy with unprofitable activity - answers 15a(a), (b); solution...
    EXAMPLE 15b (description): decreasing returns to scale - answers 15b(a), (b); solution...

  • to add examples of income tax (M32), unemployment (M36), capital accumulation (M37), invenotires, negative savings (ers82mcp.gms in GAMS model library, stage1.gms at cgemod.org.uk)


    Examples of student  tasks for the first semester.
    Proposition of  topics for diploma thesis.
     Rules and requirements for diploma thesis.
    Data skills: Data Analyst (easiest) vs Data Engineer vs Data Scientist (the most promising).

    Presentations by students:
  •  Bitcoin by Alessandra Pernice
  •  Ramsey_Solow by Yoon Ahreumsol
  •  Energy policy in Poland by Emilia Lewczuk  
  •