Sie sind auf Seite 1von 184

MPSGE: A Users Guide

James Markusen and Thomas Rutherford


February 2004
Department of Economics
University of Colorado
Boulder, CO 80309-0256
Lecture Notes Prepared for the
UNSW Workshop, February 24-27, 2004
Contents
1 Introduction 1
1.1 The Elements of an MPSGE Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Equilibrium Conditions: Algebra . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 Complementarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.3 Auxiliary Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Why use MPSGE? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Who are typical MPSGE users? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Some History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Getting Started with GAMS 5
2.1 Installing GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Programming in GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Programming Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Model development in GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Principles Underlying GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 The Structure of a Prototypical GAMS Program . . . . . . . . . . . . . . . . . . . . 8
2.7 GAMS Program Syntax: Key Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.8 Dealing with Errors in GAMS Programs . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.9 A Simple GAMS Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.9.1 Set and Data Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.9.2 Variable, Equation and Model Denitions . . . . . . . . . . . . . . . . . . . . 10
2.9.3 Equilibrium Computation and Reporting . . . . . . . . . . . . . . . . . . . . 10
3 Getting Started with GAMS/MPSGE 13
i
CONTENTS
3.1 What is a General-Equilibrium Model? . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 The conceptual framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.2 Steps in Applied General-Equilibrium Modeling . . . . . . . . . . . . . . . . . 15
3.2 Example M1: 2-good, 2-factor closed economy with xed factor endowments and one
representative consumer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 Functional Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.2 Demand Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.3 The MPSGE subsystem of GAMS . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Extensions of the Simple Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3.1 Intermediate Inputs and Nesting (M22) . . . . . . . . . . . . . . . . . . . . . 33
3.3.2 Joint Production (M23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.3.3 Specic Factors (M24) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.4 Tax Avoidance and Slack Activities (M25) . . . . . . . . . . . . . . . . . . . . 42
3.3.5 Labor-Leisure Choice (M26) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.6 Labor Supply to Formal and Informal Sectors (M27) . . . . . . . . . . . . . . 48
3.3.7 Heterogeneous Households (M28) . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.3.8 Stone-Geary (LES) preferences (M29) . . . . . . . . . . . . . . . . . . . . . . 52
3.3.9 Open Economy models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.3.10 Small open economy 2x2 (M41) . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.3.11 Small open economy with a benchmark tari (M42) . . . . . . . . . . . . . . 59
3.3.12 An alternative price normalization (M43) . . . . . . . . . . . . . . . . . . . . 61
3.3.13 A voluntary export restraint (M45) . . . . . . . . . . . . . . . . . . . . . . . . 67
3.3.14 Benchmark trade imbalance (M46) . . . . . . . . . . . . . . . . . . . . . . . . 70
3.3.15 An Armington formulation (M47) . . . . . . . . . . . . . . . . . . . . . . . . 73
3.3.16 Large open economy (M48) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.3.17 Full two-country Heckscher-Ohlin model (M49) . . . . . . . . . . . . . . . . . 79
3.3.18 International capital ows (M410) . . . . . . . . . . . . . . . . . . . . . . . . 82
3.4 Modeling Consumer Demand with MPSGE . . . . . . . . . . . . . . . . . . . . . . . 85
ii
CONTENTS
3.4.1 Evaluating a Demand Function . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.4.2 Evaluating the Marginal Rate of Substitution . . . . . . . . . . . . . . . . . . 89
3.4.3 Goods Demand, Leisure Demand and Labor Supply . . . . . . . . . . . . . . 91
3.4.4 A Pure Exchange Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.4.5 Import Taris and Market Power in an Exchange Model . . . . . . . . . . . . 96
4 MPSGE Syntax 99
4.1 GAMS/MPSGE Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.2 MPSGE Basic Syntax Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3 MPSGE Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4 Variable Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4.1 Domain Restriction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.5 Function Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.5.1 $PROD Block Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.5.2 A Simple $PROD Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4.5.3 $PROD Block An Example with Nesting . . . . . . . . . . . . . . . . . . . 104
4.5.4 $PROD Block Multi-level Nesting . . . . . . . . . . . . . . . . . . . . . . . 106
4.5.5 $PROD Block Joint Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . 106
4.5.6 Taxes on Inputs in a $PROD Block . . . . . . . . . . . . . . . . . . . . . . . 107
4.5.7 Taxes on Outputs in a $PROD Block . . . . . . . . . . . . . . . . . . . . . . 108
4.5.8 Modeling technical change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.5.9 $DEMAND Block Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
4.5.10 Applying Taxes on Final Demand . . . . . . . . . . . . . . . . . . . . . . . . 110
4.5.11 Classical Unemployment with Rationed Endoments . . . . . . . . . . . . . . . 111
4.6 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.7 Report Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.9 Switches and Debug Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
iii
CONTENTS
5 Three Small MPSGE Models 117
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.2 Benchmark Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.2.1 Rectangular Social Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.3 Partitioning the Social Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.4 Extracting Data from the Social Accounts . . . . . . . . . . . . . . . . . . . . . . . . 119
5.5 The MPSGE Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
5.5.1 Comments Regarding the Model . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.5.2 MPSGE Formulation: Key Ideas . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.5.3 Computing Counter-factual Scenarios . . . . . . . . . . . . . . . . . . . . . . 123
5.6 Alternative Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
5.6.1 Tax Analysis with Equal Yield . . . . . . . . . . . . . . . . . . . . . . . . . . 124
5.6.2 Public Goods and Endogenous Taxation . . . . . . . . . . . . . . . . . . . . . 126
5.6.3 Comparing Model Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.7 Algebraic Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.7.1 Harberger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.7.2 Shoven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5.7.3 Samuelson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6 An Empirical Model 133
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.2 Social Accounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.2.1 SAM Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.2.2 Colombian 1996 SAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.2.3 Data Management and Model-Building . . . . . . . . . . . . . . . . . . . . . 137
6.2.4 Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.2.5 Checking Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6.2.6 Forensic Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6.3 A Static General Equilibrium Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
iv
CONTENTS
6.3.1 General Overview of GE Modeling . . . . . . . . . . . . . . . . . . . . . . . . 140
6.3.2 Economic Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
6.3.3 Symbol Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
6.3.4 Functional Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6.3.5 Other Model Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
6.3.6 Harris-Todaro Employment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6.3.7 Equilibrium Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.4 Conducting Economic Policy Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.4.1 Example: Compute the Marginal Cost of Funds . . . . . . . . . . . . . . . . . 151
6.4.2 Short Run vs. Long Run Tax Incidence . . . . . . . . . . . . . . . . . . . . . 152
6.5 Data Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6.5.1 The Excel input le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.5.2 Reading the SAM into GAMS with XLIMPORT . . . . . . . . . . . . . . . . . . 154
6.5.3 Economic Accounting and Consistency Checks . . . . . . . . . . . . . . . . . 155
6.5.4 Accounting Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
7 Nested CES Functions 159
7.1 CES Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.2 CES Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
7.3 The Calibrated Share Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.4 Exercises with CES Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.5 Benchmarking Supply Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
7.5.1 A Long-run Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
7.5.2 Calibrating Both Short- and Long-Run Responses . . . . . . . . . . . . . . . 166
7.6 Flexibility and Non-Separable CES . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
7.7 Calibrating Three Factor Cost Functions . . . . . . . . . . . . . . . . . . . . . . . . . 169
7.8 Calibrating Four Factor Cost Functions . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.9 Price Elasticities in Nested CES Functions . . . . . . . . . . . . . . . . . . . . . . . . 175
7.9.1 The Own-Price Elasticity of Demand . . . . . . . . . . . . . . . . . . . . . . . 176
v
CONTENTS
7.9.2 The Cross-Price Elasticity of Demand . . . . . . . . . . . . . . . . . . . . . . 176
vi
1. Introduction
MPSGE is a mathematical programming system for general equilibrium analysis which operates
as a subsystem to the mathematical programming language GAMS. MPSGE provides a structured
framework for specifying a general equilibrium model. The MPSGE system consists of a library of
function and Jacobian evaluation routines which can be used to partially automate the formulation
and analysis of AGE models. MPSGE simplies the modelling process and makes AGE modelling
accessible to any economist who is interested in the application of these models. In addition to
solving specic modelling problems, the system serves a didactic role as a structured framework in
which to think about general equilibrium model.
All features of an MPSGE model are communicated through a tabular input format which is em-
bedded in a GAMS program. To use MPSGE a user must learn the syntax and conventions of this
model denition language.
1.1 The Elements of an MPSGE Model
MPSGE is based on the modeling format for Arrow-Debreu general economic equilibrium models
proposed by Mathiesen (1985) which was in turn based on Scarf (1973). Mathiesen demonstrated
that Arrow-Debreu models could be formulated and eciently solved as complementarity problems.
Mathiesens formulation may be posed in terms of three sets of central variables:
p a non-negative n-vector of commodity prices including
all nal goods, intermediate goods and primary factors
of production
y a non-negative m-vector of activity levels associated
with constant returns to scale production sectors in the
economy
M an h-vector of income levels, one for each household
in the model, including any government entities.
1.1.1 Equilibrium Conditions: Algebra
An economic equilibrium in an MPSGE model satises a nonlinear system of equations (and in-
equalities) in which there are three types of equilibrium conditions, one for each class of variable.
The correspondence between variables and equations is as follows:
Commodity price Market clearance Market supply must be greater than or equal to market
demand. In the context of an MPSGE model this implies that aggregate consumer endow-
ments plus aggregate producer supply must be greater than or equal to aggregate demand by
1
producers and consumers.
Producer activity level Zero prot Unit cost of production must be at least as greate as unit
revenue. Formally, all technologies are assumed to exhibit constant returns to scale. Hence,
average and marginal cost are equivalent.
Consumer income level Income denition We employ uncompensated demand functions in
MPSGE which implies that equilibrium expenditure cannot exceed equilibrium income for any
consumer. Equations which dene consumer income levels account for both the value of initial
endowments and the value of any tax revenues which are associated with a particular consumer
agent.
1.1.2 Complementarity
MPSGE incorporates complementarity to represent its common feature in economic markets. This
implies that while one equilibrium condition is associated with each economic variable, an equilibrium
condition may be non-binding (or slack) should the associated variable be zero. The economic
interpretation of complementarity conditions are quite intuitive:
When the equilibrium supply of a particular commodity exceeds equilibrium demand, the
associated price must be zero. A tangible every-day example of this idea is represented by
grocery store coupons. If coupons for a particular sale are in excess supply, no one would be
willing to pay for one. On the other hand, if there were a limited number of coupons issued
for fresh turkeys during holiday season, those coupons might be bought and sold at a positive
price, and the supply would equal demand because at a postiive price noone would want to
through one away. At the very least, if you werent going to use a coupon which had a positive
value you would trade it to your neighbor if not for money then perhaps for something of
non-pecuniary value such as good will.
When the marginal cost of production for a given activity exceeds marginal revenue, then the
activity level must be zero. There are numerous examples of production activities which are
not operated at positive intensity. Hot chocholate vendors would not be found in Alice Springs
nor would snow-cone vendors be found in St. Petersburg during the month of January.
Complementarity conditions do not apply to income equations in an MPSGE model. Income
variables are introduced solely to simplify accounting and to provide a robust normalization
of the price system.
1.1.3 Auxiliary Variables
The standard framework for general equilibrium models proposed by Mathiesen accomodates ad-
valorem taxes and lump-sum income transfers, but it does not accomodate many common extensions
(public goods, increasing returns to scale, imperfect competition, etc.). In order to accomodate these
types of model features, MPSGE has
t an i -vector of auxiliary variables.
Auxiliary variables are used to introduce endogenous tax instruments or endogenous endowment
quantities to a model. Any auxiliary variable added to an MPSGE model has an associated equi-
librium condition dened by the modeller using conventional GAMS algebraic syntax.
2
1.2 Why use MPSGE?
The are a number of arguments in favor of using conventional algebra to describe an economic model.
The strongest argument in favor of an algebraic approach is transparency. When a model has been
formulated as a set of GAMS equations, the model itself provides a very complete and detailed ex-
plaination of the underlying model structure. On the other hand, the algebraic formulation presents
a number of diculties, particularly the degree of precision and accuracy with which everything
must be done.
An MPSGE approach to model building reduces both algebraic tedium and the scope for program-
ming errors. This simplication of certain steps permits the modeller to pay more attention to
economic interpretation and the testing of alternative formulations.
The following is a partial list of the tasks involved in constructing a general equilibrium model:
1. Collectiong of source data, typically an IO table, household survey and a set of trade statistics.
This data is often obtained in XLS format.
2. Interpretation, reconciliation and balancing of the source data.
3. Specication of model variables and equations.
4. Calibration of coecients of preferences and technology.
5. Replication of the benchmark equilibrium to verify that the model equations and the derived
coecients are internally consistent.
6. Denition of scenarios and solution of the scenarios.
7. Report generation (tables and gures)
8. Interpretation and writing.
MPSGE oers substantial reductions in the work required for steps 3 through 5. MPSGE is an
equation generator which automates the calibrates fuction parameters to a benchmark equilibrium
while simultaneously providing an automatic specication of the equations which dene a general
equilibria. The novice modeller benets from using MPSGE because it provides a clear framework
for the underlying model. The expert modeller benets from the sparse format in which the model is
portrayed and the resulting ease with which alternative models can be implemented and compared.
1.3 Who are typical MPSGE users?
MPSGE is intended for use by students and professional economists who have completed a calculus-
based microeconomics course. A minimal level of preparation would be Hal Varians undergraduate
microeconomics textbook ( Intermediate Microeconomics: A Modern Approach, Norton & Com-
pany).
The MPSGE language may be used for both large- and small-scale applications. In theoretical
curricula, MPSGE can be used to provide students with a perspective on the practical application
microeconomic theory.
Expertise with a modeling language requires some eort. A diligent student who works through all
of the examples provided here should be capable of building small models from scratch to illustrate
basic theory. This is a rst step to acquiring a set of useable tools for applied work.
3
1.4 Some History
GAMS the Generalized Algebraic Modelling System, is a modeling language which was originally
developed for linear, nonlinear and integer programming. This language was developed over 25 years
ago by Alex Meeraus when he was working at the World Bank. (See Brooke, Kendrick and Meeraus
1988.) Since that time, GAMS has been widely applied for large-scale economic and operations
research modeling projects.
Prior to their marriage, MPSGE and GAMS embodied dierent design philosophies. MPSGE was
(and is) appropriate for a specic class of nonlinear equations, while GAMS is capable of represent-
ing any system of algebraic equations. While GAMS is applicable in several disciplines, MPSGE is
only applicable in the analysis of economic equilibrium models. The expert knowledge embodied
in MPSGE is of particular use to economists who are interested in the insights provided by formal
models but who cannot devote many hours to programming. MPSGE provides a structured frame-
work for novice modellers. When used by experts, MPSGE reduces the setup cost of producing an
operational model and the cost of testing alternative specications.
In contrast, the GAMS modelling language is designed for managing large datasets. The use of
sets and detached-coecient matrix notation makes the GAMS environment very nice for both
developing balanced benchmark datasets and for writing solution reports. GAMS disadvantage
for economic applications concerns the specication of the model structure. Economic equilibrium
models, particularly those based on complicated functions such as nested constant-elasticity-of-
substitution (CES), are easier to understand at an abstract level than they are to specify in detail,
and the translation of a model from input data into algebraic relations can be a tedious and error-
prone undertaking.
The interface between GAMS and MPSGE combines the strengths of both programs. The system
uses GAMS as the front end and back end to MPSGE facilitating data handling and report
writing. The language employs an extended MPSGE syntax based on GAMS sets, so that model
specication is concise.
4
2. Getting Started with GAMS
If you are serious about learning to use GAMS/ MPSGE you need to install GAMS/MPSGE on
your own computer. GAMS runs on all versions of Windows, Linux and Unix. Copies of the most
recent GAMS system can be obtained directly from GAMS.
Copyright restrictions apply only to GAMS license les. When you copy the GAMS systems les
without the license le, the program will only operate in student/demonstration mode. The student
version is perfectly adequate for learning how to build models. In fact, there are distinct advantages
to working in demo mode, primarily the fact that the dimensionality restrictions prevent the novice
model builder from adding unnecessary details.
2.1 Installing GAMS
It is advisable to have a high-speed internet connection to download the setup le from the GAMS
website. Once you have obtained setup.exe, execute this le to install:
The GAMS system and all the associated solver subsystems.
On-line documentation
A model library
If you dont have a license le to install with GAMS this is not such a a big problem, as you are free
to run GAMS in demonstration mode which provides complete functionality with certain limits
on problem dimension.
Working with les is a basic tasks in model development. Here are some suggestions on how to
approach this:
Create a separate directory for each new model.
Do not work in the GAMS system directories.
If you are using the GAMS/IDE, you will need to dene a new project in the directory where
your model les will be located.
Pay attention to where you locate the project le for a new model. When GAMS is used from
the command line, the current directory determines the location of the listing le, include
les, option les, put les etc. When executing a Windows program, there is no current
directory. The current directory when running the GAMS/IDE is dened by the location of
the associated project le.
5
Develop a backup system for your work. When you are working on a model and get something
to run, create an archive of the model directory by copying all the les to a subdirectory. I
typically include a subdirectory structure like:
projectID
\paper
\doc
\model
\ver0
\ver1
\...
Subdirectory projectID
model has the most recent working version of the model. Subdirectory projectID\paper keeps
various versions of the associated paper (never build a model without writing a paper!). Sub-
directory projectID\doc keeps various pieces of documentation assembled during the model
development. This may include PDF les from various places, ancillary data les, and a num-
ber of notes to myself written at dierent points in the modeling development process. These
notes often prove invaluable when picking up a model after a month break. projectID\model
contains the most recent version of the model, and projectID\ver0,ver1,... contains the
model at various stages of development (as documented in the doc directory).
2.2 Programming in GAMS
You need to know something about programming in GAMS to use GAMS/MPSGE. At a minimum,
you need to know how to produce a GAMS program which dene the sets and data for your MSPGE
model. There are several means of doing this. A beginner is advised to start out with the GAMS
Integrated Development Environment (GAMS IDE). While this is adequate for many applications,
I typically recommend that graduate students or profession economists who are planning to use
numerical modelling in their research take the time to develop some facility with a programmers
text editor.
2.3 Programming Editors
Programmers text editors can provide eciency advantages as a means of developing GAMS pro-
grams. I typically recommend Emacs for the reason that it provides keystroke commands which are
portable across platforms, i.e. under MS Windows, Linux and and even Apple. Of course, the choice
of editor is a personal issue, and there is an issue of hysteresis. (Mark Bulloch observed that Editors
are like mother ducks - once youve identied yours...). A minimal standard for any text editor that
you want to use with GAMS is that it should provide matching parenthesis highlighting.
6
Emacs-Compatible Editors Description
Epsilon This editor is not free, but it is my favorite. Epsilon
is compact, yet extensible with a C-like language, and
oers an excellent GAMS mode with keyword high-
lighting, etc.
GNU NTEmacs This is a free, fully-featured implementation of Emacs.
It now has a GAMS mode developed by Shiro Takedo.
NotGNU This is a compact, reliable and free implementation
of EMACS. Its only shortcoming is that it is non-
extensible.
Other Editors Description
MetaPAD This editor is small yet fully functional, and it is free
OxEdit+GAMS This is Philip Vitons programming environment for
GAMS which is free and widely recommended.
Crimson A good editor with two limitations: line length max of
2048 and line max of 65536. Otherwise, its a powerful,
extensible tool.
TextPad This is not freeware but its not expensive, and there is
a set of syntax les for editing GAMS code. Textpad
permits manipulation of columns as well as rows.
2.4 Model development in GAMS
1. Develop an understanding of issues and available data for the application you are studying
2. Program a simple pilot model
3. Repeat until you are satised with the model:
(i) Debug the code, trying to stick to your current design and avoiding elaboration of the
model formulation or dataset.
(ii) Dene the scenarios you will run with the model, and devise a set of tables and gures
which you will generate using model results. Put your best-guess numbers in each table,
and sketch each gure. These values provide your ex-ante guess at what the model will
produce.
(iii) Solve the scenarios you have laid out.
(iv) Generate the tables and gures using the scenario solution values.
(v) Look at the results, compare the actual results with your conjectured results. Pay atten-
tion to where the model departs substantially from your back-of-the-envelope estimates.
(vi) Archive the model code and dataset so that the results for the current version can be
readily reproduced.
(vii) Modify the model, introducing new data or elaborating on particular aspects of the for-
mulation.
7
How many times do you need to repeat step 3? Well, that is a bit like asking How many hours
does it take to cook a turkey? It depends on both the size of the bird and the type of oven. If you
pay attention, particularly during step (v), youll know when you are done.
2.5 Principles Underlying GAMS
There are several ideas underlying the design of the GAMS modeling language. It helps to
keep these ideas in mind as you write programs.
Model development and model solution are logically separate activities. If you are working
with an economic model, you should focus on the formulation and parameterization and
leave the solution work to numerical analysts.
Your GAMS program should provide a means of documenting your work, particularly if
you follow good programming practices, i.e. use the descriptive text elds that GAMS
provides, and think about what you write.
GAMS models oer sucient exibility to permit the development of several dierent user
interfaces, however we recommend that you rst focus rst on the economics of your model,
and think about the interface issues only after the model is running.
The GAMS model library provides an excellent source of ideas for how to model various
economic phenomena.
Use the on-line documentation GAMS: A Users Guide by Anthony Brooke, David Kendrick,
Alexander Meeraus, and Ramesh Raman, with a tutorial chapter by Richard E. Rosenthal.
This document is provided with the GAMS system les:
gams system directory/docs/bigdocs/GAMSUsersGuide.pdf
2.6 The Structure of a Prototypical GAMS Program
Inputs
Sets
Data (Parameter and Table statements)
Variables
Equations
Model statement
Scenario denitions and Solve statements
Display and other reporting statements
Outputs
Echo prints of benchmark data
Reference maps of where symbols are used in the program
Equation listings
Solver status reports
Results, includeing display statements, text and Excel report les
2.7 GAMS Program Syntax: Key Ideas
The input format is free form:
GAMS ignores blanks and case
8
Tabs are ignored except in TABLES where tab stops are assumed (by default) to be set
every 8 characters.
Semicolons separate GAMS statements
Good GAMS programmers insert the optional descriptive text whereever it is permitted:
Explanatory text for sets, set elements, parameters, variables, equations, models.
Comment lines, indicated by * in the rst column, can be inserted to describe the logic
underlying assignment statements.
Longer commentary can be introduced between $ontext and $offtext delimiters.
2.8 Dealing with Errors in GAMS Programs
Bear in mind that the standard mode of operation for any computer code in the development
process is dysfunction. If you want to learn how to build computer models, you need to learn
how to debug programs.
Compilation errors are identied by *** in the listing le. Compilation errors often cascade
one error causes others. We have found that it is often best to correct the rst compilation
error and leave subsequent errors to be addressed after the rst is corrected.
Typical causes of GAMS compilation errors are:
Missing semicolons
Spelling errors, particularly for keywords.
Misalligned numbers in tables.
The most challenging errors in GAMS present themselves only aftr all the compilation errors
have been corected. At that point the short-circuits between the headphones need to be
addressed.
When debugging execution time errors, it is often helpful to declare, assign and display debug
parameters in order to disagnose the cause of your error.
Have a look at the error code ($) and its explaination which GAMS prints at the bottom of
the listing le.
2.9 A Simple GAMS Program
2.9.1 Set and Data Denitions
This GAMS program illustrates a simple spatial price equilibrium model formulated as a comple-
mentarity problem. The linear version of the model corresponds to a linear program, but when the
nonlinear demand is introduced the problem becomes a system of nonlinear equations.
When examining GAMS code it is helpful to be classify the code into two categories of statements:
(i) declarative statements, those which dene sets, data and the logical structure of models and (ii)
procedural statements, those which instruct the computer to undertake a specic set of tasks in a
particular sequence. The declarative part of GAMS program consists of statements which dene
sets and data. All statements in this rst part of this program are declarative. As most GAMS
programs, this program begins by declaring sets, parameters and associated data.
1 Sets i canning plants / seattle, san-diego /
2 j markets / new-york, chicago, topeka / ;
9
3
4 Parameters
5 a(i) Reference supplies /seattle 350, san-diego 600/,
6
7 b(j) Reference demand /new-york 325, chicago 300, topeka 275/,
8
9 esub(j) Demand elasticities
10 / new-york 1.5, chicago 1.2, topeka 2.0 /;
11
12 Table d(i,j) distance in thousands of miles
13 new-york chicago topeka
14 seattle 2.5 1.7 1.8
15 san-diego 2.5 1.8 1.4;
16
17 Scalar f freight in dollars per case per thousand miles /90/ ;
18
19 Parameter c(i,j) transport cost in thousands of dollars per case ;
20
21 Parameter pbar(j) reference price at demand node j;
22
23 Parameter report(*,*,*) Summary report;
24
2.9.2 Variable, Equation and Model Denitions
The second section of the program is also strictly declarative. It denes variables, equations and
models. No calculations are performed here. These statements establish what is meant by a given
model so that when a (procedural) solve statement is encountered the meaning is understood.
25 Positive variables
26 w(i) shadow price at supply node i,
27 p(j) shadow price at demand node j,
28 x(i,j) shipment quantities in cases;
29
30 Equations
31 supply(i) supply limit at plant i,
32 fxdemand(j) fixed demand at market j,
33 prdemand(j) price-responsive demand at market j,
34 profit(i,j) zero profit conditions;
35
36 profit(i,j).. w(i) + c(i,j) =g= p(j);
37
38 supply(i).. a(i) =g= sum(j, x(i,j));
39
40 fxdemand(j).. sum(i, x(i,j)) =g= b(j);
41
42 prdemand(j).. sum(i, x(i,j)) =g= b(j) * (pbar(j)/p(j))**esub(j);
43
44 * Declare two models based on these equations, one in which
45 * we assume fixed demand and another with price-responsive
46 * demand:
47
48 Model fixedqty / profit.x, supply.w, fxdemand.p/ ;
49 Model equilqty / profit.x, supply.w, prdemand.p/ ;
2.9.3 Equilibrium Computation and Reporting
The nal portion of this simple GAMS program consists of a series of procedural statements which
are executed sequentially. The rst statement assigns the numeric value to parameter c(i,j) based
10
on parameters which have been previously dened.
The inital values of the variables are assigned before the rst model solution. Thereafter the equi-
librium values from the solution are stored in the report parameter.
50
51 c(i,j) = f * d(i,j) / 1000 ;
52
53
54 * Assing initial level values::
55
56 p.l(j) = 1;
57 w.l(i) = 1;
58
59 * Solve the fixed demand model:
60
61 Solve fixedqty using mcp;
62
63 report("fixed",i,j) = x.l(i,j);
64 report("fixed","price",j) = p.l(j);
65 report("fixed",i,"price") = w.l(i);
66
67 * Calibrate the demand functions to the
68 * shadow prices in this equilibrium:
69
70 pbar(j) = p.l(j);
71
72 * Replicate the fixed demand equilibrium:
73
74 Solve equilqty using mcp;
75
76 report("equil",i,j) = x.l(i,j);
77 report("equil","price",j) = p.l(j);
78 report("equil",i,"price") = w.l(i);
79
80 * Compute a counter-factual equilibrium in
81 * which the cost of shipments from Seattle
82 * to Chicago are reduced by 50\%:
83
84 c("seattle","chicago") = 0.5 * c("seattle","chicago");
85
86 Solve fixedqty using mcp;
87 report("fixed",i,j) = x.l(i,j);
88 report("fixed","price",j) = p.l(j);
89 report("fixed",i,"price") = w.l(i);
90
91 * Compute the same scenario in the fixed demand
92 * model:
93
94 Solve equilqty using mcp;
95 report("equil",i,j) = x.l(i,j);
96 report("equil","price",j) = p.l(j);
97 report("equil",i,"price") = w.l(i);
98
99 * Display the report:
100
101 Display report;
11
12
3. Getting Started with GAMS/MPSGE
This chapter provides a tutorial on applied general-equilibrium modeling using the specic software
of GAMS and MPSGE. Before plunging into things, the reader should be aware of some required
topics which will not be covered here:
First, we will not provide a detailed tutorial on GAMS notation and syntax beyond what has
already been suggested above. For more detailed instructions on GAMS programming you can
consult the GAMS web site, www.gams.com. We would suggest that a student begin with Rick
Rosenthals tutorial which conveys a lot of the basics you need to know. Bear in mind that the
tutorial and most of the GAMS documentation focuses on optimization problems, whereas applied
GE modeling generally involves solving square systems of equations and inequalities. In spite of
these shortcomings, the GAMS User Guide will give you the syntax and notation as indicated. Try
going through at least Chapters 2 and 3 of the GAMS Users Guide before continuing with this
tutorial.
Second, you will need to consult the GAMS web site for a copy of the software. A demonstration
copy is provided for free.
While it involves little more than a single click of the mouse, there are detailed instructions on
installation. Consult the GAMS UserS Guide on how to actually run a program and nd and view
the output. This set of notes is limited to actually formulating applied problems into code, and it is
beyond the scope of this material to describe the computer techniques which logically comes rst.
3.1 What is a General-Equilibrium Model?
There are many models which are portrayed by their authors as general equilibrium. The term
assumes dierent meanings in dierent elds, so it is probably a good idea to begin with a denition
of what this means. When we say general equilibrium, we are normally thinking of models which
have the following characteristics.
1. Multiple interacting agents
2. Individual behavior based on optimization
3. Most agent interactions mediated by markets and prices
4. Equilibrium occuring when endogenous variables (e.g., prices) adjust such that
agents, subject to the constraints they face, cannot do better by altering their behavior.
(Producers maximize prot, consumers maximize welfare.)
markets (generally, not always) clear. In most cases this means that supply equals demand
in each market.
13
3.1.1 The conceptual framework
General-equilibrium theory in economics is often quite abstract. A usual introductory formulation
consists of a set of markets for goods and factors of production. Agents, which are typically labeled
consumers and rms, optimize subject to the constraints they face such as technologies and budget
constraints. These optimizations then lead to excess demand functions for each good and factor.
Equilibrium is then obtaining by nding a set of prices such that all excess demands are zero.
General-equilibrium theory is generally focused on abstract issues such as proving that a set of
equilibrium prices and hence equilibrium itself exists.
While this is an important task, the theorists rarely bother with analyzing what those equilibrium
prices are or how they are related to underlying features of the economy such as preferences, technolo-
gies and so forth. And it follows that the abstract theory is of little or no use in answering questions
about how changes in policies such as taxes or taris inuence the equilibrium. Some progress can
be made in special theoretical models such as the Heckscher-Ohlin model of international trade. In
this model, the direction of trade can be related to underlying technologies and factor endowments,
and the eects of policies such as taris on welfare and the distribution of income among factor
owners (the Stolper-Samuelson theorem) can be derived.
Yet even in the analytical Heckscher-Ohlin model, two problems persist. First, the results are
qualitative; e.g., they give us the signs of comparative-statics derivatives or tell us that some
elasticity is greater than one. But analytical results cannot be much more precise than that. Second,
almost all results are only unambiguous in a version of the model in which there are two goods, two
factors, two countries and consumers everywhere have identical and homogeneous preferences over
goods. Three goods, three factors, three countries or two distinct consumer groups create problems
that cause the elegant results of Heckscher-Ohlin to collapse.
Applied general-equilibrium modeling is the way around these diculties, such that the concept
of general-equilibrium actually becomes useful for analyzing real economies and real policies. Any
number of good, factors, household types, and countries may be included. While the eld started out
with the assumptions of constant returns to scale and perfect competition in all production activities,
we have learned how to incorporate scale economies and imperfect competition. We have learned
how to include complex tax structures, public goods, externalities, and rationing constraints such
as price controls or quotas that prevent markets from clearing.
Naturally, there is a price to be paid from the theorists point of view. We have to assume specic
functional forms for preferences, production functions, and so forth. Many parameters of these
functions can be drawn from published data or estimated with econometrics, but others remain
educated guess work. This exercise draws criticism from both theorists and econometricians alike,
but in the end applied GE modeling delivers answers to policy questions, however imprecise those
answers might be.
What exactly, then, is an applied GE model? It begins by the following theory: an economy and
the equilibrium conditions for that economy are translated into a mathematical formulation. Gen-
eral equilibrium is then represented as the solution to a well-dened mathematical problem. More
specically, there are two general ways of formulating this mathematical problem. The rst is to
model the economy as an optimization or programming problem. This tends to be the rst way a
student of economics would approach the problem, since optimization and optimization techniques
are a fundamental part of the theory of the consumer and the theory of the rm. Thus general
equilibrium could be thought of as the solution to a big linear or non-linear programming problem,
in which some objective function is maximized or minimized subject to a set of constraints.
14
It turns out that representing equilibrium as the solution to an optimization problem becomes
awkward when there are several households or countries. What is it that should be optimized?
There is no clear objective function to optimize. The second way of approaching the problem
follows from formal theory. Individual optimizing behavior and decisions of consumers and rms are
embedded in functions describing the agents choices in response to the values of variables facing
them. So, for example, we use individual optimization to derive demand and supply functions that
describe how consumers and rms will react to prices, taxes, and other variables.
Once we have done this, nding general-equilibrium is reduced to nding the solution to a square
system of n equations in n unknowns. Individual behavior and optimization are embedded in those
n equations. That is the approach we take here. An applied general-equilibrium model is a square
system of n equations in n unknowns that is formulated in a fashion that permits a numerical solution
by computational techniques, nding the actual values of the endogenous variables for given values
of exogenous parameters. Endogenous variables include outputs, prices, trade volumes and so forth.
Exogenous parameters include preferences, technologies, factor endowments and so forth.
As we will see shortly, the software we use permits a very important generalization of this notion of
solving a square system of equations. For many economic problems, equilibrium may involve some
goods not being produced or some possible trade links not being actively used. We really would like
to formulate the general-equilibrium model as a system of weak inequalities, with each inequality
associated with a particular non-negative variable such as a price or quantity. If a particular weak
inequality holds as an equation, then the associated variable is strictly positive. If it holds as a strict
inequality, then the associated variables is zero.
An example of this for a competitive model is the requirement that, in equilibrium, the prots from
a given production activity must be non-positive. The associated variable to this inequality is the
output level of that activity. In an equilibrium in which output is positive, the associated weak
inequality must be binding. If in equilibrium the inequality is nonbinding, (potential) prots from
that production activity are negative, and no output is produced.
Thus we will formulate a general equilibrium model as a square system of weak inequalities, each
with an associated non-negative variable. In mathematics this is referred to as a complementarity
problem, and the associated variables are referred to as complementary variables.
Software other than that used here (GAMS and MPSGE) generally do not allow the user to solve
complementarity problems, greatly limiting model formulation and the range of comparative statics
questions analyzed by the modeler.
3.1.2 Steps in Applied General-Equilibrium Modeling
Here are the normal steps in applied general-equilibrium modeling.
1. Specify dimensions of the model.
Numbers of goods and factors
Numbers of consumers
Numbers of countries
Numbers of active markets
2. Chose functional forms for production, transformation, and utility functions; specication of
side constraints.
Includes choice of outputs and inputs for each activity
15
Includes specication of initially slack activities
3. Construct micro-consistent data set.
Data satises zero prots for all activities, or if prots are positive, assignment of revenues
Data satises market clearing for all markets
4. Calibration: parameters are chosen such that functional forms and data are consistent in the
sense that the data represent a solution to the model.
5. Replication run model to see if it reproduces the input data.
6. Counter-factual experiments.
Steps (3) and (4) are not strictly speaking necessary. The software can be used for pure simulation
analysis, in which there initially is no data. However, in learning the software, it is very valuable to
start by writing down a micro-consistent data set and then transform that into code such that the
solution to the model reproduces the initial data.
Lets now turn to a concrete example of a simple general-equilibrium model.
3.2 Example M1: 2-good, 2-factor closed economy with xed factor en-
dowments and one representative consumer.
Take a very simply economy, two sectors (X and Y ), two factors (L and K), and one representative
consumer (utility function W). L and K are in inelastic (xed) supply, but can move freely between
sectors. p
x
, p
y
, p
L
, and p
K
are the prices of X, Y , L and K, respectively. I is consumers income
and p
w
will be used later to denote the price of one unit of W. These are the equations of the model.
X = X(L
x
, K
x
)
Y = Y (L
y
, K
y
)
L

= L
x
+L
y
K

= K
x
+K
y
W = W(X, Y )
I = p
l
L

+p
k
K

= p
x
X +p
y
Y
factor allocations to the two sectors? Many economists rst reaction would be to formulate equilib-
rium as the solution to an optimization problem. Equilibrium could be solved for by a constrained
optimization problem: max W subject to the remaining constraints.
16
While this would work, the usefulness of this approach breaks down quickly as the model becomes
more complicated. Suppose, for example, there are two dierent consumer types with dierent
preferences and dierent factor endowments. What do we maximize? You could maximize the
utility of one consumer subject to an arbitrary xed level of the utility of the other consumer,
exploiting the rst theorem of welfare economics. But unless you are extraordinarily lucky, the
solution will give each consumer an implied expenditure level which is not equal to the consumers
income. Thus there is an inconsistency in the proposed solution.
The alternative approach is to convert the problem to a system of equations, and solve that sys-
tem. First, solve the underlying cost minimization problems for producers and consumers, so that
individual optimizing behavior is embedded in the model. In the present model, we want to solve
for cost functions for each sector, which embody ecient and optimizing cost-minimizing behavior.
These give the minimum cost of producing a good at given factor prices.
3.2.1 Functional Forms
Similarly, we can solve for a cost function for the consumer, commonly called an expenditure function,
which gives the minimum cost at given commodity prices of buying one unit of utility or welfare
(W). These functions are given as follows.
Unit cost functions for X and Y :
cx = C
x
(p
L
, p
K
), cy = C
y
(p
L
, p
K
)
Unit cost (expenditure) function for W:
e = e(p
x
, p
y
)
3.2.2 Demand Functions
The next crucial step is provided by demand theory, Shepards lemma in particular. This result,
which in turn relies on the envelope theorem, states that the partial derivatives of these functions
are quantities. In particular, we have:
1. X producers optimal demand for labor per unit of output (similarly for Y )
cx
p
L
= cx
p
L
2. X producers demand for capital per unit of output (similarly for Y ):
cx
p
K
= cx
p
K
3. Consumers demand for X per unit of utility (similarly for Y ):
e
p
x
= e
px
Now we are in a position to specify general equilibrium as the solution to a square system of 9 weak
inequalities in 9 unknowns. General-equilibrium formulated as the following square system:
17
(1) Non-positive prots for X cx(p
L
, p
K
) p
x
(2) Non-positive prots for Y cy(p
L
, p
K
) p
y
(3) Non-positive prots for W e(p
x
, p
y
) p
w
(4) Supply - Demand for X X e
px
(p
x
, p
y
)W
(5) Supply - Demand for Y Y e
py
(p
x
, p
y
)W
(6) Supply - Demand for W W I/p
w
(7) Supply - Demand for L L

cx
pL
X +cy
pL
Y
(8) Supply - Demand for K K

cx
pK
X +cy
pK
Y
(9) Income balance I = p
L
L

+p
K
K

These weak inequalities can be solved for the nine unknowns


Note that these inequalities are of three types, and this is generally true of a very large class of
general-equilibrium models. These three types are:
(1) Zero-prot conditions, inequalities (1)-(3) in the above example.
(2) Market clearing conditions, inequalities (4)-(8) in the above example
(3) Income balance, equation (9) in the above example.
Formulating the equilibrium model as a complementarity problem requires that each inequality is
associated with a particular variable. A good way to intuit the correct association is to think about
the economics of what must be true if a particular weak inequality holds as a strict inequality.
If a zero prot conditions holds as a strict inequality in equilibrium, prots for that activity are
negative, so that good will not be produced (strictly speaking that activity will not used; one
good could be produced with several alternative activities). Thus the complementary variable to a
zero-prot condition is a quantity, the activity level. If a market-clearing condition is nonbinding
(equilibrium supply exceeds demand for that good or factor), then its price must be zero. Thus
the complementary variable to a market clearing equation is the price of that good or factor. The
complementary variable to an income balance equation is just the income of that agent. The correct
association of inequalities and unknowns in the square system is thus:
18
Inequality Complementary Variable
(1) Non-positive prots for X X 0
(2) Non-positive prots for Y Y 0
(3) Non-positive prots for W W 0
(4) Supply - Demand for X p
x
0
(5) Supply - Demand for Y p
y
0
(6) Supply - Demand for W p
w
0
(7) Supply - Demand for L p
L
0
(8) Supply - Demand for K p
K
0
(9) Income balance I
Now lets turn to the issue of starting with a micro-consistent data set, a set of numbers which are
in fact consistent with the above problem formulation. That is, lets start with a set of numbers
that satisfy zero prots, market clearing, and income balance.
The above problems can be thought of as consisting of three production activities, X, Y , and W,
and four markets, X, Y , L, and K.
In what follows, we will represent the initial data for this economy by a rectangular matrix. This
matrix is related to the concept of a SAM - social accounting matrix, which is discussed later.
But the term SAM has been used in rather dierent sense, so we will just refer to our rectangular
matrix as a MCM - micro-consistency matrix.
In the present example, there are two types of columns in the rectangular MCM, corresponding to
production sectors and consumers. In the model outlined above, there are three production sectors
(X, Y and W) and a single consumer (CONS). In the present example, rows correspond to markets.
Complementary variables are prices, so we have listed the price variables on the left to designation
rows.
In the MCM, there are both positive and negative entries. A positive entry signies a receipt (sale)
in a particular market. A negative entry signies an expenditure (purchase) in a particular market.
Reading down a production column, we then observe a complete list of the transactions associated
with that activity. Here is our matrix of initial values.
Production Sectors Consumers
Markets | X Y W | CONS Row sums
--------------------------------------------------------------------
PX | 100 -100 | 0
PY | 100 -100 | 0
PW | 200 | -200 0
PL | -25 -75 | 100 0
PK | -75 -25 | 100 0
--------------------------------------------------------------------
Column Sum 0 0 0 0
19
A rectangular MCM is balanced or micro-consistent when row and column sums are zeros.
Positive numbers represent the value of commodity ows into the economy (sales or factor supplies),
while negative numbers represent the value of commodity ows out of the economy (factor demands
or nal demands).
With this interpretation, a row sum is zero if the total amount of commodity owing into the economy
equals the total amount of commodity owing out of the economy. This is market clearance, and
one such condition applies for each commodity in the model.
Columns in this matrix correspond to production sectors or consumers. A production sector column
sum is zero if the value of outputs equals the cost of inputs. A consumer column is balanced if the
sum of primary factor sales equals the value of nal demands. Zero column sums thus indicate zero
prots or product exhaustion in an alternative terminology.
Finally, we emphasize that the numbers of the matrix are values, prices times quantities. The
modeler is free as to how to interpret these as prices versus quantities. A good practice is to choose
units so that as many things are equal to one initially as possible. Prices can be chosen as one, and
representative quantities for activities can be chosen such that activity levels are also equal to one
(e.g., activity X run at level one produces 100 units of good X). In the case, of taxes, both consumer
and producer prices cannot equal one of course, a point we will return to in a later section.
Now we are in a position to adopt functional forms and write an actual GAMS program to solve
this model. But rst, lets explore the issue of starting with a micro-consistent data set.
First, we specify this general-equilibrium model as an MCP, writing out all the functions. We use
very simple Cobb-Douglas functions for the three activities. The share parameters for the functions
are given in the data matrix above. Goods in the utility function get equal shares of 0.5. X is capital
intensive with capital having a share of 0.75 and labor a share of 0.25. Y is labor intensive with the
opposite ordering of shares.
While we will not go into detail about GAMS syntax here, a few nal points, with respect to the
actual program which follows.
1. The opening line $TITLE is not necessary, but it is used to label the listing (output) le.
2. $ONTEXT.....$OFFTEXT is a way of designating a block of comments, a set of lines which are
ignored by GAMS. In this case, we put our data matrix inside this block, meaning it is not
actually used in the computation.
3. A line of text to be inserted as a comment can also be preceded by a * in the rst column.
4. Then we declare the parameter names, then assign them values (note where semi-colons do
and do not go).
5. Next we declare positive variables and then equation names. Then we write out the equation
names in the syntax shown (equation name..) then the equation itself ending with a semi-
colon. Note the use of the reference quantities such as 100, 75 etc. in the equations. This
will ensure that the activity levels will be X = Y = W = 1 in the initial solution to the model.
6. Note that GAMS was written to use greater-than-or-equal-to syntax (=G=). Also note that
where possible we have avoided having variables in denominators, since if a variable (even
temporarily during the execution of the algorithm) has a value of zero, this causes a divided
by zero problem and may crash the solver.
20
7. Then the model name and specication, and we chose a numeraire (recall from theory that
only relative prices are determined. Here we chose utility as the numeraire, so that factor
prices are then real values in terms of utility. The notation is PW.FX, in which .FX is an
abbreviation for xed.
8. Before the solve statement, we are going to help the solver by giving starting values for the
variables. The syntax is, for example X.L, where the .L stands for level. Default values
are zero, and in non-linear problems it is very helpful and indeed sometime necessary to help
the solver with some initial guesses. I constructed this problem knowing the answer, so I give
those values as .L values.
9. Finally, the solve statement.
Now we are ready to go. After the rst solve statement, we do two counterfactual experiments. The
rst sets a tax of 0.50 on the inputs to X production. Then we have a second solve statement. Then
we remove the tax, and double the labor endowment of the economy.
TX is a parameter which sets the tax, and LENDOW is a multiplier on the initial labor endowment.
1
2 $TITLE Model M1_MCP: Closed 2x2 Economy - An Introduction to the Basics
3
4 $ONTEXT
5
6 This is the exact same model as M1_MPS.GMS but uses the MCP format.
7
8 Production Sectors Consumers
9 Markets | X Y W | CONS
10 ------------------------------------------------------
11 PX | 100 -100 |
12 PY | 100 -100 |
13 PW | 200 | -200
14 PL | -25 -75 | 100
15 PK | -75 -25 | 100
16 ------------------------------------------------------
17
18 $OFFTEXT
19
20 PARAMETERS
21 TX Ad-valorem tax rate for X sector inputs /0/;
22 LENDOW Labor endowment multiplier /1/;
23
24 POSITIVE VARIABLES
25 X Activity level for sector X
26 Y Activity level for sector Y
27 W Activity level for sector W
28 PX Relative price of X
29 PY Relative price of Y
30 PW Relative price of W (unit expenditure function)
31 PL Wage rate
32 PK Rental rate
33 CONS Consumer income level;
34
35 EQUATIONS
36 PRF_X Zero profit for sector X
37 PRF_Y Zero profit for sector Y
38 PRF_W Zero profit for sector W (Hicksian welfare index)
39
40 MKT_X Supply-demand balance for commodity X
41 MKT_Y Supply-demand balance for commodity Y
21
42 MKT_L Supply-demand balance for primary factor L
43 MKT_K Supply-demand balance for primary factor L
44 MKT_W Supply-demand balance for aggregate demand
45
46 I_CONS Income definition for CONS;
47
48
49 * Zero profit inequalities
50
51 PRF_X.. 100 * PL**0.25 * PK**0.75 * (1+TX) =G= 100*PX;
52
53 PRF_Y.. 100 * PL**0.75* PK**0.25 =G= 100*PY;
54
55 PRF_W.. 200 * PX**0.5 * PY**0.5 =G= 200*PW;
56
57 * Market clearance inequalities
58
59 MKT_X.. 100 * X =G= 100 * W * PX**0.5 * PY**0.5 / PX;
60
61 MKT_Y.. 100 * Y =G= 100 * W * PX**0.5 * PY**0.5 / PY;
62
63 MKT_W.. 200 * W =E= CONS / PW;
64
65 MKT_L.. 100 * LENDOW =G= 25 * X * PL**0.25 * PK**0.75 / PL +
66 75 * Y * PL**0.75 * PK**0.25 / PL;
67
68 MKT_K.. 100 =G= 75 * X * PL**0.25 * PK**0.75 / PK +
69 25 * Y * PL**0.75 * PK**0.25 / PK;
70
71 * Income balance equations
72
73 I_CONS.. CONS =E= 100*LENDOW*PL + TX*100*X*PL**0.25*PK**0.75;
74
75 MODEL ALGEBRAIC /PRF_X.X, PRF_Y.Y, PRF_W.W, MKT_X.PX, MKT_Y.PY, MKT_L.PL
76 MKT_K.PK, MKT_W.PW, I_CONS.CONS /;
77
78
79 * Chose a numeraire (not necessary)
80
81 PW.FX = 1;
82
83 * Set initial values of variables:
84
85 X.L=1; Y.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PL.L=1;
86 CONS.L=200;
87
88 SOLVE ALGEBRAIC USING MCP;
89
90
91 * Solve the counterfactuals:
92
93 TX = 0.5;
94 LENDOW = 1;
95 SOLVE ALGEBRAIC USING MCP;
96
97 TX = 0;
98 LENDOW = 2;
99 SOLVE ALGEBRAIC USING MCP;
100
This le is saved in the relevant directorty as m1 mcp.gms, although you can use any name you want,
it doesnt have to correspond to the model name.
22
At the DOS prompt type gams m1 mcp. This runs the model.
The output or listing le will automatically be written to the same directory, with name m1 mcp.lst.
In the listing le, we will see the following information, along with a statement that the solution
is normal and optimal. We will not go into a long explanation here, but rather just focus on the
solution values. The list of 1.000 indicates we successfully reproduced our benchmark data as an
equilibrium, since we chose units such that this would be the case.
LOWER LEVEL UPPER MARGINAL
---- EQU PRF_X . . +INF 1.000
---- EQU PRF_Y . . +INF 1.000
---- EQU PRF_W . . +INF 1.000
---- EQU MKT_X . . +INF 1.000
---- EQU MKT_Y . . +INF 1.000
---- EQU MKT_L -100.000 -100.000 +INF 1.000
---- EQU MKT_K -100.000 -100.000 +INF 1.000
---- EQU MKT_W . . . 1.000
---- EQU I_CONS . . . 200.000
PRF_X Zero profit for sector X
PRF_Y Zero profit for sector Y
PRF_W Zero profit for sector W (Hicksian welfare index)
MKT_X Supply-demand balance for commodity X
MKT_Y Supply-demand balance for commodity Y
MKT_L Supply-demand balance for primary factor L
MKT_K Supply-demand balance for primary factor L
MKT_W Supply-demand balance for aggregate demand
I_CONS Income definition for CONS
LOWER LEVEL UPPER MARGINAL
---- VAR X . 1.000 +INF .
---- VAR Y . 1.000 +INF .
---- VAR W . 1.000 +INF .
---- VAR PX . 1.000 +INF .
---- VAR PY . 1.000 +INF .
---- VAR PW 1.000 1.000 1.000 EPS
---- VAR PL . 1.000 +INF .
---- VAR PK . 1.000 +INF .
---- VAR CONS . 200.000 +INF .
Now lets look at the results for our rst counterfactual, in which we place a 50% tax on the inputs
to X production.
************** counterfactual: tax on X inputs
LOWER LEVEL UPPER MARGINAL
---- VAR X . 0.845 +INF .
---- VAR Y . 1.147 +INF .
---- VAR W . 0.985 +INF .
---- VAR PX . 1.165 +INF .
---- VAR PY . 0.859 +INF .
---- VAR PW 1.000 1.000 1.000 -16.412
---- VAR PL . 0.903 +INF .
---- VAR PK . 0.739 +INF .
23
---- VAR CONS . 213.359 +INF .
We see that X production decreases, Y production increases, and welfare falls due to the distor-
tionary nature of the tax, even though the tax revenue is redistributed back to the consumer. There
is also a redistribution of income between factors. The relative price of capital, the factor used
intensively in X falls, and the relative price of labor rises as resources are shifted to Y production.
In the second counterfactual, we remove the tax, and double the labor endowment of the economy.
***************counterfactual: double labor endowment (zero tax)
LOWER LEVEL UPPER MARGINAL
---- VAR X . 1.189 +INF .
---- VAR Y . 1.682 +INF .
---- VAR W . 1.414 +INF .
---- VAR PX . 1.189 +INF .
---- VAR PY . 0.841 +INF .
---- VAR PW 1.000 1.000 1.000 6.617E-11
---- VAR PL . 0.707 +INF .
---- VAR PK . 1.414 +INF .
---- VAR CONS . 282.843 +INF .
Here we see a relative shift to Y , the good using labor intensively, although X production also rises.
The price of X rises relative to Y . The real price of capital, now the scarce factor, rises, and the real
price of labor falls. Although labor has a 50% income share initially, doubling labor supply increases
welfare by less than 50% (it increases W by 41.4%) due to diminishing returns from the presence of
the xed factor capital.
3.2.3 The MPSGE subsystem of GAMS
GAMS now include a higher level language, written by Rutherford, called MPSGE which stands
for mathematical programming system for general equilibrium. MPSGE uses the MCP solver in
GAMS. This higher-level language permits extremely ecient shortcuts for modelers, allowing us to
concentrate on economics rather than coding.
There are several great features of MPSGE. First, the program has routines for calibrating and
writing all constant-returns CES and CET functions, up to three levels of nesting. All the modeler
has to do is to specic the nesting structure, the elasticity of substitutions in each nest and a
representative point on the function, consisting of output quantities, input quantities and prices.
This one such point and price vector uniquely determines the function, and MPSGE then generates
the cost function (or expenditure function). This is not that time and error saving in the simple
simulation models of this book, but it is a wonderful feature for larger models.
Second, and closely related, the form of the data required to specify a CES/CET function is exactly
the data modelers have, so there is a swift and easy move from an accounting matrix as described
in the previous appendix to the calibration of the model.
Third, a lot of market-clearing and income-balance equations are written automatically by MPSGE
so the modeler doesnt have to worry about doing so. Fourth and closely related, a lot of errors
that can occur when a modeler writes out his or her equations cannot occur in MPSGE. If there is
24
a tax or markup, for example, the revenues must be assigned to some agent and will be allocated
automatically to that agent by the income-balance properties of the coding. I once refereed a paper
in which the author claimed to have some weird numerical result. It turned out that the modeler
had a tax, but forgot to put the tax revenue in the representative agents income balance equation.
That cannot happen in MPSGE. In short, MPSGE automatically checks for and ensures many of
the product-exhaustion and income-balance requirements discussed in the previous section.
In this appendix, I am going to give a short and unfortunately supercial introduction to the MPSGE
subroutine of GAMS. I am going to use exactly the same problem as in the previous appendix, so
that you can see the connection. First, a few keywords.
SECTOR (ACTIVITY) Production activities that convert commodity inputs into commodity
outputs. The variable associated with a sector is the activity level.
COMMODITY (MARKETS) A good or factor. The variable associated with a commodity is
its price, not its quantity.
CONSUMERS Individuals who supply factors and receive tax revenues, markups, and pay sub-
sidies. In imperfectly competitive models, rm owners can be designated as consumers. A
government that receives tax revenue and buys public goods is also designated as a consumer.
The variable associated with a consumer is income from all sources.
AUXILIARY Additional variables, such as markup formulae or taxes with endogenous values
which are functions of other variables such as prices and quantities. Please note the spelling
of auxiliary: mistakes cause MPSGE to crash, and you wont know why.
CONSTRAINT An equation that is typically used to set the value of an auxiliary variable. In
these appendix programs, constraint equations will be used to set the values of markups, which
are auxiliary variables.
Here is what an MPSGE program, embedded in a GAMS le, looks like, where the model name is .
1
2 GAMS statements such as declaring sets, parameters, parameter values, etc.
3
4 **** now control is passed to the MPSGE subsystem
5
6 $ONTEXT [this tells the GAMS compiler to ignore what follows, but the MPSGE
7 compiler will recognize the model statement that follows and will
8 begin to pay attention]
9
10 $MODEL:modelname
11
12 Declaration of sectors, commodities, consumers, auxiliary variables
13
14 Production Blocks
15
16 Demand Blocks
17
18 Constraint equations
19
20 $OFFTEXT [control is passed back to GAMS]
21
22 $SYSINCLUDE MPSGESET modelname
23
24 GAMS statements such at setting starting values of variables,
25
25 other parameter values, etc.
26
27 $INCLUDE MODELNAME.GEN
28 SOLVE modelname USING MCP;
29
30 GAMS statements processing output
31
Below, we formulate exactly the same problem introduced above using MPSGE. We present M1 MCP.GMS
le and then discuss its details.
1 $TITLE Model M1_MPS: Closed 2x2 Economy - An Introduction to the Basics
2
3 $ONTEXT
4
5 This is the exact same model as M1_MCP.GMS but uses the MPSGE format.
6
7
8 Production Sectors Consumers
9 Markets | X Y W | CONS
10 ------------------------------------------------------
11 PX | 100 -100 |
12 PY | 100 -100 |
13 PW | 200 | -200
14 PL | -25 -75 | 100
15 PK | -75 -25 | 100
16 ------------------------------------------------------
17
18 $OFFTEXT
19
20
21 PARAMETERS
22 TX Ad-valorem tax rate for X sector inputs
23 LENDOW Labor endowment multiplier;
24
25 TX = 0;
26 LENDOW = 1;
27
28 $ONTEXT
29
30 $MODEL:M1_MPS
31
32 $SECTORS:
33 X ! Activity level for sector X
34 Y ! Activity level for sector Y
35 W ! Activity level for sector W (Hicksian welfare index)
36
37 $COMMODITIES:
38 PX ! Price index for commodity X
39 PY ! Price index for commodity Y
40 PL ! Price index for primary factor L
41 PK ! Price index for primary factor K
42 PW ! Price index for welfare (expenditure function)
43
44 $CONSUMERS:
45 CONS ! Income level for consumer CONS
46
47 $PROD:X s:1
48 O:PX Q:100
49 I:PL Q:25 A:CONS T:TX
50 I:PK Q:75 A:CONS T:TX
51
26
52 $PROD:Y s:1
53 O:PY Q:100
54 I:PL Q:75
55 I:PK Q:25
56
57 $PROD:W s:1
58 O:PW Q:200
59 I:PX Q:100
60 I:PY Q:100
61
62 $DEMAND:CONS
63 D:PW Q:200
64 E:PL Q:(100*LENDOW)
65 E:PK Q:100
66
67 $OFFTEXT
68
69 $SYSINCLUDE mpsgeset M1_MPS
70
71 PW.FX = 1;
72
73 $INCLUDE M1_MPS.GEN
74 SOLVE M1_MPS USING MCP;
75
76
77 * Solve the counterfactuals
78
79 TX = 0.5;
80 LENDOW = 1;
81
82 $INCLUDE M1_MPS.GEN
83 SOLVE M1_MPS USING MCP;
84
85 TX = 0;
86 LENDOW = 2;
87
88 $INCLUDE M1_MPS.GEN
89 SOLVE M1_MPS USING MCP;
90
Now some more details:
(1) Production blocks
The terminology here is a big confusing, since MPSGE takes the information in a production block
and generates a cost function, not a production function. But the variable complementary with a
production block (cost function) is an activity level. Lets take an example from the above program,
adding the price eld (discussed shortly).
$PROD:Y s:1
O:PY Q:100 P:1
I:PL Q: 75 P:1
I:PK Q: 25 P:1
First line: Name of activity (Y), values of substitution (here s:1) and transformation elasticities if
there were several outputs. Default elasticity of substitution is 0 (not 1!).
First column: Names of commodity outputs (O:) and inputs (I:).
27
Second column: Reference commodity quantities (Q:) - used for calibration. Default = 1 if none
specied.
Third column: Reference commodity prices (P:) - used for calibration. Default = 1 if none specied,
which is why they are omitted in the program above.
MPSGE then takes this information to construct a cost function and, as a feature of CES functions,
it is globally dened by a single reference point. Think of putting an isoquant labeled 100 units of
output, with elasticity of substitution 1, though input points L = 70, K = 30, with slope PL/PK =
1. That is what MPSGE does for you. In this simple case, it constructs the cost function:
100*(PL**.75)*(PK**.25) =G= 100*PY;
The saving from using MPSGE might not seem like a big deal, but believe me with many inputs,
dierent prices for all inputs, and an elasticity of substitution of 3.5, it is a huge saving indeed.
One example of the treatment of taxes (others will follow later, including those with endogenous
rates) is in the production block for X.
$PROD:X s:1
O:PX Q:100
I:PL Q:25 A:CONS T:TX
I:PK Q:75 A:CONS T:TX
The A: eldassigns the revenue from tax TX to an agent. In this case, the agent who receives the
revenue is CONS. Read it as the statement assign to agent CONS the revenue from tax rate TX on
inputs L and K.
A utility function is also represented by a production block; that is, utility is a good which is
produced from commodity inputs (including possibly factor inputs such as leisure). Here is the
utility function W: in which the utility good (PW) is produced from inputs of X and Y . MPSGE
constructs the underlying expenditure (cost) function:
$PROD:W s\gtt{:1}
O:PW Q:200
I:PX Q:100
I:PY Q:100
A consumers income constraint is also represented by a block in this case called a demand block.
In what follows, the consumer demands the utility good PW (the D eld), and receives income
from endowments (the E elds) of labor and capital.
MPSGE automatically handles tax revenue or subsidy payments in the background, adding or sub-
tracting them to the consumers endowment income.
$DEMAND:CONS
D:PW Q:200
E:PL Q:(100*LENDOW)
E:PK Q:100
28
MPSGE also automatically looks after the market clearing conditions without the modeler having
to worry about specifying these additional equations.
Example of how the Q and P elds are used to construct the underlying cost function.
All constant returns CES and CET functions can be completely characterized by a single point
consisting of (1) input quantities (2) output quantities (3) input and output prices, and (4) the
elasticity of substitution or transformation (there may be several levels of substitution elasticities.
MPSGE constructs the underlying cost function from such a single observation. It is particularly
important to specify the reference prices correctly. Consider the two production blocks:
$PROD: X s:1
O:PX Q:100
I:PL Q: 25 P:1
I:PK Q: 75 P:1
$PROD: X s:1
O:PX Q:100
I:PL Q: 25 P:2
I:PK Q: 75 P:0.667
These are both Cobb-Douglas production functions that can produce 100 X from inputs of 25 labor
and 75 capital, and in each case the value of the inputs equals the value of the output. But the
isoquant has a dierent slope through that input combination in the two cases: the marginal rate
of substitution in the rst case is one, but 3 in the second case. Thus these are not the same
technologies.
Later, with various taxes, it is important to divide values into price and quantity components when
all prices cannot be normalized to one. Consider the following two production blocks.
$PROD: X s:1
O:PX Q:100 P:1
I:PL Q: 25 P:1
I:PK Q: 75 P:1
$PROD: X s:1
O:PX Q:100 P:1
I:PL Q: 50 P:0.5
I:PK Q: 75 P:1
In both cases, the values of inputs and output are the same, and would appear the same in the data
matrix. But these are not the same functions, the rst being a clearly more ecient technology
than the second. While both will have the same share parameters on L and K (0.25 and 0.75
respectively), the rst technology will have a higher multiplicative eciency parameter scaling up
the output from given inputs (or scaling down the cost of output at given factor prices). MPSGE
will automatically calculate this scaling parameter.
More will be said about this when we get to an example with taxes in the benchmark data shortly.
29
Vector syntax for GAMS and MPSGE
GAMS has some features that streamline the formulation of the computer code, features that are
immensely useful in large dimension problems in particular. We cannot go through all the features
of GAMS syntax here, students must rely on the GAMS manual itself. But we can show you what
these features are and how they are used.
First, actual numbers need not appear in MCP program equations or in a MPSGE production and
demand blocks.. These can be specied outside somewhere else in the program or indeed read from
external les.
Second, set notation can be used when convenient, as in cases where there are many goods, factors,
countries or consumers. Combining these two features, data can be specied in an array or table,
and read into the computation program in a straight forward way.
In what follows, we rewrite our basic model from above using these features. We present rst the
MPSGE version and then the MCP version for completeness.
The program begins with the GAMS keyword TABLE. Now our micro-consistency matrix is actually
going to be used directly in the program to load the values of variables and parameters. Then we
use the GAMS keyword SET. We use two sets here, the set of goods (X, Y) and the set of factors
(L, K). ALIAS is a GAMS keyword that allows two dierent designators for a given set.
We then declare parameters, and after that parameter assignments are used to extract the data from
the TABLE. Following these assignments of data to parameters, we use a DISPLAY statement,
which will write out the values of the parameters in the listing le, so we can do a quick check
that the assignments are correct. Again, you should consult the GAMS manual for a much more
complete description of these operations and denitions (for example the use of when referring
to a specic element of a table or set; e.g., BENCH(I,"W")).
The MPSGE block follows. Note the absence of any numbers. Consider the production block:
$PROD:Z(I) s:1
O:PC(I) Q:Z0(I)
I:PF(F) Q:FD0(F,I) A:CONS T:T(I)
Two production (cost) functions for two goods using two factors with dierent factor intensities and
dierent tax rates across sectors are specied in this extremely parsimonious way.
Following the MPSGE version, we present the MCP version of the basic model. The share parameters
for the Cobb-Douglas functions are calculated from the data (ALPHA, BETA). Note also the use of
GAMS key words SUM (sum of) and PROD (production of).
Note also the use of the alternative set designators, in CMKET(I), for example. If we have an
equation for market I = X, for example, GAMS does not permit us to sum over all values of I on
the right-hand side. But we can sum over the alias J, which is what we do.
In the counterfactuals, note again the use of quotation marks to designate a particular member of a
set.
1 $TITLE Model M1_VEC: Closed 2x2 Economy - An Introduction to the Basics
30
2
3 *This is the exact same model as M1_MPS.GMS but uses vector syntax.
4
5 TABLE BENCH(*,*) Benchmark financial flows (e.g. an input-output table)
6
7 X Y W CONS
8 X 100 -100
9 Y 100 -100
10 W 200 -200
11 L -40 -60 100
12 K -60 -40 100;
13
14
15 SET I Produced goods /X, Y/,
16 F Factors of production /L, K/;
17
18
19 ALIAS (I,J), (F,FF);
20
21 PARAMETER
22
23 Z0(I) Benchmark sectoral output,
24 FD0(F,I) Benchmark factor demands,
25 C0(I) Benchmark consumption demand,
26 E(F) Factor endowments,
27 T(I) Sectoral ad-valorem tax rate,
28 W0 Benchmark total consumption;
29
30 * Extract data from the original format into model-specific arrays:
31
32 Z0(I) = BENCH(I,I);
33 FD0(F,I) = -BENCH(F,I);
34 C0(I) = -BENCH(I,"W");
35 W0 = SUM(I, C0(I));
36 E(F) = BENCH(F,"CONS");
37 T(I) = 0;
38
39 DISPLAY Z0, FD0, C0, E, T;
40
41
42 $ONTEXT
43
44 $MODEL:M1_VEC
45
46 $SECTORS:
47 Z(I) ! Commodity production index
48 W ! Welfare index
49
50 $COMMODITIES:
51 PW ! Utility price index
52 PC(I) ! Commodity price index
53 PF(F) ! Factor price index
54
55 $CONSUMERS:
56 CONS ! Representative consumer
57
58 $PROD:Z(I) s:1
59 O:PC(I) Q:Z0(I)
60 I:PF(F) Q:FD0(F,I) A:CONS T:T(I)
61
62 $PROD:W s:1
63 O:PW Q:W0
64 I:PC(I) Q:C0(I)
65
31
66 $DEMAND:CONS
67 D:PW Q:W0
68 E:PF(F) Q:E(F)
69
70 $OFFTEXT
71 $SYSINCLUDE mpsgeset M1_VEC
72
73 PW.FX = 1;
74
75 $INCLUDE M1_VEC.GEN
76 SOLVE M1_VEC USING MCP;
77
78
79 * Solve the counterfactuals:
80
81 T("X") = 0.5;
82
83 $INCLUDE M1_VEC.GEN
84 SOLVE M1_VEC USING MCP;
85
86 E("L") = 2 * E("L");
87 T(I) = 0;
88
89 $INCLUDE M1_VEC.GEN
90 SOLVE M1_VEC USING MCP;
91
92 * Present the MCP version for the sake of completeness:
93
94
95 PARAMETER ALPHA(F,I) Factor input benchmark value share
96 BETA(I) Consumption value share;
97
98 ALPHA(F,I) = FD0(F,I) / SUM(FF, FD0(FF,I));
99 BETA(I) = C0(I) / W0;
100
101 EQUATIONS
102 PROFIT(I) Zero profit condition
103 CMKT(I) Commodity market clearance
104 FMKT(F) Factor market clearance
105 PRF_W Zero profit for aggregate consumption
106 MKT_W Market clearance for aggregate consumption
107 I_CONS Income = factor earnings plus taxes;
108
109 PROFIT(I).. (1+T(I)) * PROD(F, PF(F)**ALPHA(F,I)) =E= PC(I);
110
111 PRF_W.. PROD(I, PC(I)**BETA(I)) =E= PW;
112
113 CMKT(I).. Z0(I) * Z(I) =E= C0(I) * W * PROD(J, PC(J)**BETA(J)) / PC(I);
114
115 MKT_W.. W0 * W =E= CONS / PW;
116
117 FMKT(F).. E(F) =E= SUM(I, FD0(F,I) * Z(I)
118 * PROD(FF, PF(FF)**ALPHA(FF,I))) / PF(F);
119
120 I_CONS.. CONS =E= SUM(F, PF(F) * E(F)) + SUM(I, T(I) * Z0(I) *
121 Z(I) * PROD(F, PF(F)**ALPHA(F,I)) );
122
123 MODEL ALGEBRAIC /PROFIT.Z, PRF_W.W, CMKT.PC, FMKT.PF, MKT_W.PW, I_CONS.CONS/;
124
125 E("L") = 100;
126 T(I) = 0;
127
128 SOLVE ALGEBRAIC USING MCP;
32
129
130 E("L") = 100;
131 T("X") = 0.5;
132
133 SOLVE ALGEBRAIC USING MCP;
134
135 E("L") = 2*E("L");
136 T(I) = 0;
137
138 SOLVE ALGEBRAIC USING MCP;
3.3 Extensions of the Simple Model
In this section, we will introduce additional features that are commonly encountered and used in
applied situations. Each feature is introduced one at a time to the basic two-good closed-economy
model of the previous section. Obviously, models of real economies will require the modeler to use
many of these features simultaneously, but considering them one by one may be a quicker avenue to
understanding each building block than attempting to understand complex, multi-sector models all
at one go.
All the models in this section are two-good, closed-economy models. To make each feature as
transparent as possible, no taxes are present in the benchmark data. Taxes in the initial benchmark
data and how to model those are introduced in chapter 3. Here are the model numbers, with a short
description of the features added. M2x denotes Chapter 2, model number x.
We will not go through the rst model again, but simple include it for completeness in this chapter
under a name consistent with the full set of models. You could use it to try some experiments.
Exercises:
1. Try deliberately introducing errors into the specication (such as changing the quantity elds,
or adding price elds not equal to 1) and see that the benchmark data is not replicated as a
solution.
2. Suppose that we want to interpret the value of X sector output as 50 units at a price of px =
2. Rewrite the MPSGE le accordingly.
3. Using a standard micro text which covers CES functions, try to verify that the cost functions
and the factor demand equations (using Shepards lemma) are correct.
3.3.1 Intermediate Inputs and Nesting (M22)
We begin with model M22, which introduces intermediate goods, and a simple CES nesting notation
that permits the modeler to specify dierent elasticities of substitution between dierent groups of
inputs.
This model is shown below. X and Y sectors each use the other sectors output as an input, so that
each sector has three inputs. With three inputs, there may be dierent elasticities of substitution
between dierent pairs of these inputs. Consider the production block for the Y sector.
$PROD:Y s:0.75 va:1
O:PY Q:120
33
I:PX Q: 20
I:PL Q: 60 va:
I:PK Q: 40 va:
This production function can be portrayed graphically using a nesting diagram:
O:PY Q:120

@
@
@
@
@
@
@
@
@
@
@

s:0.75
I:PX Q:20

I:PL Q:60 I:PK Q:40


va:1
This species a two-level nesting structure. Labor and capital are combined in the second-level nest
with an elasticity of substitution of 1 (va:1). We use the identier VA to denote value added
although it could have been any other name with 4 or few characters. The important thing is the
syntax used to specify the structure. Think of the inputs denoted with VA as combined to produce
a composite input, in this case termed value added. The top level of the CES function species
an elasticity of substitution of 0.75 (s:0.75) between the intermediate input, in this case X, and
the value-added composite of capital and labor. In some models this is specied as equal to zero,
indicating that a xed amount of the intermediate input is required for each unit of output. A
similar structure is specied for the X sector, and in addition we all for taxes on X sector inputs.
Following the MPSGE version of the model, we present the code for the MCP version with all
equations written out. This is done for two purposes. First, it again helps you to understand
exactly what MPSGE is doing with the simple the specication that you have given to it. Second, it
should help convince you of the advantages of MPSGE. Finding and correctly specifying the correct
CES functions for the X and Y sectors is not an easy manner. But you are not nished there. You
also have to correctly apply Shepards lemma to nd factor demands for use in the factor-market-
clearing equations. While it is very important to understand exactly what MPSGE is doing in the
background, we hope this will also convince you to let this higher-level software do the dirty work.
1 $TITLE Model M22: Closed Economy 2X2 with Intermediate Inputs and Nesting
2
3 $ONTEXT
4
5 Production Sectors Consumers
6 Markets | X Y W | CONS
7 ------------------------------------------------------
8 PX | 120 -20 -100 |
9 PY | -20 120 -100 |
10 PW | 200 | -200
11 PL | -40 -60 | 100
12 PK | -60 -40 | 100
34
13 ------------------------------------------------------
14
15 $OFFTEXT
16
17 PARAMETERS
18 TX;
19
20 TX = 0;
21
22 $ONTEXT
23 $MODEL: M22
24
25 $SECTORS:
26 X ! Activity level for sector X
27 Y ! Activity level for sector Y
28 W ! Activity level for sector W (Hicksian welfare index)
29
30 $COMMODITIES:
31 PX ! Price index for commodity X
32 PY ! Price index for commodity Y
33 PL ! Price index for primary factor L
34 PK ! Price index for primary factor K
35 PW ! Price index for welfare (expenditure function)
36
37 $CONSUMERS:
38 CONS ! Income level for consumer CONS
39
40 $PROD:X s:0.5 va:1
41 O:PX Q:120
42 I:PY Q: 20
43 I:PL Q: 40 va: A:CONS T:TX
44 I:PK Q: 60 va: A:CONS T:TX
45
46 $PROD:Y s:0.75 va:1
47 O:PY Q:120
48 I:PX Q: 20
49 I:PL Q: 60 va:
50 I:PK Q: 40 va:
51
52 $PROD:W s:1
53 O:PW Q:200
54 I:PX Q:100
55 I:PY Q:100
56
57 $DEMAND:CONS
58 D:PW Q:200
59 E:PL Q:100
60 E:PK Q:100
61
62 $OFFTEXT
63 $SYSINCLUDE mpsgeset M22
64
65 PW.FX = 1;
66
67 $INCLUDE M22.GEN
68 SOLVE M22 USING MCP;
69
70 * Counterfactual: 100% tax on X sector inputs:
71
72 TX = 1.0;
73 $INCLUDE M22.GEN
74 SOLVE M22 USING MCP;
75
76
35
77 * Algebraic representation -- note the complexity of two-level
78 * CES functions which are automatically generated within MPSGE.
79
80
81 EQUATIONS
82 PRF_X Zero profit for sector X
83 PRF_Y Zero profit for sector Y
84 PRF_W Zero profit for sector W (Hicksian welfare index)
85
86 MKT_X Supply-demand balance for commodity X
87 MKT_Y Supply-demand balance for commodity Y
88 MKT_L Supply-demand balance for primary factor L
89 MKT_K Supply-demand balance for primary factor L
90 MKT_W Supply-demand balance for aggregate demand
91
92 I_CONS Income definition for CONS;
93
94 PRF_X.. 120 * ( 1/6 * PY**(1-0.5) + 5/6 * (PL**0.4 * PK**0.6 *
95 (1+TX))**(1-0.5))**(1/(1-0.5)) =E= 120 * PX;
96
97 PRF_Y.. 120 * ( 1/6 * PX**(1-0.75) + 5/6 * (PL**0.6 * PK**0.4)**
98 (1-0.75) )**(1/(1-0.75)) =E= 120 * PY;
99
100 PRF_W.. 200 * PX**0.5 * PY**0.5 =E= 200 * PW;
101
102 MKT_X.. 120 * X =E= 100 * W * PX**0.5 * PY**0.5 / PX +
103 20*Y*(PY/PX)**0.75;
104
105 MKT_Y.. 120 * Y =E= 100 * W * PX**0.5 * PY**0.5 / PY +
106 20*X*(PX/PY)**0.5;
107
108 MKT_W.. 200 * W =E= CONS / PW;
109
110 MKT_L.. 100 =E= 40 * X * (PX/((1+TX)*PL**0.4*PK**0.6))**0.5
111 * PL**0.4 * PK**0.6 / PL +
112 60 * Y * (PY/(PL**0.6 * PK**0.4))**0.75
113 * PL**0.6 * PK**0.4 / PL;
114
115 MKT_K.. 100 =E= 60 * X * (PX/((1+TX)*PL**0.4*PK**0.6))**0.5
116 * PL**0.4 * PK**0.6 / PK +
117 40 * Y * (PY/(PL**0.6 * PK**0.4))**0.75
118 * PL**0.6 * PK**0.4 / PK;
119
120 I_CONS.. CONS =E= 100*PL + 100*PK + TX * 100 * X * PL**0.4*PK**0.6 *
121 (PX/((1+TX)*PL**0.4*PK**0.6))**0.5;
122
123 MODEL ALGEBRAIC /PRF_X.X, PRF_Y.Y, PRF_W.W, MKT_X.PX, MKT_Y.PY,
124 MKT_L.PL, MKT_K.PK, MKT_W.PW, I_CONS.CONS /;
125
126 * Check the benchmark:
127
128 X.L=1; Y.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PW.L=1; CONS.L=200;
129
130 TX = 0;
131 SOLVE ALGEBRAIC USING MCP;
132
133 * Solve the same counterfactual:
134
135 TX = 1;
136 SOLVE ALGEBRAIC USING MCP;
137
36
Excercises:
(1) Revise the X sector production to nest Y with K at the bottom(Cobb-Douglas) level, and then
let these inputs trade o with L at the top (CES) nest.
$PROD:X s:0.5 LY:1
O:PX Q:120
I:PY Q: 20 LY:
I:PL Q: 40 A:CONS T:TX
I:PK Q: 60 LY: A:CONS T:TX
Before running TX=1 experiment, guess as to whether this revised nesting will increase or decrease
the welfare cost of taxation. Run the experiment, and see if the results conrm or contradict your
economic intuition.
(2) Rewrite the algebraic model in accordance with the new nesting structure, and verify that you
obtain identical solution values. (This exercise is tedious but educational, with a level of diculty
roughly comparable to 500 piece jig-saw puzzle.)
3.3.2 Joint Production (M23)
This model continues the same theme, by noting that a given sector can have several output as well
as inputs. Here we assume that two sectors, A and B that both produce nal outputs X and Y, but
sector A is relatively specialized in producing good X and sector B is more specialized in producing
good Y. MPSGE allows the modeler to specify a constant elasticity of transformation (CET) between
pairs of outputs, and a nesting structure can also be used in more complicated cases. Here is the
production block for B. The transformation elasticity between the two goods is equal to 1.5 (t:1.5)
and the substitution elasticity between inputs is 1 (s:1).
$PROD:B t:1.5 s:1
O:PX Q:20
O:PY Q:80
I:PL Q:60
I:PK Q:40
Now the model itself, followed by the MCP version.
1 $TITLE Model M23: Closed Economy 2x2 with Joint Production
2
3 $ONTEXT
4
5 Production Sectors Consumers
6 Markets | A B W | CONS
7 ------------------------------------------------------
8 PX | 80 20 -100 |
9 PY | 20 80 -100 |
10 PW | 200 | -200
11 PL | -40 -60 | 100
12 PK | -60 -40 | 100
13 ------------------------------------------------------
14
15 $OFFTEXT
16
37
17 PARAMETERS
18 TA;
19
20 TA = 0;
21
22 $ONTEXT
23
24 $MODEL: M23
25
26 $SECTORS:
27 A ! Activity level for sector A (80:20 for X:Y)
28 B ! Activity level for sector B (20:80 for X:Y)
29 W ! Activity level for sector W (Hicksian welfare index)
30
31 $COMMODITIES:
32 PX ! Price index for commodity X
33 PY ! Price index for commodity Y
34 PL ! Price index for primary factor L
35 PK ! Price index for primary factor K
36 PW ! Price index for welfare (expenditure function)
37
38 $CONSUMERS:
39 CONS ! Income level for consumer CONS
40
41 $PROD:A t:2.0 s:1
42 O:PX Q:80
43 O:PY Q:20
44 I:PL Q:40 A:CONS T:TA
45 I:PK Q:60 A:CONS T:TA
46
47 $PROD:B t:1.5 s:1
48 O:PX Q:20
49 O:PY Q:80
50 I:PL Q:60
51 I:PK Q:40
52
53 $PROD:W s:1
54 O:PW Q:200
55 I:PX Q:100
56 I:PY Q:100
57
58 $DEMAND:CONS
59 D:PW Q:200
60 E:PL Q:100
61 E:PK Q:100
62
63 $OFFTEXT
64 $SYSINCLUDE mpsgeset M23
65
66 PW.FX = 1;
67
68 $INCLUDE M23.GEN
69 SOLVE M23 USING MCP;
70
71
72 * Counterfactual: 10% tax on X sector inputs:
73
74 TA = 0.10;
75 $INCLUDE M23.GEN
76 SOLVE M23 USING MCP;
77
78 * Counterfactual: 100% tax on X sector inputs:
79
80 TA = 1.00;
38
81 $INCLUDE M23.GEN
82 SOLVE M23 USING MCP;
83
84
85 * now the mcp version, which again shows you the simplifying features
86 * of MPSGE
87
88 EQUATIONS
89 PRF_A Zero profit for sector X
90 PRF_B Zero profit for sector Y
91 PRF_W Zero profit for sector W (Hicksian welfare index)
92
93 MKT_X Supply-demand balance for commodity X
94 MKT_Y Supply-demand balance for commodity Y
95 MKT_L Supply-demand balance for primary factor L
96 MKT_K Supply-demand balance for primary factor
97 MKT_W Supply-demand balance for aggregate demand
98
99 I_CONS Income definition for CONS;
100
101 * Write the profit constraints as inequalities -- the tax
102 * can cause sector A to shut down completely:
103
104 PRF_A.. 100 * PL**0.4 * PK**0.6 * (1+TA) =G=
105 100 * (0.8 * PX**(1+2.0) + 0.2 * PY**(1+2.0))**(1/(1+2.0));
106
107 PRF_B.. 100 * PL**0.6 * PK**0.4 =G=
108 100 * (0.2 * PX**(1+1.5) + 0.8 * PY**(1+1.5))**(1/(1+1.5));
109
110 PRF_W.. 200 * PX**0.5 * PY**0.5 =E= 200 * PW;
111
112 MKT_X.. 80 * A *(PX/(0.8*PX**(1+2.0)+0.2*PY**(1+2.0))**(1/(1+2.0)))**2
113 + 20 * B *(PX/(0.2*PX**(1+1.5)+0.8*PY**(1+1.5))**(1/(1+1.5)))**1.5
114 =E= 100 * W * PX**0.5 * PY**0.5 / PX;
115
116 MKT_Y.. 20 * A *(PY/(0.8*PX**(1+2.0)+0.2*PY**(1+2.0))**(1/(1+2.0)))**2.0
117 + 80 * B *(PY/(0.2*PX**(1+1.5)+0.8*PY**(1+1.5))**(1/(1+1.5)))**1.5
118 =E= 100 * W * PX**0.5 * PY**0.5 / PY;
119
120 MKT_W.. 200 * W =E= CONS / PW;
121
122 MKT_L.. 100 =E= 40 * A * PL**0.4 * PK**0.6 / PL +
123 60 * B * PL**0.6 * PK**0.4 / PL;
124
125 MKT_K.. 100 =E= 60 * A * PL**0.4 * PK**0.6 / PK +
126 40 * B * PL**0.6 * PK**0.4 / PK;
127
128 I_CONS.. CONS =E= 100*PL + 100*PK + TA*100*A*PL**0.4*PK**0.6;
129
130 MODEL ALGEBRAIC /PRF_A.A, PRF_B.B, PRF_W.W, MKT_X.PX, MKT_Y.PY,
131 MKT_L.PL, MKT_K.PK, MKT_W.PW, I_CONS.CONS /;
132
133 * Check the benchmark:
134
135 A.L=1; B.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PW.L=1; CONS.L=200;
136
137 TA = 0;
138 SOLVE ALGEBRAIC USING MCP;
139
140 * Solve the same counterfactuals:
141
142 TA = 0.10;
143 SOLVE ALGEBRAIC USING MCP;
144
39
145 TA = 1.00;
146 SOLVE ALGEBRAIC USING MCP;
Exercises:
(1) Try a higher elasticity of transformation between output in the two sectors, such as t = 10.
Try to guess ahead of time as to how this might aect the equilibrium outputs of the two sectors
following imposition of the tax. Recall that the A sector is the sector which is relatively good at
producing X.
(2) While it is harder to nd a good discussion of CET functions in a textbook (which generally
concentrate on the CES input side), see if you can verify that the MCP version is correct for one of
the sectors. Let be the elasticity of transformation. CET functions have the form:
(aX

+bY

)
1/
= F(L, K)
in which 1, =
1
1
3.3.3 Specic Factors (M24)
There are some inherent diculties in Heckscher-Ohlin type models, in which all factors are used in
and are mobile between sectors. In particular, trade theory demonstrates that when there are more
goods than factors, there are ats in the aggregate transformation surface of the economy, and
open economies tend to specialize in only as many goods as factors. This is, of course, inconsistent
with real data, which generally show economies producing something in all industries.
There are several ways around this problem. One is the Armington assumption introduced in the
next chapter. A second is to assume a portion of capital, or other factors (e.g., resources, land) is
xed or sector specic in each sector. That is what we do in this example. We take the data matrix
of M21 (M1 MPS) and split capital into three factors: (i) capital that is mobile between the two
sectors, (ii) capital specic to Y, and (iii) capital specic to X.
This assumption helps convexify the model and allow positive production of all goods. It is also
a useful assumption when data is too aggregated, such as modeling the valued added in an energy
sector as comprised of just capital and labor. Designating a portion of that capital as sector-
specic resources, allows for more realistic policy experiments. Second, the returns to the specic
factor have a nice interpretation as resource rents.
Here is the data matrix of model M21
Production Sectors Consumers
Markets | X Y W | CONS
------------------------------------------------------
PX | 100 -100 |
PY | 100 -100 |
PW | 200 | -200
PL | -25 -75 | 100
PK | -75 -25 | 100
------------------------------------------------------
Now designate part of the capital in each sector as xed in that sector, creating a four-factor model.
40
Production Sectors Consumers
Markets | X Y W | CONS
------------------------------------------------------
PX | 100 -100 |
PY | 100 -100 |
PW | 200 | -200
PL | -25 -75 | 100
PK | -50 -15 | 65
PKX | -25 | 25
PKY | -10 | 10
------------------------------------------------------
Exercise:
As an exercise after examining this model, try to guess how the introduction of the specic factors
aects the responsiveness (elasticity) of X and Y outputs to the 100% tax. Run the model and
compare it to the 50% X-sector tax results in model M21 (M1 MPS).
1 $TITLE Model M24: Closed Economy 2x2 with Specific Factors
2
3 $ONTEXT
4
5 Here is the initial data matrix for example M21 (also M1\_MPS). As noted
6 in the text description, it is technically useful to interpret a portion
7 of capital in each sector as sector specific. Or it can in fact be a
8 separate factor such as land or resources.
9
10 Production Sectors Consumers
11 Markets | X Y W | CONS
12 ------------------------------------------------------
13 PX | 100 -100 |
14 PY | 100 -100 |
15 PW | 200 | -200
16 PL | -25 -75 | 100
17 PK | -75 -25 | 100
18 ------------------------------------------------------
19
20 Designate part of the capital in each sector as fixed in that sector
21
22 Production Sectors Consumers
23 Markets | X Y W | CONS
24 ------------------------------------------------------
25 PX | 100 -100 |
26 PY | 100 -100 |
27 PW | 200 | -200
28 PL | -25 -75 | 100
29 PK | -50 -15 | 65
30 PKX | -25 | 25
31 PKY | -10 | 10
32 ------------------------------------------------------
33
34 $OFFTEXT
35
36 PARAMETERS
37 TX;
38
39 TX = 0;
40
41 $ONTEXT
42 $MODEL:M24
43
44 $SECTORS:
41
45 X ! Activity level for sector X
46 Y ! Activity level for sector Y
47 W ! Activity level for sector W (Hicksian welfare index)
48
49 $COMMODITIES:
50 PW ! Price index for welfare (expenditure function)
51 PX ! Price index for commodity X
52 PY ! Price index for commodity Y
53 PL ! Price index for primary factor L
54 PK ! Price index for (mobile) capital
55 PKX ! Price index for sector-specific input for sector X
56 PKY ! Price index for sector-specific input for sector Y
57
58 $CONSUMERS:
59 CONS ! Income level for consumer CONS
60
61 $PROD:X s:1
62 O:PX Q:100
63 I:PL Q: 25 A:CONS T:TX
64 I:PK Q: 50 A:CONS T:TX
65 I:PKX Q: 25 A:CONS T:TX
66
67 $PROD:Y s:1
68 O:PY Q:100
69 I:PL Q: 75
70 I:PK Q: 15
71 I:PKY Q: 10
72
73 $PROD:W s:1
74 O:PW Q:200
75 I:PX Q:100
76 I:PY Q:100
77
78 $DEMAND:CONS
79 D:PW Q:200
80 E:PL Q:100
81 E:PK Q: 65
82 E:PKX Q: 25
83 E:PKY Q: 10
84
85 $OFFTEXT
86 $SYSINCLUDE mpsgeset M24
87
88 $INCLUDE M24.GEN
89 SOLVE M24 USING MCP;
90
91 * Solve a counterfactual:
92
93 TX = 0.5;
94 $INCLUDE M24.GEN
95 SOLVE M24 USING MCP;
3.3.4 Tax Avoidance and Slack Activities (M25)
As has been noted, an attractive and powerful feature of MPSGE is that it solves complementarity
problems in which some production activities can be slack for some values of parameters and active
for others. This allows researchers to consider a much wider set of problems that is allowed using
software which can only solve systems of equations.
Model 25 presents a simple example, motivated by tax evasion activities. There is a third sector, Z,
which also produces good X but it is 10% less ecient (10% more costly) than the X activity itself.
42
So initially, Z does not operate. But when a tax of 25% is imposed on X, this activity goes slack
and Z begins to operate. We could think of Z as a tax evasion or informal activity that is less
ecient but can successfully avoid the tax.
Exercise:
As a second counterfactual, we impose the tax but do not let the Z sector operate by imposing
the restriction Z.FX = 0;. Compare the results of this run to the rst counterfactual in which Z is
allowed to operate. Can you interpret the welfare results? Hint: while the tax is distortionary, the
switch to the inecient activity uses real resources to avoid the tax.
Now raise the tax to 100%. Does this result that tax evasion (the switch to Z) is welfare worsening
still hold?
1 $TITLE Model M25: Closed 2x2 Economy with an Unprofitable Activity
2
3 $ONTEXT
4
5 Production Sectors Consumers
6 Markets | X Y W | CONS
7 ------------------------------------------------------
8 PX | 100 -100 |
9 PY | 100 -100 |
10 PW | 200 | -200
11 PL | -40 -60 | 100
12 PK | -60 -40 | 100
13 ------------------------------------------------------
14
15 Activity Z is unprofitable at initial equilibrium prices. It is
16 therefore not operated, and we cannot infer its technical properties
17 from the benchmark social accounting data. We assume that Z is 10\%
18 less efficient than X.
19
20 $OFFTEXT
21
22 PARAMETERS
23 TX;
24
25 TX = 0;
26
27 $ONTEXT
28 $MODEL:M25
29
30 $SECTORS:
31 X ! Activity level for sector X
32 Y ! Activity level for sector Y
33 W ! Activity level for sector W (Hicksian welfare index)
34 Z ! Alternative activity for producing X.
35
36 $COMMODITIES:
37 PX ! Price index for commodity X
38 PY ! Price index for commodity Y
39 PL ! Price index for primary factor L
40 PK ! Price index for primary factor K
41 PW ! Price index for welfare (expenditure function)
42
43 $CONSUMERS:
44 CONS ! Income level for consumer CONS
45
46 $PROD:X s:1
43
47 O:PX Q:100
48 I:PL Q: 40 A:CONS T:TX
49 I:PK Q: 60 A:CONS T:TX
50
51 $PROD:Y s:1
52 O:PY Q:100
53 I:PL Q: 60
54 I:PK Q: 40
55
56 $PROD:Z s:1
57 O:PX Q:100
58 I:PL Q: 44
59 I:PK Q: 66
60
61 $PROD:W s:1
62 O:PW Q:200
63 I:PX Q:100
64 I:PY Q:100
65
66 $DEMAND:CONS
67 D:PW Q:200
68 E:PL Q:100
69 E:PK Q:100
70
71 $OFFTEXT
72 $SYSINCLUDE mpsgeset M25
73
74 PW.FX = 1;
75
76 Z.L = 0;
77
78 $INCLUDE M25.GEN
79 SOLVE M25 USINCP MCP;
80
81 * Lets levy a high on sector X and see what happens:
82
83 TX = 0.25;
84 $INCLUDE M25.GEN
85 SOLVE M25 USING MCP;
86
87 * What is the effect of the tax if Z could not be used?
88
89 Z.FX = 0;
90
91 TX = 0.25;
92 $INCLUDE M25.GEN
93 SOLVE M25 USING MCP;
3.3.5 Labor-Leisure Choice (M26)
Often general-equilibrium models used in international trade assume that factors of production,
especially labor, are in xed and inelastic supply. But designing tax, welfare, and education systems,
endogenizing labor supply is a crucial part of the story. Model M26 endogenizes labor supply,
allowing labor to chose between leisure and labor supply with leisure entering into the workers
utility function.
This requires the modeler to specify an endowment of labor or time, something which is not in itself
directly observable. Only the portion actually supplied to the market is observable. The modeler
also need to specify an elasticity of substitution between leisure and consumption goods, which will
in turn imply an elasticity of labor supply.
44
We cannot do much theoretical analysis here, but do suggest that students interested in these
questions work with a simple CES function with one good and leisure in order to understand the
basic mircoeconomics of labor supply. For a Cobb-Douglas function with an elasticity of substitution
equal to one between consumption and leisure, labor supply is completely inelastic with respect to
the wage rate. When the elasticity of substitution is greater than one, an increase in the wage rate
will mean an increase in labor supply, and an elasticity of substitution less than one will mean that
labor supply is backward bending, falling with an increase in the wage rate.
In our formulation, we introduce an additional activity T, which transforms leisure (price PL) into
labor supplied (price PLS). Strictly speaking this is not necessary, the consumers endowment of
labor could just be supplied to both production and the welfare generating activity W. But adding
activities is often useful. The solution will report the activity level of T which allows us to directly
check the change in labor supply, and any tax on labor can be specied here just once rather than
in each sector that uses labor. Here is the production block for T:
$PROD:T
O:PLS Q:100
I:PL Q:100 A:CONS T:TL
The production block for W species a nesting structure in which goods have an elasticity of sub-
stitution of 1 between them in a lower nest, and goods and leisure have an elasticity of substitution
between them of 0.5:
$PROD:W s:0.5 cons:1
O:PW Q:300
I:PX Q:100 cons:
I:PY Q:100 cons:
I:PL Q:100
(The use of cons as a nest label in $PROD:W should not be confused with the A:CONS appearing in
the $PROD:T block where CONS refers to the consumer of that name.)
In this model the consumer is assumed to be endowed with 200 units of labor/leisure (found in the
DEMAND block), of which 100 units are supplied to the labor market initially.
1 $TITLE Model M26: 2x2 Economy with Labor-Leisure Choice
2
3 $ONTEXT
4
5
6 Activity T transforms leisure into labor supply:
7
8 Production Sectors Consumers
9 Markets | A B W T | CONS
10 ---------------------------------------------------------
11 PX | 80 20 -100 |
12 PY | 20 80 -100 |
13 PW | 300 | -300
14 PLS | -40 -60 100 |
15 PL | -100 -100 | 200
16 PK | -60 -40 | 100
17 ---------------------------------------------------------
18
19 $OFFTEXT
20
45
21 PARAMETERS
22 TL Tax rate on labor /0/
23 WELFARE Hicksian equivalent welfare
24 REALCONS Real consumption;
25
26 $ONTEXT
27 $MODEL:M26
28
29 $SECTORS:
30 X ! Activity level for sector X
31 Y ! Activity level for sector Y
32 T ! Labor supply
33 W ! Activity level for sector W (Hicksian welfare index)
34
35 $COMMODITIES:
36 PX ! Price index for commodity X
37 PY ! Price index for commodity Y
38 PL ! Price index for leisure
39 PLS ! Price index for labor supply (factor L input)
40 PK ! Price index for primary factor K
41 PW ! Price index for welfare (expenditure function)
42
43 $CONSUMERS:
44 CONS ! Income level for consumer CONS
45
46
47 $PROD:X s:1
48 O:PX Q:100
49 I:PLS Q: 40
50 I:PK Q: 60
51
52 $PROD:Y s:1
53 O:PY Q:100
54 I:PLS Q: 60
55 I:PK Q: 40
56
57 $PROD:T
58 O:PLS Q:100
59 I:PL Q:100 A:CONS T:TL
60
61 $PROD:W s:0.5 cons:1
62 O:PW Q:300
63 I:PX Q:100 cons:
64 I:PY Q:100 cons:
65 I:PL Q:100
66
67 $DEMAND:CONS
68 D:PW Q:300
69 E:PL Q:200
70 E:PK Q:100
71
72 $OFFTEXT
73 $SYSINCLUDE mpsgeset M26
74
75 PW.FX = 1;
76
77 $INCLUDE M26.GEN
78 SOLVE M26 USING MCP;
79
80 WELFARE = W.L;
81 REALCONS = (PX.L*X.L*100 + PY.L*Y.L*100)/(PX.L**0.5*PY.L**0.5*200);
82 DISPLAY WELFARE, REALCONS;
83
84 * Solve a counter-factual, tax labor supply at 25%
46
85
86 TL = 0.5;
87 $INCLUDE M26.GEN
88 SOLVE M26 USING MCP;
89
90 WELFARE = W.L;
91 REALCONS = (PX.L*X.L*100 + PY.L*Y.L*100)/(PX.L**0.5*PY.L**0.5*200);
92 DISPLAY WELFARE, REALCONS;
Several features of this program require some explanation. First, the use of the labor supply activity
is going to imply two separate prices in the present of the labor tax. There is PL, which is the price
of leisure, or alternatively the consumers price of a labor supplied to the market. PLS is going to
be the producers cost of labor. The two are related by
PLS = PL(1+TL)
We could also refer to these as the before (PL) and after tax wage (PLS). We will spend more time on
this issue in the next chapter and are simply alerting the reader to this issue now: in the presence
of taxes, generally not all prices can be one, and it is very important to keep track of what prices
go where, who pays what price and who receives what price.
Second, note the equations and notation at the end of the program.
WELFARE = W.L;
REALCONS = (PX.L*X.L*100 + PY.L*Y.L*100) / (PX.L**0.5*PY.L**0.5*200);
DISPLAY WELFARE, REALCONS;
A .L after a variable asks for the current value of a variable. Thus W.L gives the value of the
variable named W.
In the rst two of these statements, parameters (declared earlier) are assigned values following the
solution to the model. The rst is just the value of welfare. The second, REALCONS, is short for
the real value of goods consumption. This is specied as the value of X plus Y consumption divided
by the price index for a unit of welfare (the exact consumer price index). We have specied this
variable (declared as a PARAMETER in GAMS) in order to make an economic point.
As you will see if you run this model, the labor tax leads to a reduction in labor supply. This of course
leads to a fall in commodity consumption but also to a rise in leisure. Economic indices generally
ignore leisure and report changes in nominal or real consumption. If you look at the solution to
the model, you will see that indeed REALCONS falls much more than WELFARE. Thus in this case, the
usual statistics overstate the burden of the tax and would overstate the benet of removing the tax
if labor supply increases.
Finally, GAMS does not automatically write out the values of parameters in the listing le (in this
case M26.LST). You have to request that, which is done here with the DISPLAY statement as
shown. Parameter values will be written out following the values of the variables of the model.
Exercise:
Change the elasticity of substitution between leisure and goods and see how this aects the results
concerning the labor tax.
47
3.3.6 Labor Supply to Formal and Informal Sectors (M27)
This is a model which may be of interest to development and public nance economists. It assumes
that there are two labor markets, a formal and an informal market. Governments are able to
collect taxes on the former but not on the latter. The representative household can choose how much
labor to supply to each market. For simplicity, we assume that there is no labor-leisure decision, and
that all labor is supplied to one of the two markets, but that can be very easily added and indeed
we will suggest that as an exercise at the end.
There are many ways of doing this. We rst of all use an activity denoted LS which takes household
labor and produces two outputs, formal and informal labor (prices PLSF and PLSI) according to
a CET transformation function with an elasticity 5.0. Think of this as a household technology
embodying the fact that the two types of labor are not perfect substitutes in supply. For example,
this might be a crude simplication of the fact that the representative household is actual many
households (or household locations) some of whom are better at supplying formal labor and vice
versa. Concentrating supply in either market leads to something like diminishing returns, a
concave transformation frontier between the two types of end. Rough
In addition, the two types of labor can be imperfect substitutes on the production side. That is
what we assume here. Only formal labor is used in the X sector, while both formal and (mostly)
informal labor are used in the Y sector. The two types of labor are in a lower level nest with an
elasticity of substitution of 3.
The formal and informal labor supplies could go directly into production, but the listing le will
not directly tell us how much of each type is produced by activity LS. Thus we use two dummy
activities LF and LI which take a unit of formal labor (LF) or informal labor (LI) and just turn each
unit into a unit of the same thing with a dierent commodity name (PLF and PLI) which are the
actual inputs into production. This is just a trip so that the listing le will tell us how much of
each type of labor is supplied, the activity levels of LF and LI respectively. In addition, this trick
is convenient in multi-sector models because the tax on formal labor need only be specied once, in
the LF activity, and not in every production block using formal labor.
Here is the program. You will see from the listing le that the tax on formal labor supply leads
to a large shift of household supply toward informal labor and that there is a large shift in output
toward Y, the sector using informal labor.
1 $TITLE Model M27: 2x2 Economy with Formal/Informal Labor Supply
2
3 $ONTEXT
4
5
6 Activity LS transforms leisure into formal and informal labor supplies.
7 LF and LI are "dummy" activities used to keep track of how much labor
8 is supplied to each market.
9
10 Production Sectors Consumers
11 Markets | X Y W LF LI LS | CONS
12 -------------------------------------------------------------------
13 PX | 100 -100 |
14 PY | 100 -100 |
15 PW | 200 | -200
16 PLF | -40 -10 50 |
17 PLI | -50 50 |
18 PLSF | -50 50 |
19 PLSI | -50 50 |
20 PL | -100 | 100
48
21 PK | -60 -40 | 100
22 ----------------------------------------------------------------
23
24 $OFFTEXT
25
26 PARAMETERS
27 TL;
28
29 TL = 0;
30
31 $ONTEXT
32 $MODEL:M27
33
34 $SECTORS:
35 X ! Activity level for sector X
36 Y ! Activity level for sector Y
37 LS ! Activity level for household labor supply
38 LF ! Activity for formal labor supply
39 LI ! Activity for informal labor supply
40 W ! Activity level for sector W (Hicksian welfare index)
41
42 $COMMODITIES:
43 PX ! Price index for commodity X
44 PY ! Price index for commodity Y
45 PL ! Price index for labor
46 PLSF ! Price index for formal labor supplied to market
47 PLSI ! Price index for informal labor supply to market
48 PLF ! Price index for formal labor supplied to firms
49 PLI ! Price index for informal labor supplied to firms
50 PK ! Price index for primary factor K
51 PW ! Price index for welfare (expenditure function)
52
53 $CONSUMERS:
54 CONS ! Income level for consumer CONS
55
56 $PROD:X s:1
57 O:PX Q:100
58 I:PLF Q: 40
59 I:PK Q: 60
60
61 $PROD:Y s:1 a:3
62 O:PY Q:100
63 I:PLF Q: 10 a:
64 I:PLI Q: 50 a:
65 I:PK Q: 40
66
67 $PROD:LS t:5.0
68 O:PLSF Q: 50
69 O:PLSI Q: 50
70 I:PL Q:100
71
72 $PROD:LF
73 O:PLF Q: 50
74 I:PLSF Q: 50 A:CONS T:TL
75
76 $PROD:LI
77 O:PLI Q: 50
78 I:PLSI Q: 50
79
80 $PROD:W s:1.0
81 O:PW Q:200
82 I:PX Q:100
83 I:PY Q:100
84
49
85 $DEMAND:CONS
86 D:PW Q:200
87 E:PL Q:100
88 E:PK Q:100
89
90 $OFFTEXT
91 $SYSINCLUDE mpsgeset M27
92
93 PW.FX = 1;
94
95 $INCLUDE M27.GEN
96 SOLVE M27 USING MCP;
97
98 * Solve a counter-factual, tax formal labor supply at 50%
99
100 TL = 0.5;
101 $INCLUDE M27.GEN
102 SOLVE M27 USING MCP;
103
3.3.7 Heterogeneous Households (M28)
A great many questions of interest to trade and public nance economists involve issues of distri-
bution rather than or in addition to issues of aggregate welfare. Households (or consumers in
MPSGE) may dier in their preferences and more importantly in their sources of income (or their
factor endowments). For both reasons, dierent taxes and other government policies aect dierent
households in dierent ways. In addition to creating deadweight losses or aggregate benets, tax
change can also signicantly redistribute income among households.
Adding multiple household types is a straightforward extension of our earlier models. In model
M28, we allow for two households. Household A is relatively well endowed with labor, and also has
a preference for good Y, which is the labor-intensive good. Household B is relatively well endowed
with capital and has a relative preference for the capital intensive good X.
Our counterfactual experiment is to place a tax on the factor inputs to X, assigning half the revenue
to each consumer. As you will guess, this tax lowers the welfare of household B. However, the
redistribution eect outweighs the overall deadweight loss of the tax for household A, which is
actually better o. This welfare gain is a combination of a redistribution in favor of capital, and a
lowering of the relative consumer price of Y, the good favored by household A.
Note that we chose labor as numeraire in this program, and the consumer price index (PWA, PWB)
will dier for the two end households.
Exercises:
(1) You might (correctly) guess that there is no way to redistribute the tax unevenly and make
both households worse o. That would violate the rst theorem of welfare economics. Try some
alternative distributions to check on this. You will need to specify two end dierent tax parameters,
but they should continue to sum to 0.5.
(1) Recalibrate the data so that the households have the same preferences. Running the experiment
gives then a welfare eect due only to the change in factor prices following the imposition of the tax.
1 $TITLE Model M28GMS: 2x2 Economy with Two Household Types
2
50
3 $ONTEXT
4
5 Two households: differ in preferences and in endowments
6
7 Production Sectors Consumers
8 Markets | X Y WA WB | A B
9 ----------------------------------------------------------
10 PX | 100 -40 -60 |
11 PY | 100 -60 -40 |
12 PWA | 100 | -100
13 PWB | 100 | -100
14 PL | -25 -75 | 90 10
15 PK | -75 -25 | 10 90
16 ----------------------------------------------------------
17
18 $OFFTEXT
19
20 PARAMETERS
21 TX;
22
23 TX = 0;
24
25 $ONTEXT
26
27 $MODEL:M28
28
29 $SECTORS:
30 X ! Activity level for sector X
31 Y ! Activity level for sector Y
32 WA ! Welfare index for consumer A
33 WB ! Welfare index for consumer B
34
35 $COMMODITIES:
36 PX ! Price index for commodity X
37 PY ! Price index for commodity Y
38 PL ! Price index for primary factor L
39 PK ! Price index for primary factor K
40 PWA ! Price index for consumer A welfare
41 PWB ! Price index for consumer B welfare
42
43 $CONSUMERS:
44 CONSA ! Income level for consumer A
45 CONSB ! Income level for consumer B
46
47 * More than one tax may be levied on a single transaction with
48 * revenues accruing to different agents. As specified here, the
49 * ad-valorem tax rate on inputs to sector X equals 2*TX. Half
50 * of the tax revenue accrues to A and half to B.
51
52 $PROD:X s:1
53 O:PX Q:100
54 I:PL Q: 25 A:CONSA T:TX A:CONSB T:TX
55 I:PK Q: 75 A:CONSA T:TX A:CONSB T:TX
56
57 $PROD:Y s:1
58 O:PY Q:100
59 I:PL Q: 75
60 I:PK Q: 25
61
62 $PROD:WA s:1
63 O:PWA Q:100
64 I:PX Q: 40
65 I:PY Q: 60
66
51
67 $PROD:WB s:1
68 O:PWB Q:100
69 I:PX Q: 60
70 I:PY Q: 40
71
72 $DEMAND:CONSA
73 D:PWA Q:100
74 E:PL Q: 90
75 E:PK Q: 10
76
77 $DEMAND:CONSB
78 D:PWB Q:100
79 E:PL Q: 10
80 E:PK Q: 90
81
82 $OFFTEXT
83 $SYSINCLUDE mpsgeset M28
84
85 PL.FX = 1;
86
87 $INCLUDE M28.GEN
88 SOLVE M28 USING MCP;
89
90
91 * Solve a counterfactual:
92
93 TX = 0.25;
94 $INCLUDE M28.GEN
95 SOLVE M28 USING MCP;
3.3.8 Stone-Geary (LES) preferences (M29)
No budget study we are aware of has ever suggested that consumer preferences are homogeneous.
Households tend to spend a much higher proportion of their income on food at low incomes, for
example, than at high incomes. Part of the reason that trade economists and applied general-
equilibrium modelers are so fond of homogenous functions is that they are technically much easier
to handle than non-homogeneous functions. As we noted earlier, any constant-returns CES function
can be completely specied by a single vector of values of inputs and output quantities, and the
relative prices of inputs at that point.
One alternative formulation is know as the Stone-Geary utility function, which in turn gives rise to
the linear expenditure system (LES) of demand equations, the latter being popular in budget studies.
The Stone-Geary utility function is just a Cobb-Douglas function with the origin displaced from zero.
These displacements, if positive, are typically called minimum consumption requirements, meaning
that the consumer gets no positive utility until these needs are met. Consider a simple case in which
there is a minimum consumption requirement in X but not in Y. The minimum X consumption is
denoted X*. The utility function is
U = (X X

Y
1
If we maximize this function subject to the usual budget constraint with income I, the demand
functions for X and Y are:
X = X

+
(I p
x
X

)
p
x
Y =
(1 )(I p
x
X

)
p
y
52
The rst equation is rather intuitive in words. It says that you rst purchase the minimum con-
sumption requirements, and then you spend a constant fraction () of remaining income net of the
minimum requirements on X. Further algebra would give us the budget share spent on X and the
income elasticity of demand for X.
p
x
X
I
=
I + (1 )p
x
X

I
I
X
dX
dI
=
I
I + (1 )p
x
X

The budget share spent on X falls with increases in income, asymptotically approaching as income
rises. The income elasticity of demand rises with income, asymptotically approaching 1.
Suppose that we want to calibrate our initial data to the assumption that the income elasticity of
demand for X is initially equal to 0.75. If we solve the share equation (equal to 0.5) in the data and
the income-elasticity equation (equal to 0.75 by assumption), we get = 3/8. This will then allow
us to solve for X*, which is X* = 40. The trick is then to revise the benchmark data matrix, giving
the consumer a negative endowment of X = 40. The utility (welfare) function Wthen has an input
of 60 units of X (100 minus the minimum consumption requirement) and 100 units of Y. At prices
of 1 for each good, MPSGE will then calibrate the Cobb-Douglas utility function with an = 3/8
(60/160).
The counterfactual experiment in this model is to double the consumers endowment. Note from the
results that there is a shift in consumption toward Y, the high income-elasticity good. Of course,
the change in X and Y consumption cannot be directly interpreted as income elasticities of demand,
since prices will change in general equilibrium. The price of Y will rise relative to X, and the price
of the factor used intensively in Y will rise relative to the price of the other factor.
One nal word of caution about this model and the use of Stone-Geary. Welfare changes have to be
interpreted carefully, because utility is not linear (homogenous of degree 1) in income at constant
prices. As you will see from the results of this simulation, utility (W) more than doubles as we double
the endowment. Note by way of intuition that if income as so low that the consumer could just
barely buy the minimum consumption requirement, then utility would be zero. Also, we should note
that if income is too small to even buy X* (in general equilibrium, the endowment is insucient to
produce X*), the solver will crash and not compute a solution. These diculties are troubling, but
we are sure that good policy must consider the fact that really poor people consume very dierent
bundles of goods than rich people, and this has probably more to do with non-homogeneity than
them having homogeneous but dierent preferences.
1 $TITLE Model M29: Closed 2x2 Economy -- Stone Geary (LES) Preferences
2
3 $ONTEXT
4
5
6 The observed data is:
7
8 Production Sectors Consumers
9 Markets | X Y W | CONS
10 ------------------------------------------------------
11 PX | 100 -100 |
12 PY | 100 -100 |
13 PW | 200 | -200
53
14 PL | -40 -60 | 100
15 PK | -60 -40 | 100
16 ------------------------------------------------------
17
18 But calibrated to the model as:
19
20 Production Sectors Consumers
21 Markets | X Y W | CONS
22 ------------------------------------------------------
23 PX | 100 -60 | -40
24 PY | 100 -100 |
25 PW | 160 | -160
26 PL | -40 -60 | 100
27 PK | -60 -40 | 100
28 ------------------------------------------------------
29
30 $OFFTEXT
31
32 PARAMETERS
33 ENDOW;
34
35 ENDOW = 1;
36
37 $ONTEXT
38
39 $MODEL:M29
40
41 $SECTORS:
42 X ! Activity level for sector X
43 Y ! Activity level for sector Y
44 W ! Activity level for sector W (Hicksian welfare index)
45
46 $COMMODITIES:
47 PX ! Price index for commodity X
48 PY ! Price index for commodity Y
49 PL ! Price index for primary factor L
50 PK ! Price index for primary factor K
51 PW ! Price index for welfare (expenditure function)
52
53 $CONSUMERS:
54 CONS ! Income level for consumer CONS
55
56 $PROD:X s:1
57 O:PX Q:100
58 I:PL Q: 40
59 I:PK Q: 60
60
61 $PROD:Y s:1
62 O:PY Q:100
63 I:PL Q: 60
64 I:PK Q: 40
65
66 $PROD:W s:1
67 O:PW Q:160
68 I:PX Q: 60
69 I:PY Q:100
70
71 $DEMAND:CONS
72 D:PW Q:160
73 E:PL Q:(100*ENDOW)
74 E:PK Q:(100*ENDOW)
75 E:PX Q:-40
76
77 $OFFTEXT
54
78 $SYSINCLUDE mpsgeset M29
79
80 PW.FX = 1;
81
82 $INCLUDE M29.GEN
83 SOLVE M29 USING MCP;
84
85 * Counterfactual: double the factor endowment.
86
87 ENDOW = 2;
88
89 $INCLUDE M29.GEN
90 SOLVE M29 USING MCP;
3.3.9 Open Economy models
Naturally, a very important task for the modeler is building open economy models, since trade
and international investment policies are among the important policy problems facing governments.
This chapter continues in the spirit of the previous chapters, presenting a series of simple models
which incorporate features of open economy issues one by one. Here are the model names with brief
descriptions of their features.
3.3.10 Small open economy 2x2 (M41)
This is a very simple 2-good, 2-factor model in which the rest of the world is not explicitly modeled.
Trading opportunities are summarized by simple functions which allow the economy to transform
one good (an export) into another (an import). The technology of these functions represents world
prices. If good X1 exchanges for two units of X2, then the world price ratio is implicitly given by
p1/p2 = 2. We will assume that these technologies or price ratios are xed in this model and the
rst few models to follow. This is commonly know as the small- country assumption: the country
can trade as much or as little as it wants at xed prices.
We assume in the benchmark data that the country exports X1 in exchange for X2, but we will allow
for the fact that some policy or endowment change could actually reverse the direction of trade by
specifying (initially inactive) functions that transform goods in the opposite direction. Here is the
initial data, in which 50 units of good X1 are exchanged for 50 units of good X2 at an implicit price
ratio of p1/p2 = 1.
Production Sectors Consumer
Markets | X1 X2 E1 M2 W CONS
----------------------------------------------------------------
P1 | 150 -50 -100
P2 | 50 50 -100
PL | -100 -20 120
PK | -50 -30 80
PW | 200 -200
PFX | 50 -50
----------------------------------------------------------------
Technology parameters are specied in these functions that allow the modeler to change the terms
of trade. These are given by:
PARAMETERS
PE2 Export price of good 2 /0.99/,
55
PM1 Import price of good 1 /1.01/,
PE1 Export price of good 1 /1/,
PM2 Import price of good 2 /1/,
TM2 Import tariff for god 2;
E1 and M2 production activities that are the initially active trade links. E1 stands for exports
of good X1 . While we could specify this activity as directly transforming X1 into X2 , in more
complicated models with many goods it proves useful to dene another good which we will call
foreign exchange and whose price is denoted PFX. All trade is mediated through the foreign
exchange market.
Thus activity E1 transforms X1 into foreign exchange and M2, the import activity for good 2,
transforms foreign exchange into imports of good 2. These activities are given as follows:
$PROD:E1
O:PFX Q:(50*PE1)
I:P1 Q:50
$PROD:M2
O:P2 Q:50
I:PFX Q:(50*PM2) A:CONS T:TM2
TM2 is an import tari on good 2, which is initially set to zero. We also specify trade links in the
opposite direction, which are initially inactive as noted above. At this point, we have an opportunity
to make an important technical remark which may save the modeler some misery later on. Suppose
that good 1 can be transformed into good 2 at a price of one, and good 2 can be transformed into
good 1 at a price of 1. Then if the export of 50 units of good 1 and imports of 50 units of good 2
is an equilibrium, then so is the export of 100 units of good 1 followed by the imports of 50 units of
good 2 plus 50 units of good 1.
In technical terms the model is degenerate, it has innitely many solutions. In such a situation,
the solver will either fail to converge, or converge to an arbitrary solution. The latter will have net
exports (exports minus imports) of X1 equal to 50 and net imports of X2 equal to 50, but may
involve any amount of gross trade.
This is why we specify the prices or terms of trade dierently for the activities M1 and E2, so
that it is never protable to export and import the same good.
Here is the model. In the rst counterfacual we impose a tari and 5% and then a tari of 10%.
When you look at the listing les, you will see that the tari of 10% is prohibitive, all trade ceases.
The last experiment returns the tari to zero, and improves the terms of trade (relative prices of
the export good) to 1.2.
1 $TITLE Model M41: Small open economy model. Two goods, two factors.
2
3 $ONTEXT
4 Production Sectors Consumer
5
6 Markets | X1 X2 E1 M2 W CONS
7 -----------------------------------------------------------------
8 P1 | 150 -50 -100
9 P2 | 50 50 -100
10 PL | -100 -20 120
11 PK | -50 -30 80
12 PW | 200 -200
56
13 PFX | 50 -50
14 ------------------------------------------------------------------
15
16 $OFFTEXT
17
18 PARAMETERS
19 PE2 Export price of good 2,
20 PM1 Import price of good 1,
21 PE1 Export price of good 1,
22 PM2 Import price of good 2,
23 TM2 Import tariff for god 2;
24
25 PE1 = 1;
26 PM2 = 1;
27 PE2 = 0.99;
28 PM1 = 1.01;
29 TM2 = 0;
30
31 $ONTEXT
32
33 $MODEL:M41
34
35 $SECTORS:
36 X1 ! Production index for good 1
37 X2 ! Production index good 2
38 E1 ! Export level of good 1
39 E2 ! Export level of good 2
40 M1 ! Import level of good 1
41 M2 ! Import level of good 2
42 W ! Welfare index
43
44 $COMMODITIES:
45 P1 ! Price index for good 1
46 P2 ! Price index for good 1
47 PFX ! Read exchange rate index
48 PW ! Welfare price index
49 PL ! Wage index
50 PK ! Capital rental index
51
52 $CONSUMERS:
53 CONS ! Income level for representative agent
54
55 $PROD:X1 s:1
56 O:P1 Q:150
57 I:PL Q:100
58 I:PK Q: 50
59
60 $PROD:X2 s:1
61 O:P2 Q:50
62 I:PL Q:20
63 I:PK Q:30
64
65 $PROD:E1
66 O:PFX Q:(50*PE1)
67 I:P1 Q:50
68
69 $PROD:M2
70 O:P2 Q:50
71 I:PFX Q:(50*PM2) A:CONS T:TM2
72
73 $PROD:E2
74 O:PFX Q:(50*PE2)
75 I:P2 Q:50
76
57
77 $PROD:M1
78 O:P1 Q:50
79 I:PFX Q:(50*PM1)
80
81 $PROD:W s:1
82 O:PW Q:200
83 I:P1 Q:100
84 I:P2 Q:100
85
86 $DEMAND:CONS
87 D:PW Q:200
88 E:PL Q:120
89 E:PK Q: 80
90
91 $OFFTEXT
92 $SYSINCLUDE mpsgeset M41
93
94 PW.FX = 1;
95
96 E2.L = 0;
97 M1.L = 0;
98 E1.L = 1;
99 M2.L = 1;
100
101 M41.ITERLIM = 0;
102 $INCLUDE M41.GEN
103 SOLVE M41 USING MCP;
104 M41.ITERLIM = 2000;
105
106
107 TM2 = 0.05;
108
109 $INCLUDE M41.GEN
110 SOLVE M41 USING MCP;
111
112 TM2 = 0.10;
113
114 $INCLUDE M41.GEN
115 SOLVE M41 USING MCP;
116
117 TM2 = 0.;
118 PE1 = 1.2;
119 PM1 = 1.21;
120
121 $INCLUDE M41.GEN
122 SOLVE M41 USING MCP;
Exercises:
(1) If you have an international trade textbook, review the Stopler-Samuelson theorem. Examine
the eects of the tari and the terms-of-trade improvement and see that the results validate the
theorem. From a policy point of view, the redistribution eects of taris are very important and
help explain their existence.
(2) Set the tari to zero and specify an export subsidy on the initially inactive link E2, exports of
good 2. How high does this subsidy have to be in order to reverse the direction of trade?
(3) Work out the export tax on X1 that should be equivalent to the import tari on X2 and verify
this numerically (hint: the two tax rates are not same, since the base is dierent, an issue discussed
in the previous chapter).
58
3.3.11 Small open economy with a benchmark tari (M42)
This model has a 20% tari in the benchmark data. It is important to keep track of prices and trade
balance in this situation. Here is the data matrix.
Production Sectors Consumer
Markets | X1 X2 E1 M2 W CONS
----------------------------------------------------------------
P1 | 150 -50 -100
P2 | 40 60 -100
PL | -100 -20 120
PK | -50 -20 70
PW | 200 -200
PFX | 50 -50
T (tar rev)| -10 10
----------------------------------------------------------------
Trade balance holds, since exports of good 1 generate 50 units of foreign exchange and those 50
units are spent on imports. Consumers spend 60 on imports of which 10 is the tari, or 20% of the
value of imports (10/50). This tari revenue is returned to consumers. All row and column sums
equal zero in this matrix.
In open economy models, the modeler must chose units or prices. The convention we adopt here is
that all domestic prices are equal to 1 initially. Since the export good X1 is freely traded, then the
international price of X1 is also equal to 1. However, the import good has a domestic price equal to
(1 + TM2) times the world price, so if the domestic price is equal to 1 then the world price must
equal 1/ (1 + TM2) = 1/1.2.
Thus the -50 in the column M2 of the matrix is interpreted as 60 units at a price of 1/1.2. This is
the way the program is formulated below.
The rest of the model should be straight forward at this point. The counterfactual experiment is
free trade.
1 $TITLE Model M42: Small open economy model with a benchmark tariff.
2
3 $ONTEXT
4
5 In this example, units are chosen such that all DOMESTIC prices equal
6 one initially. Implied world prices are then P1/P2 = 1.2
7
8 Production Sectors Consumer
9 Markets | X1 X2 E1 M2 W CONS
10 ------------------------------------------------------------------
11 P1 | 150 -50 -100
12 P2 | 40 60 -100
13 PL | -100 -20 120
14 PK | -50 -20 70
15 PW | 200 -200
16 PFX | 50 -50
17 T (tar rev)| -10 10
18 ------------------------------------------------------------------
19
20 $OFFTEXT
21
22 PARAMETERS
23
24 PE2 Export price of good 2,
59
25 PM1 Import price of good 1,
26 PE1 Export price of good 1,
27 PM2 Import price of good 2,
28 TM2 Import tariff for good 2;
29
30 PE1 = 1;
31 PM2 = 1/(1.2);
32 PE2 = PM2*0.99;
33 PM1 = 1.01;
34 TM2 = 0.20;
35
36
37 $ONTEXT
38
39 $MODEL:M42
40
41 $SECTORS:
42 X1 ! Production index for good 1
43 X2 ! Production index good 2
44 E1 ! Export level of good 1
45 E2 ! Export level of good 2
46 M1 ! Import level of good 1
47 M2 ! Import level of good 2
48 W ! Welfare index
49
50 $COMMODITIES:
51 P1 ! Price index for good 1
52 P2 ! Price index for good 1
53 PFX ! Read exchange rate index
54 PW ! Welfare price index
55 PL ! Wage index
56 PK ! Capital rental index
57
58 $CONSUMERS:
59 CONS ! Income level for representative agent
60
61 $PROD:X1 s:1
62 O:P1 Q:150
63 I:PL Q:100
64 I:PK Q: 50
65
66 $PROD:X2 s:1
67 O:P2 Q:40
68 I:PL Q:20
69 I:PK Q:20
70
71 $PROD:E1
72 O:PFX Q:(50*PE1)
73 I:P1 Q:50
74
75 $PROD:M2
76 O:P2 Q:60
77 I:PFX Q:(60*PM2) A:CONS T:TM2
78
79 $PROD:E2
80 O:PFX Q:(60*PE2)
81 I:P2 Q:60
82
83 $PROD:M1
84 O:P1 Q:50
85 I:PFX Q:(50*PM1)
86
87 $PROD:W s:1
88 O:PW Q:200
60
89 I:P1 Q:100
90 I:P2 Q:100
91
92 $DEMAND:CONS
93 D:PW Q:200
94 E:PL Q:120
95 E:PK Q: 70
96
97 $OFFTEXT
98 $SYSINCLUDE mpsgeset M42
99
100 PW.FX = 1;
101
102 E1.L = 1;
103 M2.L = 1;
104 E2.L = 0;
105 M1.L = 0;
106
107 M42.ITERLIM = 0;
108 $INCLUDE M42.GEN
109 SOLVE M42 USING MCP;
110 M42.ITERLIM = 2000;
111
112 * Counterfactual experiment is free trade
113
114 TM2 = 0;
115
116 $INCLUDE M42.GEN
117 SOLVE M42 USING MCP;
3.3.12 An alternative price normalization (M43)
In models with many countries, the modeler may wish to choose world prices as all equaling 1.
Model M43 is exactly the same as model M42 except that we choose world prices as 1. This only
aects the calibration via the choice of units for X2 . Since the world price of good 2 is equal to 1,
then the domestic price is P2 = 1.2. But if this is the case, then the value of X2 production (40)
and consumption (100) must imply benchmark quantities of
40 = 1.2*(quantity) quantity = 33.3333 100 = 1.2*(quantity)
quantity = 83.3333
You will see these numbers in the quantity elds of the program. W for example, is calibrated as:
$PROD:W s:1
O:PW Q:200
I:P1 Q:100
I:P2 Q:83.33333 P:1.2
Other features of the model are identical to M42 as noted, so here is the program.
1 $TITLE Model M43: Small open economy model with a benchmark tariff.
2
3 * alternaive price normalization from M42
4
5 $ONTEXT
6
7 This model is equivalent to M42 except that units are chosen such that
61
8 all WORLD prices equal one initially. The benchmark domestic price
9 ratio is then P2 = 1.2.
10
11 Note that this changes the units of measurement in good 2. There are
12 now 83.3333 units of good 2 consumed instead of 100, but this is
13 simply a change in units of measure and has no welfare consequences.
14
15 Production Sectors Consumer
16
17 Markets | X1 X2 E1 M2 W CONS
18 ------------------------------------------------------------------
19 P1 | 150 -50 -100
20 P2 | 40 60 -100
21 PL | -100 -20 120
22 PK | -50 -20 70
23 PW | 200 -200
24 PFX | 50 -50
25 T | -10 10
26 ------------------------------------------------------------------
27
28 $OFFTEXT
29
30 PARAMETERS
31
32 PE2 Export price of good 2,
33 PM1 Import price of good 1,
34 PE1 Export price of good 1,
35 PM2 Import price of good 2,
36 TM2 Import tariff for good 2;
37
38 PE1 = 1;
39 PM2 = 1;
40 PE2 = 0.99;
41 PM1 = 1.01;
42 TM2 = 0.20;
43
44
45 $ONTEXT
46
47 $MODEL:M43
48
49
50 $SECTORS:
51 X1 ! Production index for good 1
52 X2 ! Production index good 2
53 E1 ! Export level of good 1
54 E2 ! Export level of good 2
55 M1 ! Import level of good 1
56 M2 ! Import level of good 2
57 W ! Welfare index
58
59 $COMMODITIES:
60 P1 ! Price index for good 1
61 P2 ! Price index for good 1
62 PFX ! Read exchange rate index
63 PW ! Welfare price index
64 PL ! Wage index
65 PK ! Capital rental index
66
67 $CONSUMERS:
68 CONS ! Income level for representative agent
69
70 * Cobb-Douglas production in both sectors:
71
62
72 $PROD:X1 s:1
73 O:P1 Q:150
74 I:PL Q:100
75 I:PK Q: 50
76
77 $PROD:X2 s:1
78 O:P2 Q:33.33333 P:1.2
79 I:PL Q:20
80 I:PK Q:20
81
82 $PROD:E1
83 O:PFX Q:(50*PE1)
84 I:P1 Q:50
85
86 $PROD:M2
87 O:P2 Q:50
88 I:PFX Q:(50*PM2) A:CONS T:TM2
89
90 $PROD:E2
91 O:PFX Q:(50*PE2)
92 I:P2 Q:(50)
93
94 $PROD:M1
95 O:P1 Q:50
96 I:PFX Q:(50*PM1)
97
98 $PROD:W s:1
99 O:PW Q:200
100 I:P1 Q:100
101 I:P2 Q:83.33333 P:1.2
102
103 $DEMAND:CONS
104 D:PW Q:200
105 E:PL Q:120
106 E:PK Q: 70
107
108 $OFFTEXT
109 $SYSINCLUDE mpsgeset M43
110
111 PW.FX = 1;
112
113 * Benchmark replication
114
115 E1.L = 1;
116 M2.L = 1;
117 E2.L = 0;
118 M1.L = 0;
119 P2.L = 1.2;
120
121 M43.ITERLIM = 0; $INCLUDE M43.GEN SOLVE M43 USING MCP; M43.ITERLIM =
122 2000;
123
124 * Counterfactual experiment is free trade
125
126 TM2 = 0;
127
128 $INCLUDE M43.GEN
129 SOLVE M43 USING MCP;
63
Exercise:
Choices of units with which to interpret the data is a dull, but important step. Many calibration
problems (failure to replicate the data as an initial equilibrium) can be traced to mistakes over price
and quantity units when there are taxes or quotas in the initial data. So spend some time comparing
this le to M42. Run the models and verify that all results on activity levels and welfare are the
same.
This model assumes the same benchmark data as the previous two models, but it assumes that
there is a quota limiting imports. A quota is a quantitative restriction on imports, generally a
maximum restriction although there could conceivably be a minimum quota. The former generates
a gap between the foreign or world supply price and the domestic demand price for the rationed
good. This dierence, often referred to as a quota rent (it is a form of Ricardian rent), must go to
some agent.
In this model, we assume that the government implements the quota via the creation of licenses.
These licenses may be auctioned o, sometimes referred to as an auction quota. Or they may simply
be given out to some agents inside the economy. Since we have only a single representative household
in this model, the model cannot really distinguish between these two. But in a model with several
households it can produce an important dierence. Indeed, quota licenses are sometimes a source of
corruption in real economies, generating rents for favored individuals (the license owners) without
them having to produce anything at all.
Using a trick that may now seem familiar from earlier models, we use an auxiliary variable, Q, for
an endogenous tax rate and a constraint equation to set the value of this tax. The revenue from
this tax is assigned to the representative consumer in the block for the import demand for M2.
$PROD:M2
O:P2 Q:60
I:PFX Q:(60*PM2) A:CONS N:Q
The constraint equation says to set the value of the tax Q such that the activity level for imports
(calibrated to be 1 initially) remains equal to 1 in the new equilibrium.
$CONSTRAINT:Q
1 =G= M2;
Other aspects of the model should be familiar. We return here to the convention of model 42 that
units are chosen such that all domestic prices equal 1. The counterfactual experiment is to set
the quota equal to zero. This is done with the statement Q.FX = 0; since Q is a variable, not a
parameter. An alternative way to do this is to declare a parameter and use it in place of the 1 on
the left-hand side of the constraint equation. Then the quota can be set at any level.
The value of Q can be thought of as the tari equivalent of the quota or the shadow tari. In
one exercise following the model, you are asked to increase the size of the economy and see what
happens to this shadow tari. To free up a variable when it has been xed, use:
Q.L = 0;
Q.UP = +INF.
64
1 $TITLE Model M44: Small open economy model with a (auction) quota
2
3 $ONTEXT
4
5 In this example, units are chosen such that all DOMESTIC prices equal
6 one initially. Implied world prices are then P1/P2 = 1.2
7
8 Production Sectors Consumer
9
10 Markets | X1 X2 E1 M2 W CONS
11 ------------------------------------------------------------------
12 P1 | 150 -50 -100
13 P2 | 40 60 -100
14 PL | -100 -20 120
15 PK | -50 -20 70
16 PW | 200 -200
17 PFX | 50 -50
18 Q (quota rent)| -10 10
19 ------------------------------------------------------------------
20
21 $OFFTEXT
22
23 PARAMETERS
24
25 PE2 Export price of good 2,
26 PM1 Import price of good 1,
27 PE1 Export price of good 1,
28 PM2 Import price of good 2,
29 TM2 Import tariff for good 2;
30
31 PE1 = 1;
32 PM2 = 1/(1.2);
33 PE2 = PM2*0.99;
34 PM1 = 1.01;
35 TM2 = 0.20;
36
37 $ONTEXT
38
39 $MODEL:M42
40
41 $SECTORS:
42 X1 ! Production index for good 1
43 X2 ! Production index good 2
44 E1 ! Export level of good 1
45 E2 ! Export level of good 2
46 M1 ! Import level of good 1
47 M2 ! Import level of good 2
48 W ! Welfare index
49
50 $COMMODITIES:
51 P1 ! Price index for good 1
52 P2 ! Price index for good 1
53 PFX ! Read exchange rate index
54 PW ! Welfare price index
55 PL ! Wage index
56 PK ! Capital rental index
57
58 $CONSUMERS:
59 CONS ! Income level for representative agent
60
61 $AUXILIARY:
62 Q
63
64 $PROD:X1 s:1
65
65 O:P1 Q:150
66 I:PL Q:100
67 I:PK Q: 50
68
69 $PROD:X2 s:1
70 O:P2 Q:40
71 I:PL Q:20
72 I:PK Q:20
73
74 $PROD:E1
75 O:PFX Q:(50*PE1)
76 I:P1 Q:50
77
78 $PROD:M2
79 O:P2 Q:60
80 I:PFX Q:(60*PM2) A:CONS N:Q
81
82 $PROD:E2
83 O:PFX Q:(60*PE2)
84 I:P2 Q:60
85
86 $PROD:M1
87 O:P1 Q:50
88 I:PFX Q:(50*PM1)
89
90 $PROD:W s:1
91 O:PW Q:200
92 I:P1 Q:100
93 I:P2 Q:100
94
95
96 $DEMAND:CONS
97 D:PW Q:200
98 E:PL Q:120
99 E:PK Q: 70
100
101 $CONSTRAINT:Q
102 1 =G= M2;
103
104 $OFFTEXT
105 $SYSINCLUDE mpsgeset M42
106
107 PW.FX = 1;
108
109 E1.L = 1;
110 M2.L = 1;
111 E2.L = 0;
112 M1.L = 0;
113 Q.L = 0.20;
114
115 M42.ITERLIM = 0;
116 $INCLUDE M42.GEN
117 SOLVE M42 USING MCP;
118 M42.ITERLIM = 2000;
119
120 * Counterfactual experiment is free trade
121
122 Q.FX = 0;
123
124 $INCLUDE M42.GEN
125 SOLVE M42 USING MCP;
66
Exercises:
(1) Free up the quota again (begin with the statements Q.L0 = 0; Q.UP = +INF; where LO stands
for lower bound and UP stands for upper bound). Double factor endowments. (You can declare a
parameter that is multiplied by the factor endowments as in model M1 MPS.) See what happens to
the shadow tari, the value of Q. Can you explain why?
(2) Following this experiment, x Q at Q = 0.20, its initial value so that it is in fact a tari.
Again double the size of the economy and compare the results of this tari experiment to the quota
experiment.
3.3.13 A voluntary export restraint (M45)
In some cases, countries impose a so-called voluntary export restraint (VER), which asks a foreign
country or foreign rms to limit their exports to a certain quota level. The eect of this is to transfer
the quota rents to the foreign country. It is like having a tari and giving the tari revenue to the
foreign government. In order to model this, we introduce a second consumer, denoted CONSF where
F is for foreign and label the domestic consumer as CONSH. CONSF receives the quota rent (shadow
tari revenue) and demands some of the countrys export good, X1. Here the numbers we use:
Production Sectors Consumer
Markets | X1 X2 E1 M2 W CONSH CONSF
----------------------------------------------------------------
P1 | 150 -50 -90 -10
P2 | 40 60 -100
PL | -100 -20 120
PK | -50 -20 70
PW | 190 -190
PFX | 50 -50
Q (ver) | -10 10
----------------------------------------------------------------
This data is implemented in exactly the manner used in the previous example. We declare an
auxiliary variable V, which appears in an N: (endogenous tax) eld on the import activity, and a
constraint equation setting the value of V.
In order to compare this to the auction quota of the previous example, we also declare an auxiliary
quota variable Q which is an endogenous tax paid to the domestic consumer, and set by a second
constraint equation. In the initial benchmark run of the model, we set Q to zero, Q.FX = 0; and
replicate the bechmark. For our rst counterfactual, we replace the VER with the quota using the
syntax noted in the previous model:
Q.LO = 0;
Q.UP = +INF;
V.FX = 0;
Run the model and examine the results. The equilibria are quite dierent and the shadow values (Q
and V) are not the same. The switch to the auction quota creates an income eect which leads the
domestic consumer to demand more goods and more imports at initial prices. But more imports
cannot occur under the quota, so in eect the quota becomes more restrictive and the shadow tari
increases (Q is larger than V). Note that the welfare eect of switching from the VER to the quota
is quite large.
67
1 $TITLE Model M44: Small open economy model with a VER quota
2
3 $ONTEXT
4
5 In this example, units are chosen such that all DOMESTIC prices equal
6 one initially.
7
8 Production Sectors Consumer
9
10 Markets | X1 X2 E1 M2 W CONSH CONSF
11 ------------------------------------------------------------------
12 P1 | 150 -50 -90 -10
13 P2 | 40 60 -100
14 PL | -100 -20 120
15 PK | -50 -20 70
16 PW | 190 -190
17 PFX | 50 -50
18 Q (ver rent)| -10 10
19 ------------------------------------------------------------------
20
21 $OFFTEXT
22
23 PARAMETERS
24
25 PE2 Export price of good 2,
26 PM1 Import price of good 1,
27 PE1 Export price of good 1,
28 PM2 Import price of good 2,
29 TM2 Import tariff for good 2;
30
31 PE1 = 1;
32 PM2 = 1/(1.2);
33 PE2 = PM2*0.99;
34 PM1 = 1.01;
35 TM2 = 0.20;
36
37
38 $ONTEXT
39
40 $MODEL:M42
41
42 $SECTORS:
43 X1 ! Production index for good 1
44 X2 ! Production index good 2
45 E1 ! Export level of good 1
46 E2 ! Export level of good 2
47 M1 ! Import level of good 1
48 M2 ! Import level of good 2
49 W ! Welfare index
50
51 $COMMODITIES:
52 P1 ! Price index for good 1
53 P2 ! Price index for good 1
54 PFX ! Read exchange rate index
55 PW ! Welfare price index
56 PL ! Wage index
57 PK ! Capital rental index
58
59 $CONSUMERS:
60 CONSH ! Income level for domestic consumer
61 CONSF ! Income level for foreign consumer (quota holder)
62
63 $AUXILIARY:
64 V ! Endogenous tax, shadow tax for VER
68
65 Q ! Endogenous tax, shadow tax for quota
66
67 $PROD:X1 s:1
68 O:P1 Q:150
69 I:PL Q:100
70 I:PK Q: 50
71
72 $PROD:X2 s:1
73 O:P2 Q:40
74 I:PL Q:20
75 I:PK Q:20
76
77 $PROD:E1
78 O:PFX Q:(50*PE1)
79 I:P1 Q:50
80
81 $PROD:M2
82 O:P2 Q:60
83 I:PFX Q:(60*PM2) A:CONSF N:V A:CONSH N:Q
84
85 $PROD:E2
86 O:PFX Q:(60*PE2)
87 I:P2 Q:60
88
89 $PROD:M1
90 O:P1 Q:50
91 I:PFX Q:(50*PM1)
92
93 $PROD:W s:1
94 O:PW Q:190
95 I:P1 Q: 90
96 I:P2 Q:100
97
98 $DEMAND:CONSH
99 D:PW Q:190
100 E:PL Q:120
101 E:PK Q: 70
102
103 $DEMAND:CONSF
104 D:P1 Q:10
105
106 $CONSTRAINT:V
107 1 =G= M2;
108
109 $CONSTRAINT:Q
110 1 =G= M2;
111
112 $OFFTEXT
113 $SYSINCLUDE mpsgeset M42
114
115 PW.FX = 1;
116
117 E1.L = 1;
118 M2.L = 1;
119 E2.L = 0;
120 M1.L = 0;
121 V.L = 0.20;
122 Q.FX = 0;
123
124 M42.ITERLIM = 0;
125 $INCLUDE M42.GEN
126 SOLVE M42 USING MCP;
127 M42.ITERLIM = 2000;
128
69
129 * Counterfactual: replace the VER with an auction quota
130
131 Q.LO = 0;
132 Q.UP = +INF;
133 V.FX = 0;
134
135 $INCLUDE M42.GEN
136 SOLVE M42 USING MCP;
Exercise:
Replace the initial VER with a tari of 0.20 on the import good. Assign the tari revenue to
agent CONSF. Show that this replicates the benchmark data. Show that a tari of 0.20 assigned to
CONSH does not replicated the auction quota calculated in the counterfactual. Why not?
3.3.14 Benchmark trade imbalance (M46)
Real economies are dynamic and therefore real economies can run trade imbalances in any period
by buying or selling assets. Any real data that a modeler is likely to encounter will almost surely
have a current account surplus or decit in any one period. Yet static models are useful for policy
analysis and dynamic models are costly to construct in terms of time and data.
When a modeler wants to construct a static model starting with data characterized by a trade
imbalance, the model has several choices. These are sometime referred to as closure rules. Some
closure rules allow the trade balance to vary when doing counterfactuals. The problem with this
practice is that it makes welfare eects dicult to interpret. If a policy experiment leads to an
increase in the decit, welfare will increase due, in fact, to foreign borrowing. This is misleading,
since at some point that borrowing will have to be paid back.
In general, we prefer to hold the decit xed when doing counterfactuals in static models, so as to
produce more easily interpreted welfare results. Model M46 shows how to do this.
The simplest trick is to just assume that the representative consumer has an initial endowment of
foreign exchange equal to the decit. We can think of this as the amount of foreign borrowing in
the initial benchmark equilibrium. This is then held constant in any counterfactual experiments.
An initial surplus can be represented by a negative endowment of PFX in the benchmark, denoting
foreign lending.
This is what we do below. Benchmark exports are 40, imports are 60, and the decit is nanced by
selling the initial benchmark endowment of 20 units of PFX. The latter is specied by the parameter
BOPDEF which we can change in counterfactual experiments.
$DEMAND:CONS
D:PW Q:220
E:PL Q:120
E:PK Q: 80
E:PFX Q:BOPDEF
For a counterfactual, we eliminate the decit, setting BOPDEF = 0. Obviously, welfare is going to
fall.
This leads us to a short discussion about another modeling technique. Sometimes, modelers have
good reason to believe that the benchmark data is not an equilibrium, or wish to conduct experiments
70
starting from some other benchmark situation. In such situations, the modeler can compute a
revised benchmark by eliminating the source of disequilibrium to generate a new benchmark data
set. In the present case, if the modeler wanted to start with a situation of a zero balance of trade,
the model can then benchmark the model as we have done, and then run the model with BOPDEF
= 0. The new equilibrium values of activities, prices, and income then become the new data set or
revised benchmark for policy analysis.
1 $TITLE Model M46: SOE model with a benchmark trade * imbalance.
2
3 $ONTEXT
4
5 Production Sectors Consumer
6
7 Markets | X1 X2 E1 M2 W CONS
8 ------------------------------------------------------------------
9 P1 | 150 -40 -110
10 P2 | 50 60 -110
11 PL | -100 -20 120
12 PK | -50 -30 80
13 PW | 220 -220
14 PFX | 40 -60 20
15 ------------------------------------------------------------------
16
17 $OFFTEXT
18
19 PARAMETERS
20 PE2 Export price of good 2,
21 PM1 Import price of good 1,
22 PE1 Export price of good 1,
23 PM2 Import price of good 2,
24 TM2 Import tariff for good 2,
25 BOPDEF Balance of payments net deficit;
26
27 PE1 = 1;
28 PM2 = 1;
29 PE2 = 0.99;
30 PM1 = 1.01;
31 TM2 = 0;
32
33 $ONTEXT
34
35 $MODEL:M46
36
37 $SECTORS:
38 X1 ! Production index for good 1
39 X2 ! Production index good 2
40 E1 ! Export level of good 1
41 E2 ! Export level of good 2
42 M1 ! Import level of good 1
43 M2 ! Import level of good 2
44 W ! Welfare index
45
46 $COMMODITIES:
47 P1 ! Price index for good 1
48 P2 ! Price index for good 1
49 PFX ! Read exchange rate index
50 PW ! Welfare price index
51 PL ! Wage index
52 PK ! Capital rental index
53
54 $CONSUMERS:
55 CONS ! Income level for representative agent
71
56
57 $PROD:X1 s:1
58 O:P1 Q:150
59 I:PL Q:100
60 I:PK Q: 50
61
62 $PROD:X2 s:1
63 O:P2 Q:50
64 I:PL Q:20
65 I:PK Q:30
66
67 $PROD:E1
68 O:PFX Q:(40*PE1)
69 I:P1 Q:40
70
71 $PROD:M2
72 O:P2 Q:60
73 I:PFX Q:(60*PM2) A:CONS T:TM2
74
75 $PROD:E2
76 O:PFX Q:(60*PE2)
77 I:P2 Q:60
78
79 $PROD:M1
80 O:P1 Q:40
81 I:PFX Q:(40*PM1)
82
83 $PROD:W s:1
84 O:PW Q:220
85 I:P1 Q:110
86 I:P2 Q:110
87
88 $DEMAND:CONS
89 D:PW Q:220
90 E:PL Q:120
91 E:PK Q: 80
92 E:PFX Q:BOPDEF
93
94 $OFFTEXT
95 $SYSINCLUDE mpsgeset M46
96
97
98 E2.L = 0;
99 M1.L = 0;
100 E1.L = 1;
101 M2.L = 1;
102 BOPDEF = 20;
103
104 M46.ITERLIM = 0;
105 $INCLUDE M46.GEN
106 SOLVE M46 USING MCP;
107 M46.ITERLIM = 2000;
108
109 * Compute a counterfactual experiment setting the deficit to zero.
110
111 BOPDEF = 0;
112
113 $INCLUDE M46.GEN
114 SOLVE M46 USING MCP;
115
72
Exercise:
Set BOPDEF to a negative value (a surplus) and see what happens. Interpret the results.
3.3.15 An Armington formulation (M47)
Another feature of real data that confronts modelers is that there is generally two-way trade in any
good in the data; that is, each good is both imported and exported. This is often attributed to
the fact that data is actually classied by industries and any industry is actually an aggregation of
many goods. Yet two-way trade or cross hauling will persist in the data even at an extremely ne
level of disaggregation. No research will ever get data that is free of cross hauling so the question is
what to do about it.
Model 47 is calibrated to the following data:
Production Sectors Consumer
Markets | X1 X2 E M W CONS
---------------------------------------------------------------
P1 | 150 -100 50 -100
P2 | 50 -25 75 -100
PL | -100 -20 120
PK | -50 -30 80
PW | 200 -200
PFX | 125 -125
---------------------------------------------------------------
Each good (industry) is both imported and exported. One way to handle this is to simply net out
the two way trade from the gross ows and replace the data with net trade only. If we do this in
the present model, we arrive exactly at model M41. We can then proceed as before.
The other alternative in competitive models is to assume that the domestic and foreign goods are
not really identical. This is the so-called Armington assumption: domestic and foreign goods in the
same industrial classication are imperfect substitutes. This is really quite simple for us in MPS/GE.
We do not have to do anything on the production side or in the demand blocks. Indeed, all that we
have to do is to change the preferences to dene four distinct goods and a nesting structure for the
utility function. In our case we write this as:
$PROD:W s:1 G1:ESUB G2:ESUB
O:PW Q:200
I:P1 Q: 50 G1:
I:PF1 Q: 50 G1:
I:P2 Q: 25 G2:
I:PF2 Q: 75 G2:
The modeler is completely free to choose any nesting structure of course, but this is a common thing
to do. The domestic (P1) and foreign good (PF1) in industry 1 are in a nest as are the domestic
and foreign goods in industry 2 and these nest have the same elasticity of substitution: a domestic
and foreign good in the same industry have the same substitution elasticity regardless of industry.
The composite industry 1 good and the composite industry 2 good are then combined in an upper
level nest. This is generally assumed to have a lower elasticity of substitution: two industries are
poor substitutes than a domestic and foreign good in the same industry. Here we specify the upper
73
nest with an elasticity of substitution of 1, while the domestic-foreign goods have an elasticity of
substitution of ESUB = 4.
Other assumptions are possible, such as grouping all foreign goods together in a nest and all domestic
goods in another. But the procedure just outlined seems reasonable to many modelers.
The rest of the program is rather familiar, except that the four trade activities are now dened for
four distinct goods. There is no need now to worry about a domestic good being both imported and
exported. It cannot, by denition, be imported.
After the replication check, we run the same counterfactuals that we did for model M41, a tari of
5% and then 10% on (foreign) good 2.
1 $TITLE Model M47: SOE model with an Armington formulation.
2
3 $ONTEXT
4
5 Production Sectors Consumer
6
7 Markets | X1 X2 E M W CONS
8 ---------------------------------------------------------------
9 P1 | 150 -100 50 -100
10 P2 | 50 -25 75 -100
11 PL | -100 -20 120
12 PK | -50 -30 80
13 PW | 200 -200
14 PFX | 125 -125
15 ---------------------------------------------------------------
16
17 $OFFTEXT
18
19 PARAMETERS
20 PE2 Export price of good 2,
21 PM1 Import price of good 1,
22 PE1 Export price of good 1,
23 PM2 Import price of good 2,
24 TM2 Import tariff for good 2,
25 ESUB Armington elasticity of substitution;
26
27 PE1 = 1;
28 PM2 = 1;
29 PE2 = 1;
30 PM1 = 1;
31 TM2 = 0;
32 ESUB = 4;
33
34
35 $ONTEXT
36
37 $MODEL:M47
38
39 $SECTORS:
40 X1 ! Production index for good 1
41 X2 ! Production index good 2
42 E1 ! Export index for good 1
43 E2 ! Export index for good 2
44 M1 ! Import index for good 1
45 M2 ! Import index for good 2
46 W ! Welfare index
47
48 $COMMODITIES:
74
49 P1 ! Price index for good 1
50 P2 ! Price index for good 1
51 PF1 ! Price index for imported good 1
52 PF2 ! Price index for imported good 2
53 PFX ! Read exchange rate index
54 PW ! Welfare price index
55 PL ! Wage index
56 PK ! Capital rental index
57
58 $CONSUMERS:
59 CONS ! Income level for representative agent
60
61 * Cobb-Douglas production in both sectors:
62
63 $PROD:X1 s:1
64 O:P1 Q:150
65 I:PL Q:100
66 I:PK Q: 50
67
68 $PROD:X2 s:1
69 O:P2 Q:50
70 I:PL Q:20
71 I:PK Q:30
72
73 * We scale the export price for good 1 and the import price
74 * for good 2 to both be unity:
75
76 $PROD:E1
77 O:PFX Q:(PE1*100)
78 I:P1 Q:100
79
80 $PROD:E2
81 O:PFX Q:(PE2*25)
82 I:P2 Q:25
83
84 $PROD:M1
85 O:PF1 Q:50
86 I:PFX Q:(PM1*50)
87
88 $PROD:M2
89 O:PF2 Q:75
90 I:PFX Q:(PM2*75) A:CONS T:TM2
91
92 $PROD:W s:1 G1:ESUB G2:ESUB
93 O:PW Q:200
94 I:P1 Q: 50 G1:
95 I:PF1 Q: 50 G1:
96 I:P2 Q: 25 G2:
97 I:PF2 Q: 75 G2:
98
99 $DEMAND:CONS
100 D:PW Q:200
101 E:PL Q:120
102 E:PK Q: 80
103
104 $OFFTEXT
105 $SYSINCLUDE mpsgeset M47
106
107 PW.FX = 1;
108
109
110 M47.ITERLIM = 0;
111 $INCLUDE M47.GEN
112 SOLVE M47 USING MCP;
75
113 M47.ITERLIM = 2000;
114
115
116 TM2 = 0.05;
117
118 $INCLUDE M47.GEN
119 SOLVE M47 USING MCP;
120
121 TM2 = 0.10;
122
123 $INCLUDE M47.GEN
124 SOLVE M47 USING MCP;
3.3.16 Large open economy (M48)
For many countries, or for a small number of commodities for one country, the small- country
assumption of xed world prices may not be appropriate. One alternative is of course to model the
whole world. But it may be convenient and appropriate for the modeler to stick with the country
and question and continue to represent the rest of the world with trade transformation functions.
The purpose of this model is to show how to do this, allowing for prices to change with quantities
supplied and demanded.
The powerful features of MPS/GE come with a few costs. One is that production blocks (which
are actually cost functions in the background) must be specied with constant returns to scale. Yet
having one xed factor can allow output as a function of one or more variable factors to mimic
decreasing returns as we showed in model M25. We will show how to incorporate increasing returns
to scale in the next chapter.
We will use a specic factor trick to make the foreign exchange received for exports of X1 a strictly
concave function of export volume. We will create a cticious factor called R (price PR) which is a
second input into the export function. This factor is owned by a foreign consumer called CONSF
and this consumer demands foreign exchange (price PFX). In the benchmarking procedure, we scale
up the output of export activity E1 so that when the cticious factor is paid the value of its marginal
product, the same amount of foreign exchange is left for the domestic economy as in the original
small-economy benchmarking. Here is the data matrix, which is just a revision of M41, adding the
cticious factor and scaling up the output of E1 to pay for the factor.
Production Sectors Consumer
Markets | X1 X2 E1 M2 W CONSH CONSF
----------------------------------------------------------------
P1 | 150 -50 -100
P2 | 50 50 -100
PL | -100 -20 120
PK | -50 -30 80
PW | 200 -200
PFX | 100 -50 -50
PR | -50 50
----------------------------------------------------------------
Consumer CONSF owns the cticious factor (price PR) but the amount of foreign exchange left over
from exports of good 1, equal to 50, leaves 50 units of FX for the domestic consumer. Here is the
production block for activity E1.
$PROD:E1 s:1
O:PFX Q:100
76
I:P1 Q: 50
I:PR Q: 50
We have specied this as a Cobb-Douglas function, so we are assuming that it is of the form:
FX =
_
X
1
R
X
1
FX
Hence:
FX
X
1
= 0.5
The elasticity of foreign exchange revenues with respect to export quantity is 0.5. Think of FX as
revenue: FX = p1(X1)X1. Then if you do the algebra, you get:
FX
X
1
= p
1
+X
1
dp
1
dX
1
X
1
FX
dFX
dX
1
= 1 +
X
1
p
1
(dp
1
/dX
1
)
= 1 + 1/
where is the elasticity of demand. If the elasticity of foreign exchange with respect to export
quantity is 0.5, then we are implicitly calibrating the elasticity of foreign demand for our exports
to be - 2. Notice that an innite elasticity of demand for our exports means that the elasticity of
foreign exchange with respect to export quantity is 1, the small country assumption.
Note that by choosing the share parameter on the Cobb-Douglas function E1, we can calibrate to
any foreign elasticity of export demand that we like. This is done by varying the amount of R
relative to X1 in the benchmarking, remembering to scale output so that there is always 50 units
left over for the domestic consumer.
Now run the model. For a counterfactual, we have imposed an import tari of 0.20. Note from the
listing le that this increases welfare in the domestic economy. This is the usual optimal tari
argument for a large economy.
1 $TITLE Model M48: Large open economy model: large open economy
2
3 $ONTEXT
4
5 Production Sectors Consumer
6
7 Markets | X1 X2 E1 M2 W CONSH CONSF
8 ----------------------------------------------------------------
9 P1 | 150 -50 -100
10 P2 | 50 50 -100
11 PL | -100 -20 120
12 PK | -50 -30 80
13 PW | 200 -200
14 PFX | 100 -50 -50
15 PR | -50 50
16 ----------------------------------------------------------------
17
18 $OFFTEXT
19
77
20 PARAMETER
21 TM2 Import tariff for good;
22
23 TM2 = 0;
24
25 $ONTEXT
26
27 $MODEL:M48
28
29 $SECTORS:
30 X1 ! Production index for good 1
31 X2 ! Production index good 2
32 E1 ! Export index of good 1
33 E2 ! Export index of good 2
34 M1 ! Import level of good 1
35 M2 ! Import level of good 2
36 W ! Welfare index
37
38 $COMMODITIES:
39 P1 ! Price index for good 1
40 P2 ! Price index for good 1
41 PFX ! Read exchange rate index
42 PW ! Welfare price index
43 PL ! Wage index
44 PK ! Capital rental index
45 PR ! Rent which generates the export demand function
46
47 $CONSUMERS:
48 CONSH ! Income level for representative home agent
49 CONSF ! Income level for representative foreign agent
50
51 $PROD:X1 s:1
52 O:P1 Q:150
53 I:PL Q:100
54 I:PK Q: 50
55
56 $PROD:X2 s:1
57 O:P2 Q:50
58 I:PL Q:20
59 I:PK Q:30
60
61 $PROD:E1 s:1
62 O:PFX Q:100
63 I:P1 Q: 50
64 I:PR Q: 50
65
66 $PROD:M2
67 O:P2 Q:50
68 I:PFX Q:50 A:CONSH T:TM2
69
70 $PROD:E2
71 O:PFX Q:(50*0.99)
72 I:P2 Q:50
73
74 $PROD:M1
75 O:P1 Q:50
76 I:PFX Q:(100*1.01)
77
78 $PROD:W s:1
79 O:PW Q:200
80 I:P1 Q:100
81 I:P2 Q:100
82
83 $DEMAND:CONSH
78
84 D:PW Q:200
85 E:PL Q:120
86 E:PK Q: 80
87
88 $DEMAND:CONSF
89 D:PFX Q:50
90 E:PR Q:50
91
92 $OFFTEXT
93 $SYSINCLUDE mpsgeset M48
94
95 E2.L = 0;
96 M1.L = 0;
97
98 M48.ITERLIM = 0;
99 $INCLUDE M48.GEN
100 SOLVE M48 USING MCP;
101 M48.ITERLIM = 2000;
102
103 * Apply a tariff which improves the terms of trade and home
104 * welfare:
105
106 TM2 = 0.05;
107
108 $INCLUDE M48.GEN
109 SOLVE M48 USING MCP;
Exercises:
(1) Compute the relationship between welfare and tari rate for dierent benchmark export demand
functions, where the value share of PR in E1 takes on values 0.25 and 0.75. Do this by changing
the amount of R in the benchmark, remembering to change output accordingly to leave the return
to the domestic consumer equal to 50.
(2) Replace the tari on good 2 imports with a tax on good 1 exports, and show that you can obtain
identical equilibrium values (i.e., demonstrate Lerner symmetry).
3.3.17 Full two-country Heckscher-Ohlin model (M49)
In some cases, the modeler wants to have a world model, or at least a full two-country general-
equilibrium model. That is what we present here. It is a textbook, 2x2x2 Heckscher- Ohlin model:
two counties, two goods, two factors. The X and Y goods, as they are labeled here, are identical
across countries. The factors are labor (L) and capital (K), and the countries are called H (home)
and F (foreign).
You now have most of the building blocks necessary for some quite complicated and realistic models.
In the present case, there is really nothing new, we are just increasing the dimensions of the problems.
Here are the data:
1 XHH YHH XHF YHF XFF YFF XFH YFH WH WF CONSH CONSF
2 PXH 150 -50 -100
3 PYH 50 50 -100
4 PXF 50 50 -100
5 PYF 150 -50 -100
6 PWH 200 -200
7 PWF 200 -200
8 PLH -120 -10 130
79
9 PKH -30 -40 70
10 PLF -40 -30 70
11 PKF -10 -120 130
The notation here for the production activities is (industry or good)(country of production)(country
of sale). Thus YFH, for example, is good Y produced in country F and sold in country H (exported
to country H). The notation for markets and prices should be fairly obvious: PXF for example is
the price of good X in country F.
There is free trade, and so there is factor-price equalization. All prices can be set to one. Country
H is labor abundant and good X is labor intensive. Country F is capital abundant and good Y is
capital intensive.
In our counterfactual experiments, we rst allow country H to impose a tari of 25% and then both
countries impose symmetric taris of 25%.
1 $TITLE: Model M49: 2X2X2 HECKSCHER-OHLIN MODEL
2
3 * This is a full two-country HO model
4
5 $ONTEXT
6
7 XHH YHH XHF YHF XFF YFF XFH YFH WH WF CONSH CONSF
8
9 PXH 150 -50 -100
10 PYH 50 50 -100
11 PXF 50 50 -100
12 PYF 150 -50 -100
13 PWH 200 -200
14 PWF 200 -200
15 PLH -120 -10 130
16 PKH -30 -40 70
17 PLF -40 -30 70
18 PKF -10 -120 130
19
20 $OFFTEXT
21
22 PARAMETERS
23 TARH
24 TARF;
25
26 TARH = 0;
27 TARF = 0;
28
29 $ONTEXT
30
31 $MODEL:M49
32
33 $SECTORS:
34 WH
35 WF
36 XHH
37 YHH
38 XHF
39 YHF
40 XFF
41 YFF
42 XFH
43 YFH
44
45 $COMMODITIES:
80
46 PWH
47 PWF
48 PXH
49 PXF
50 PYH
51 PYF
52 PLH
53 PLF
54 PKH
55 PKF
56
57 $CONSUMERS:
58 CONSH
59 CONSF
60
61 $PROD:XHH s:1
62 O:PXH Q:150
63 I:PLH Q:120
64 I:PKH Q: 30
65
66 $PROD:YHH s:1
67 O:PYH Q:50
68 I:PLH Q:10
69 I:PKH Q:40
70
71 $PROD:XFF s:1
72 O:PXF Q:50
73 I:PLF Q:40
74 I:PKF Q:10
75
76 $PROD:YFF s:1
77 O:PYF Q:150
78 I:PLF Q: 30
79 I:PKF Q:120
80
81 $PROD:XHF
82 O:PXF Q:50
83 I:PXH Q:50 A:CONSF T:TARF
84
85 $PROD:YHF
86 O:PYF Q:50
87 I:PYH Q:50.1
88
89 $PROD:XFH
90 O:PXH Q:50
91 I:PXF Q:50.1
92
93 $PROD:YFH
94 O:PYH Q:50
95 I:PYF Q:50 A:CONSH T:TARH
96
97
98 $PROD:WH s:1
99 O:PWH Q:200
100 I:PXH Q:100
101 I:PYH Q:100
102
103 $PROD:WF s:1
104 O:PWF Q:200
105 I:PXF Q:100
106 I:PYF Q:100
107
108 $DEMAND:CONSH
109 D:PWH Q:200
81
110 E:PLH Q:130
111 E:PKH Q: 70
112
113 $DEMAND:CONSF
114 D:PWF Q:200
115 E:PLF Q: 70
116 E:PKF Q:130
117
118
119 $OFFTEXT
120 $SYSINCLUDE mpsgeset M49
121
122 YHF.L = 0.; XFH.L = 0.;
123
124 $INCLUDE M49.GEN
125 SOLVE M49 USING MCP;
126
127 * TARIFFS
128
129 TARH = .25;
130
131 $INCLUDE M49.GEN
132 SOLVE M49 USING MCP;
133
134 TARH = .25;
135 TARF = .25;
136
137 $INCLUDE M49.GEN
138 SOLVE M49 USING MCP;
Exercise:
Verify the Stolper-Samuelson theorem by comparing factor prices in free trade versus when one or
both countries have taris.
3.3.18 International capital ows (M410)
Another important feature of economies and also an important policy issue is capital ows or trade
in capital. This can be captured in a static model by adding a market for a factor which is simply
rented from or to foreigners so as to ignore the dynamic and durability issues connected with
capital. This model incorporates a simple extension of our earlier work, particularly M48. We are
going to assume that the country is a price taker in goods markets, but there is a less-than-perfectly-
elastic supply of capital to the country. Once again, we create a ctitious factor R (price PR) which
is a xed factor in a function (KM) transforming foreign exchange into capital and that ctitious
factor is owned by a foreign consumer. All in all, the model is very similar to M48, except that now
we have three things traded in the benchmark: good 1 is exported, good 2 is imported, and capital
is imported. Here is the benchmark data, in which 20 units of capital are imported initially.
Production Sectors Consumer
Markets | X1 X2 E1 M2 KM W CONSH CONSF
----------------------------------------------------------------
P1 | 170 -70 -100
P2 | 50 50 -100
PL | -120 -20 140
PK | -50 -30 20 60
PW | 200 -200
82
PFX | 70 -50 -10 -10
PR | -10 10
----------------------------------------------------------------
Here is the production block for KM:
$PROD:KM s:1
O:PK Q:20
I:PFX Q:10
I:PR Q:10
The counterfactual experiment is to impose a 5% tari. You will see that this generates an increase
in capital imports, because good 2, the protected import sector is capital intensive and protection
thus raises the return to capital (the Stolper-Samuleson theorem). Welfare of course decreases.
In order to make a simple economics point, we run a second experiment in which we impose the tari
but x capital imports at their benchmark level of KM = 1 (20 units of capital imported are the
reference quantity for activity level KM = 1). Note that welfare decreases less under this constraint.
This is an old result from a paper by Brecher and Alejandro, that capital imports generated by a
tari protecting a capital intensive sector have a secondary, negative welfare eect. Added capital
imports allow more costly domestic production of good 2 to displace additional cheap imports, thus
creating an added welfare loss.
1 $TITLE Model M410: Capital imports (less than perfect elastic)
2
3 $ONTEXT
4
5 Production Sectors Consumer
6
7 Markets | X1 X2 E1 M2 KM W CONSH CONSF
8 ----------------------------------------------------------------
9 P1 | 170 -70 -100
10 P2 | 50 50 -100
11 PL | -120 -20 140
12 PK | -50 -30 20 60
13 PW | 200 -200
14 PFX | 70 -50 -10 -10
15 PR | -10 10
16 ----------------------------------------------------------------
17
18 $OFFTEXT
19
20 PARAMETER
21 TM2 Import tariff for good X2;
22
23 TM2 = 0;
24
25 $ONTEXT
26
27 $MODEL:M410
28
29 $SECTORS:
30 X1 ! Production index for good 1
31 X2 ! Production index good 2
32 E1 ! Export index of good 1
33 E2 ! Export index of good 2
83
34 M1 ! Import level of good 1
35 M2 ! Import level of good 2
36 KM ! Capital imports
37 W ! Welfare index
38
39 $COMMODITIES:
40 P1 ! Price index for good 1
41 P2 ! Price index for good 1
42 PFX ! Read exchange rate index
43 PW ! Welfare price index
44 PL ! Wage index
45 PK ! Capital rental index
46 PR ! Rent which generates concavity in capital supply
47
48 $CONSUMERS:
49 CONSH ! Income level for representative home agent
50 CONSF ! Income level for representative foreign agent
51
52 $PROD:X1 s:1
53 O:P1 Q:170
54 I:PL Q:120
55 I:PK Q: 50
56
57 $PROD:X2 s:1
58 O:P2 Q:50
59 I:PL Q:20
60 I:PK Q:30
61
62 $PROD:E1 s:1
63 O:PFX Q:70
64 I:P1 Q:70
65
66 $PROD:M2
67 O:P2 Q:50
68 I:PFX Q:50 A:CONSH T:TM2
69
70 $PROD:E2
71 O:PFX Q:(50*0.99)
72 I:P2 Q:50
73
74 $PROD:M1
75 O:P1 Q:50
76 I:PFX Q:(100*1.01)
77
78 $PROD:KM s:1
79 O:PK Q:20
80 I:PFX Q:10
81 I:PR Q:10
82
83 $PROD:W s:1
84 O:PW Q:200
85 I:P1 Q:100
86 I:P2 Q:100
87
88 $DEMAND:CONSH
89 D:PW Q:200
90 E:PL Q:140
91 E:PK Q:60
92
93 $DEMAND:CONSF
94 D:PFX Q:10
95 E:PR Q:10
96
97 $OFFTEXT
84
98 $SYSINCLUDE mpsgeset M410
99
100 E2.L = 0;
101 M1.L = 0;
102
103 PW.FX = 1;
104
105 M410.ITERLIM = 0;
106 $INCLUDE M410.GEN
107 SOLVE M410 USING MCP;
108 M410.ITERLIM = 2000;
109
110
111 TM2 = 0.05;
112
113 $INCLUDE M410.GEN
114 SOLVE M410 USING MCP;
115
116 KM.FX = 1;
117
118 $INCLUDE M410.GEN
119 SOLVE M410 USING MCP;
3.4 Modeling Consumer Demand with MPSGE
3.4.1 Evaluating a Demand Function
Consider a standard consumer choice problem, one which might appear on a midterm examination
in intermediate microeconomics:
max U(x, y) = ln(x) + 2ln(y)
subject to:
1x + 2y = 120
where 1 is the exogenous price of x and 2 is the price of y.
This type of problem is solved easily using GAMS/MINOS (as a nonlinear program). Strictly
speaking, it is not the sort of model for which you would need to use MPSGE. At the same time,
this can be an instructive example.
The key issue in this example is learning how to represent utility functions. MPSGE is non-
algebraic so function specication depends on an intuitive understanding of the underlying eco-
nomic structure.
Consider Figure 5 and focus on a single point, x=1, y=1. There is an indierence curve through this
point, and the marginal rate of substitution (MRS) at this point is simply the slope of this curve.
The benchmark MRS does not uniquely determine the underlying preferences.
Figure 5: A Calibrated Benchmark
A utility function is represented in MPSGE by the specication of: (i) benchmark demand quantities,
(ii) benchmark demand prices (iii) an elasticity of substitution at the benchmark point. Benchmark
quantities determine an anchor point for the set of indierence curves. Benchmark prices x the
slope of the indierence curve at that point, and the elasticity describes the curvature of the indif-
ference curve. Speaking formally, elasticities provide a second order approximation of the utility
85
function. To understand the importance of the benchmark elasticity of substitution, consider Figure
6. This gure shows three indierence curves all of which share the same benchmark quantities and
benchmark prices. They dier only in the elasticities of substitution. The least convex (attest)
curve has the highest elasticity, the most convex curve has the lowest elasticity. (When the elasticity
of substitution is 0, the indierence curve is L-shaped with the corner at the benchmark point.)
Figure 6: The Elasticity of Substitution
Let us now consider how the consumer optimization problem can be cast as a general equilibrium
model. We do this by adding a single factor of production and two production sectors. For
concreteness, let the factor of production be called labor with a price PL. One production function
converts one unit of labor into one unit of x, the other sector converts 2 units of labor into one unit
of y. Setting the labor endowment equal 120, the market clearance condition for labor reads:
1x + 2y = 120
which is precisely the budget constraint for the consumers problem.
We will now present the program code, a few lines at a time. As part of working through the
example, the student should type these lines into a le.
A MPSGE model specication is always listed between $ONTEXT and $OFFTEXT statements. The
rst statement within an MPSGE model-description assigns a name to the model. The model name
must begin with a letter and must have 10 or fewer characters.
1 $ONTEXT
2
3 $MODEL:DEMAND
4
5 * The model specification begins by declaring variables for the model.
6 * In a standard model, there are three types of variables: commodity
7 * prices, sectoral activity levels, and consumer incomes. The end of
8 * each line may include "! variable description ".
9
10 * N.B. The variables associated with commodities are prices, not
11 * quantities. (In this and subsequent models, I use P as the first
12 * letter for each of the commodity variables to remind us that these
13 * variables are prices.)
14
15 * N.B. The variable associated with a consumer is an income level, not
16 * a welfare index.
17
18 $SECTORS:
19 X ! ACTIVITY LEVEL FOR X = DEMAND FOR GOOD X
20 Y ! ACTIVITY LEVEL FOR Y = DEMAND FOR GOOD Y
21
22 $COMMODITIES:
23 PX ! PRICE OF X WHICH WILL EQUAL PL
24 PY ! PRICE OF Y WHICH WILL EQUAL 2 PL
25 PL ! PRICE OF THE ARTIFICIAL FACTOR L
26
27 $CONSUMERS:
28 RA ! REPRESENTATIVE AGENT INCOME
29
30 * Function specifications follow the variable declarations. In this
31 * model, our first declarations correspond to the two production
32 * sectors. In this model, the production structures are particularly
33 * simple. Each of the sectors has one input and one output. In the MPSGE
86
34 * syntax, I: denotes an input and O: denotes an output. The output
35 * quantity coefficients for both sectors are unity (Q:1). This means
36 * that the level values for x and y correspond to the actual quantities
37 * produced.
38
39 * The final function specified in the model represents the utility
40 * function and endowments for our single consumer. In this function, the
41 * E: entries correspond to endowments and the D: entries are demands.
42 * Reference demands, reference prices and the substitution elasticity
43 * (s:1) characterize preferences.
44
45 * The demand entries shown here are consistent with a Cobb-Douglas
46 * utility function in which the budget share for y is twice the budget
47 * share for x (i.e. the MRS at (1,1) equals 1/2):
48
49 $PROD:X
50 O:PX Q:1
51 I:PL Q:1
52
53 $PROD:Y
54 O:PY Q:1
55 I:PL Q:2
56
57 $DEMAND:RA s:1
58 E:PL Q:120
59 D:PX Q:1 P:(1/2)
60 D:PY Q:1 P:1
61
62 $OFFTEXT
63
64 * The final three statements in this file invoke the MPSGE
65 * preprocessor, "generate" and solve the model:
66
67 $SYSINCLUDE mpsgeset DEMAND
68
69 $INCLUDE DEMAND.GEN
70 SOLVE DEMAND USING MCP;
71
The preprocessor invocation ($SYSINCLUDE mpsgeset) should be placed immediately following the
$OFFTEXT block containing the model description. The model generator code, DEMAND.GEN, is pro-
duced by the previous statement and must be referenced immediately before each subsequent SOLVE
statement.
At this point, the reader should take the time to type the example into a le and execute the program
with GAMS/MPSGE.
This is possibly the rst GAMS model which some readers have solved, so it is worth looking through
the listing le in some detail. After running the solver, we examine the listing le. I typically begin
my assessment of a models solution by searching for STATUS. For this model, we have the following:
S O L V E S U M M A R Y
MODEL DEMAND
TYPE MCP
SOLVER PATH FROM LINE 263
**** SOLVER STATUS 1 NORMAL COMPLETION
**** MODEL STATUS 1 OPTIMAL
87
RESOURCE USAGE, LIMIT 1.432 1000.000
ITERATION COUNT, LIMIT 5 1000
EVALUATION ERRORS 0 0
Work space allocated -- 4.86 Mb
Default price normalization using income for RA
This information is largely self-explanatory. The most important items are the SOLVER STATUS
and MODEL STATUS indicators. When the solver status is 1 and the model status is 1, the system
has returned an equilibrium.
For small models such as this, the limits on resource usage (time) and solver iterations have no
eect. (You can modify these values with the statements:
model.RESLIM = number of cpu seconds ;
model.ITERLIM = number of iterations ;
entered into the GAMS program before the SOLVE statement and after the $sysinclude mpsgeset
statement.)
The work space allocation for MPSGE models is determined by the number of variables in the model.
It is possible to exogenously specify the work space allocation by assigning
model.WORKSPACE = xx ;
where xx is the desired number of megabytes.
The nal message, Default price normalization..., is signicant. It reminds the user that an
Arrow-Debreu general equilibrium model determines only relative prices. In such an equilibrium,
the absolute scaling of prices is indeterminant. (I.e., if (p*,M*) are a set of equilibrium prices and
income levels, then (2 p*,2 M*) is also a solution, etc.)
It is common practice in economics to address the normalization issue through the specication of a
numeraire commodity. You can do this for an MPSGE model by xing a price, with a statement
like:
PX.FX = 1;
entered following the model declaration ($SYSINCLUDE mpsgeset) but prior to the solver invoca-
tion. When any price or income level is xed, MPSGE recognizes that a numeraire has been specied
and does no automatic normalization.
Following some output from the solver (PATH in this case), the listing le provides a complete
report of equilibrium values. With MPSGE models, the equation listings are superuous. The
variable listings provide all the relevant information.
For this model, the solution listing appears as follows:
88
LOWER LEVEL UPPER MARGINAL
---- VAR X . 40.000 +INF .
---- VAR Y . 40.000 +INF .
---- VAR PX . 1.000 +INF .
---- VAR PY . 2.000 +INF .
---- VAR PL . 1.000 +INF .
---- VAR RA . 120.000 +INF .
X SUPPLY AND DEMAND OF GOOD X
Y SUPPLY AND DEMAND OF GOOD Y
PX PRICE OF X WHICH WILL EQUAL CX * PL
PY PRICE OF Y WHICH WILL EQUAL CY * PL
PL PRICE OF THE ARTIFICIAL FACTOR L
RA REPRESENTATIVE AGENT INCOME
The LOWER and UPPER columns report variable bounds applied in the model. In these columns,
zero is represented by . and innity is represented by +INF. The LEVEL column reports the
solution value returned by the algorithm. Here we see that the equilibrium price of x is 1 and the
price of y is 2, as determined by the specication of labor inputs.
Exercises:
(a) The utility function calibration point is arbitrary. Here, we have selected x=y=1 as the refer-
ence quantity. Revise the program to use a dierent calibration point where x=2 and y=1, where
MRS(2,1) = 1/4. (Remember to modify both the Q: and P: elds.) Rerun the model to demonstrate
that this does not change the result.
(b) Increase the price of x from 1 to 2 by changing the Q: coecient for PL in sector X from 1 to
2. What happens to the demand for x? Explain why a change in the price of x is represented by a
change in the Q: eld for sector X.
(c) Compute an equilibrium in which commodity y is dened as the numeraire.
3.4.2 Evaluating the Marginal Rate of Substitution
This example further explores the representation of demand functions with MPSGE. It sets up a
trivial equilibrium model with two goods and one consumer which returns the marginal rate of
substitution of good x for good y at a given level of demand.
The underlying utility function is:
U(x, y) = ln(x) + 4ln(y)
When x=y=1, the marginal rate of substitution of x for y is 1/4. We use this information to calibrate
the demand function, specifying the ratio of the reference prices of x to y equal to 1/4.
In an equilibrium, nal demand always equals endowments for both goods, because these are the only
sources of demand and supply. The model as parameterized demonstrates that if we set endowments
for this model equal to the demand function calibration point, the model equilibrium price ratio
equals the benchmark MRS.
This program begins with some GAMS statements in which three scalar parameters are declared.
89
These parameters will be used in the place of numbers within the MPSGE model. The syntax for
these GAMS statements is introduced in Chapter 2 of the GAMS manual. In short, we declare x, y
and MRS as scalar parameters and initialize the rst two of these to unity. The MRS parameter is
assigned a value following the solution of the model.
SCALAR
X QUANTITY OF X FOR WHICH THE MRS IS TO BE EVALUATED /1/
Y QUANTITY OF Y FOR WHICH THE MRS IS TO BE EVALUATED /1/
MRS COMPUTED MARGINAL RATE OF SUBSTITUTION;
The remainder of the MPSGE program is, in fact, simpler than the previous example.
1
2 $ONTEXT
3
4 $MODEL:MRSCAL
5
6 $COMMODITIES:
7 PX ! PRICE INDEX FOR GOOD X
8 PY ! PRICE INDEX FOR GOOD Y
9
10 $CONSUMERS:
11 RA ! REPRESENTATIVE AGENT
12
13 $DEMAND:RA s:1
14 D:PX Q:1 P:(1/4)
15 D:PY Q:1 P:1
16 E:PX Q:X
17 E:PY Q:Y
18 $OFFTEXT
19 $SYSINCLUDE mpsgeset MRSCAL
20
21 $INCLUDE MRSCAL.GEN
22 SOLVE MRSCAL USING MCP;
23
Following the solution, we compute a function of the solution values, the ratio of the price of x to
the price of y. We do this using the GAMS syntax which references the equilibrium level values of
the PX and PY and storing this result in the scalar MRS. This scalar value is then displayed in the
listing le with 8 digits:
MRS = PX.L / PY.L;
OPTION MRS:8;
DISPLAY MRS;
Exercises:
(a) Show that the demand function is homothetic by uniform scaling of the x and y endowments.
The resulting MRS should remain unchanged.
(b) Modify the demand function calibration point so that the reference prices of both x and y equal
90
unity (hint: the marginal rate of substitution is:
MRS = x/(4y)
3.4.3 Goods Demand, Leisure Demand and Labor Supply
This model investigates the labor-leisure decision. A single consumer is endowed with labor which
is either supplied to the market or repurchased as leisure. The consumer utility function over
market goods (x and y) and leisure is Cobb-Douglas:
U(x, y, L) = ln(x) +ln(y) +ln(L)
Goods x and y may only be purchased using funds obtained from labor sales. This constraint is
written:
x +y = LPRODLS
where goods x and y both have a price of unity at base year productivity and LPROD is an index of
labor productivity. An increase in productivity is equivalent to a proportional decrease in the prices
of x and y.
The model declaration is as follows:
1
2 SCALAR LPROD AGGREGATE LABOR PRODUCTIVITY /1/,
3 CX COST OF X AT BASE YEAR PRODUCTIVITY /1/,
4 CY COST OF Y AT BASE YEAR PRODUCTIVITY /1/;
5 $ONTEXT
6
7 $MODEL:LSUPPLY
8
9 $SECTORS:
10 X ! SUPPLY=DEMAND FOR X
11 Y ! SUPPLY=DEMAND FOR Y
12 LS ! LABOR SUPPLY
13
14 $COMMODITIES:
15 PX ! MARKET PRICE OF GOOD X
16 PY ! MARKET PRICE OF GOOD Y
17 PL ! MARKET WAGE
18 PLS ! CONSUMER VALUE OF LEISURE
19
20 $CONSUMERS:
21 RA ! REPRESENTATIVE AGENT
22
23 $PROD:LS
24 O:PL Q:LPROD
25 I:PLS Q:1
26
27 $PROD:X
28 O:PX Q:1
29 I:PL Q:CX
30
31 $PROD:Y
32 O:PY Q:1
33 I:PL Q:CY
34
35 $DEMAND:RA s:1
91
36 E:PLS Q:120
37 D:PLS Q:1 P:1
38 D:PX Q:1 P:1
39 D:PY Q:1 P:1
40
41 $OFFTEXT
42 $SYSINCLUDE mpsgeset LSUPPLY
43
44 $INCLUDE LSUPPLY.GEN
45 SOLVE LSUPPLY USING MCP;
46
We can use this model to evaluate the wage elasticity of labor supply. In the initial equilibrium
(computed in the last statement) the demands for x, y and L all equal 40. A subsequent assignment
to LPROD (below) increases labor productivity. After computing a new equilibrium, we can use the
change in labor supply to determine the wage elasticity of labor supply, an important parameter in
labor market studies.
It should be emphasized that the elasticity of labor supply should be an input rather than an output
of a general equilibrium model this is a parameter for which econometric estimates can be obtained.
Here is how the programming works. First, we declare some scalar parameters which we will use for
reporting, then save the benchmark labor supply in LS0:
47
48 SCALAR
49 LS0 REFERENCE LEVEL OF LABOR SUPPLY
50 ELS ELASTICITY OF LABOR SUPPLY WRT REAL WAGE;
51
52 LS0 = LS.L;
53
Next, we modify the value of scalar LPROD, increasing labor productivity by 1%. Because this
is a neoclassical model, this change is equivalent to increasing the real wage by 1%. We need to
recompute equilibrium prices after having changed the LPROD value:
54
55 LPROD = 1.01;
56 $INCLUDE LSUPPLY.GEN
57 SOLVE LSUPPLY USING MCP;
58
We use this solution to compute and report the elasticity of labor supply as the percentage change
in the LS activity:
59
60 ELS = 100 * (LS.L - LS0) / LS0;
61 DISPLAY ELS;
62
As the model is currently constructed, the wage elasticity of labor supply equals zero. This is
because the utility function is Cobb-Douglas over goods and leisure, and the consumers only source
of income is labor. As the real wage rises, this increases both the demand for goods (labor supply)
and the demand for leisure. These eect exactly balance out and the supply of labor is unchanged.
92
Exercises:
(a) One way in which the labor supply elasticity might dier from zero in a model with Cobb-Douglas
nal demand is if there were income from some other source. Let the consumer be endowed with
good x in addition to labor. What x endowment is consistent with a labor supply elasticity equal
to 0.15?
(b) A second way to calibrate the labor supply elasticity is to change the utility function. We can
do this by changing the s:1 to s:SIGMA, where SIGMA is a scalar value representing the benchmark
elasticity of substitution between x, y and L in nal demand. Modify the program to include SIGMA
as a scalar, and nd the value for SIGMA consistent with a labor supply elasticity equal to 0.15.
3.4.4 A Pure Exchange Model
Partial equilibrium analysis forms the basis of most economics courses at the undergraduate level. In
these models we focus on price, supply and demand for a single commodity. The partial equilibrium
approach neglects indirect eects, through which changes in the market for one good may inuence
the market for another good.
In the previous section, we focused on the choices of a single consumer. In the present section, we will
explore the implications of interactions between many consumers with heterogeneous preferences.
Furthermore, the analysis will explore the potentially important interaction between market prices
and income which are determined jointly in a general equilibrium.
The most widely-used graphical framework for multi-agent exchange equilibrium analysis is the
Edgeworth-Bowley box as illustrated in Figure 7. In this diagram we model the following economy:
Figure 7: The Edgeworth-Bowley Box
* Two types of consumers, denoted A and B. We consider A and B to each represent multiple
consumers, each with the same endowments and preferences. This assumption is helpful for justifying
our assumption of perfectly competitive, price-taking behavior.
* Two commodities, denoted x and y
* Fixed endowments of both goods. The horizontal axis measures the total world endowment of
good X. The vertical axis measure the total world endowment of good Y. Any point in the box then
represents an allocation of goods between the two agents. The agent H allocation is measured with
respect to the lower left origin. The agent F allocation is measured with respect to the upper right
origin.
Each agent has a given initial endowment, here denoted point E. Furthermore, we assume that there
is no possibility for trade. The indierence curves through point E therefore represent autarchy
welfare levels.
The key idea in this model is that trade can improve both agents welfare. One agent gives some
amount good x to the other in return for an amount of good y. The terms of trade, the rate of
exchange between x and y, is determined by the model. The model illustrates a number of important
properties of market economies:
* Trade is mutually benecial. So long as the transactions are voluntary, neither H nor F will be
hurt by engaging in trade.
93
* Market prices can be used to guide the economy to a Pareto-ecient allocation, a state of aairs
in which further mutually-benecial trades are not possible.
* There is no guarantee that the gains from trade will be fairly distributed across consumers.
A competitive equilibrium may produce a signicant welfare increase for one consumer while have
negligible impact on the other.
* There are multiple Pareto-ecient allocations, typically only one of which is a competitive equilib-
rium. We can use this model to demonstrate that the issues of eciency and equity can be separated
when there is the possibility of lump-sum income transfers between agents.
It is relatively easy to construct a pure exchange model with MPSGE. As illustration we implement
the simple two good, two agent model of exchange equilibrium. The world endowments for goods x
and y are both equal to 1. Six parameters are used to parameterize the model. These are declared
as scalars at the top of the program:
1
2 SCALAR XA AGENT A ENDOWMENT OF X ( 0 < XA < 1) /0.2/
3 YA AGENT A ENDOWMENT OF Y ( 0 < YA < 1) /0.8/
4 THETA_A AGENT A DEMAND SHARE PARAMETER FOR X /0.5/
5 THETA_B AGENT B DEMAND SHARE PARAMETER FOR X /0.8/
6 SIGMA_A AGENT A ELASTICITY PARAMETER /2.0/
7 SIGMA_B AGENT B ELASTICITY PARAMETER /0.5/;
8
This model is actually simpler than the models presented above because we have no need for pro-
duction. There are simply two commodities and two consumers. The consumers dier in terms of
commodity endowments and preferences. The competitive equilibrium prices are such that supply
equals demand for both goods and both agents spend an amount equal to their endowment income.
This model illustrates how to use computed function coecients. See, for example, Q:(1-THETA A)
in the $DEMAND:A block. Any numeric input eld in an MPSGE model may be computed,
provided that the algebraic expression is enclosed within parentheses and legitimate GAMS code.
This model specication uses the default values for reference prices in the demand function blocks.
When P:value is not specied in a D:,I: or O: record, P:1 is assumed.
This model uses the more general constant-elasticity-of-substitution utility function.
1
2 $ONTEXT
3
4 $MODEL:EXCHANGE
5
6 $COMMODITIES:
7 PX ! EXCHANGE PRICE OF GOOD X
8 PY ! EXCHANGE PRICE OF GOOD Y
9
10 $CONSUMERS:
11 A ! CONSUMER A
12 B ! CONSUMER B
13
14 $DEMAND:A s:SIGMA_A
15 E:PX Q:XA
16 E:PY Q:YA
17 D:PX Q:THETA_A
94
18 D:PY Q:(1-THETA_A)
19
20 $DEMAND:B s:SIGMA_B
21 E:PX Q:(1-XA)
22 E:PY Q:(1-YA)
23 D:PX Q:THETA_B
24 D:PY Q:(1-THETA_B)
25
26 $OFFTEXT
27 $SYSINCLUDE mpsgeset EXCHANGE
28
29 $INCLUDE EXCHANGE.GEN
30 SOLVE EXCHANGE USING MCP;
31
32 SCALAR
33 PRATIO EQUILIBRIUM PRICE OF X IN TERMS OF Y,
34 IRATIO EQUILIBRIUM RATIO OF CONSUMER A INCOME TO CONSUMER B INCOME;
35
36 PRATIO = PX.L / PY.L;
37 IRATIO = A.L / B.L;
38
39 DISPLAY IRATIO, PRATIO;
40
The foregoing sets up the model and computes the competitive equilibrium. After GAMS returns
from the solver, we declare and compute some report values.
Absolute levels of income and price returned from a general equilibrium model are not meaningful
because a model determines only relative prices. For this reason, we report equilibrium income and
price levels in relative terms.
In the nal step, we compute an alternative ecient equilibrium, one in which the income levels
for A and B are equal. The purpose of this exercise is to demonstrate the second welfare theorem.
When incomes are both xed, the equilibrium remains ecient, but the connection between market
prices and endowment income is eliminated.
In GAMS/MPSGE a variable may be xed using the GAMS syntax
variable.fx= value;
as illustrated in this model:
1
2 A.FX = 1;
3 B.FX = 1;
4 $INCLUDE EXCHANGE.GEN
5 SOLVE EXCHANGE USING MCP;
6
7 SCALAR TRANSFER IMPLIED TRANSFER FROM A TO B AS A PERCENTAGE OF INCOME;
8
9 TRANSFER = 100 * ( A.L - PX.L * XA - PY.L * YA ); PRATIO = PX.L / PY.L;
10 IRATIO = A.L / B.L;
11
12 DISPLAY TRANSFER, PRATIO, IRATIO;
13
95
Exercises:
(a) Set up a separate models which computes the autarchy price ratios for consumers A and B. (You
can use one of the earlier models as a starting point.)
(b) Determine parameter values for which the endowment point is the equilibrium point.
(c) Set up a series of computations from which you can sketch the eciency locus. Draw the
Edgeworth box diagram which is consistent with these values.
3.4.5 Import Taris and Market Power in an Exchange Model
The exchange model provides a remarkably useful tool for analyzing issues related to international
trade. Formal trade theory is more complicated with the inclusion of separate production technolo-
gies. We will present some of those models below. Before going forward, however, we will consider a
slight generalization of the 2x2 model exchange model. In this extension, we introduce independent
markets for consumers A and B and trade activities which deliver goods from one market to the
other.
The set of input parameters largely the same as in the previous example. Two new parameters are
ad-valorem taris which apply on imports to each of the regions.
1
2 SCALAR XA AGENT A ENDOWMENT OF X ( 0 le XA le 1) /0.2/
3 YA AGENT A ENDOWMENT OF Y ( 0 le YA le 1) /0.8/
4 THETA_A AGENT A DEMAND SHARE PARAMETER FOR X /0.4/
5 THETA_B AGENT B DEMAND SHARE PARAMETER FOR X /0.6/
6 SIGMA_A AGENT A ELASTICITY PARAMETER /1.0/
7 SIGMA_B AGENT B ELASTICITY PARAMETER /1.0/,
8 T_A AD-VALOREM TARIFF ON IMPORTS TO AGENT A /0.10/
9 T_B AD-VALOREM TARIFF ON IMPORTS TO AGENT B /0.10/;
10
The program diers from the previous example in several respects. First, we introduce a separate
commodity price for each agent. In the absence of taris, these prices are identical.
A second dierence is that in this model trade activities deliver goods from one agent to the other.
These are denoted Mgoodagent for imports of good to agent. There are four ows which may be
operated in only one direction (the activity levels are non-negative). In terms of initial endowments
and preferences, this model has exactly the same economic structure as the previous model.
1
2 $ONTEXT
3
4 $MODEL:TARIFFS
5
6 $SECTORS:
7 MXA ! TRADE IN X FROM B TO A
8 MXB ! TRADE IN X FROM A TO B
9 MYA ! TRADE IN Y FROM B TO A
10 MYB ! TRADE IN Y FROM A TO B
11
12
13 $COMMODITIES:
14 PXA ! PRICE OF GOOD X FOR AGENT A
96
15 PYA ! PRICE OF GOOD Y FOR AGENT A
16 PXB ! PRICE OF GOOD X FOR AGENT B
17 PYB ! PRICE OF GOOD Y FOR AGENT B
18
19 $CONSUMERS:
20 A ! CONSUMER A
21 B ! CONSUMER B
22
23 $DEMAND:A s:SIGMA_A
24 E:PXA Q:XA
25 E:PYA Q:YA
26 D:PXA Q:THETA_A
27 D:PYA Q:(1-THETA_A)
28
29 $DEMAND:B s:SIGMA_B
30 E:PXB Q:(1-XA)
31 E:PYB Q:(1-YA)
32 D:PXB Q:THETA_B
33 D:PYB Q:(1-THETA_B)
34
The trade activities each have one input and one output. They simply deliver a good (X or Y)
from one agent to the other. The new syntax presented here is specication of an ad-valorem tax.
Adding a tax requires two new elds. The rst is A: which species the tax agent, a consumer
who collects the tax revenue as part of income. The second is T: which species the ad- valorem
tax rate.
MPSGE permits taxes to applied on production inputs and outputs but it does not permit taxes on
nal demand.
The tax applies on a net basis on inputs. For example, if we consider the MXA sector, the price of
one unit of input is given by:
Px B * (1 + Ta)
where Px B is the net of tax price of a unit of x in the agent B market and Ta is the ad-valorem
tari rate.
1
2 $PROD:MXA
3 O:PXA Q:1
4 I:PXB Q:1 A:A T:T_A
5
6 $PROD:MXB
7 O:PXB Q:1
8 I:PXA Q:1 A:B T:T_B
9
10 $PROD:MYA
11 O:PYA Q:1
12 I:PYB Q:1 A:A T:T_A
13
14 $PROD:MYB
15 O:PYB Q:1
16 I:PYA Q:1 A:B T:T_B
17
The nal portions of the le introduces one use of MPSGE report variables. In this case, report
variables are used to recover a Hicksian money-metric welfare index for each of the agents. We
97
compute the initial, tari-ridden equilibrium in order to compute the benchmark welfare levels. We
then set all taris to zero and compute the free-trade equilibrium. Using the nal welfare indices
and the saved values of the benchmark welfare levels, we are able to report the change in welfare
from removing tari distortions.
1
2 $REPORT:
3 V:WA W:A
4 V:WB W:B
5
6 $OFFTEXT
7 $SYSINCLUDE mpsgeset TARIFFS
8
9 $INCLUDE TARIFFS.GEN
10 SOLVE TARIFFS USING MCP;
11
12 SCALAR
13 WA0 BENCHMARK WELFARE INDEX FOR AGENT A
14 WB0 BENCHMARK WELFARE INDEX FOR AGENT B;
15
16 WA0 = WA.L;
17 WB0 = WB.L;
18 T_A = 0;
19 T_B = 0;
20
21 $INCLUDE TARIFFS.GEN
22 SOLVE TARIFFS USING MCP;
23
24 SCALAR
25 EVA HICKSIAN EQUIVALENT VARIATION FOR AGENT A
26 EVB HICKSIAN EQUIVALENT VARIATION FOR AGENT B;
27
28 EVA = 100 * (WA.L-WA0)/WA0;
29 EVB = 100 * (WB.L-WB0)/WB0;
30 DISPLAY EVA, EVB;
31
Exercises:
(a) Find the optimal tari in this model for agent A, assuming that agent B does not retaliate
and leaves her tari rate at the benchmark level.
(b) Insert the endowment and preference parameters from the previous problem, retaining the same
benchmark tari rates. Does free trade benet both countries? If not, why not?
98
4. MPSGE Syntax
4.1 GAMS/MPSGE Program Structure
A typical GAMS/MPSGE program has the following elements:
1. GAMS set declarations. GAMS does not require that all sets be dened at the head
of a program, but it is convenient to do so. A key advantage conferred by GAMS is that
the denitions of sets are separable from the denition of a model. This means that small
dimensional examples may be used for model development, and once a model is operational it
may be applied to larger dimensional applications.
2. GAMS parameter declarations and denitions. GAMS statements such as PARAMETER
or TABLE may be used to dene numeric data structdures. Alternatively, data may be read from
external sources, such as Excel les. It is common that some model input may be computed
using GAMSalgebraic syntax.
3. MPSGE Model Denition The MPSGE model denition is provided in a GAMS comment
block, delimited by $ontext and $offtext. Details of the syntax are provided subsequently,
but so far as program structure the key input eld is the $model statement which denes a
GAMS symbol which is subsequently used to refer to the model.
4. Invocation of the MPSGE model-compiler. The statement:
$sysinclude mpsgeset modelID
must be included in the GAMS/MPSGE program immediately following the $ontext/$offtext
block which denes the MPSGE model. (When two or more models are dened in a single
program, each must have its own mpsgeset statement.)
5. Scenario denition and solution. This part of the program involves assignment of param-
eter values and the computation of equilibria. The computation of an economic equilibrium
involves two steps: (1) model generation, something which is accomplished with the statement:
$include modelID.gen
and (2) model solution, something which follows conventional GAMS syntax for complemen-
tarity solves:
solve modelID using mcp;
6. Report generation. Reporting relies on GAMS parameter assignment statements which
transfer solution values from the model into text or Excel tables or gures.
4.2 MPSGE Basic Syntax Rules
The following rules apply the the statements which dene an MPSGE model within an $ontext-
$offtext block:
99
All input is free format (spaces and tabs are ignored) except keywords for which $ must
appear in column 1.
End-of-line is signicant. Continuation lines are indicated by a + in column 1.
Text is not case sensitive.
Numeric elds may be specied as computed values using expressions involving GAMS param-
eters or constants. Fields based on computed values must must be enclosed in parentheses.
4.3 MPSGE Keywords
There are nine MPSGE keywords which appear in an MPSGE model declaration. These are
$MODEL:modelID This statement assigns an identier to the present model. This must be the rst
statement within the $ontext-$offtext block. MPSGE treats all records appearing prior to
the $MODEL keyword within the $ontext-$offtext block as comments.
modelID must be both a legitimate GAMS model identier and a valid le name. This name
is used to form modelID.GEN. (This le name must be upper case when running under Linux
or UNIX).
$SECTORS:, $COMMODITIES:, $AUXILIARY:, $CONSUMERS: These four keywords dene the vari-
ables which are used to dene the MPSGE model. Entries in these blocks share the same
syntax.
The $SECTORS keyword does not appear in models without production (pure exchange economies).
The $AUXILIARY keyword is only used in models with side constraints and endogenous taxes
or rationed endowments.
$PROD:sector This statement indicates the start of a set of records which dene technology and
taxes for a particular activity.
$DEMAND:consumer This statement indicates the start of a set of records which dene initial en-
dowments and preferences for consumers in the model. The representation of preferences and
technology follow a similar syntax, based on the calibrated share form of nested CES functions.
$REPORT: This statement indicates the start of a set of records which dene GAMS variables through
which MPSGE returns producer inputs, producer outputs and/or consumer demand. The
variables dened in $REPORT blocks may not be used in model equations.
$CONSTRAINT:auxiliary This statement species the equilibrium condition which is to be asso-
ciated with a particular auxiliary variable. Equilibrium conditions are written following the
conventional rules for expressing equations in GAMS. An auxiliary constraint may include vari-
ables which correspond to commodity prices, production activity levels and consumer incomes.
Auxiliary constraints may not refer to $REPORT variables.
4.4 Variable Declarations
A conventional GAMS program has a single VARIABLE statement for declaring the variables which
are to appear in a given model. MPSGE requires that variables be declared according to their
specic role in a model. The four MPSGE keywords $SECTORS:, $COMMODITIES:, $CONSUMERS: and
100
$AUXILIARY: therefore refer to the four dierent types of unknowns which may appear in a general
equilibrium model.
When variables are dened according to their classication the compiler is then able to verify that
when a variable appears within a function declaration it is properly referenced.
Here is a typical declaration block, one that refers to three classes of production activities in a given
model:
$SECTORS:
Y(R,T) ! Output in region R in period T
K(T) ! "Aggregate capital stock, period T"
I0 ! Base year investment
One dierence between VARIABLE declarations in GAMS and variable declarations in MPSGE is that
in the MPSGE syntax trailing comments (signied by !) are interpreted as variable descriptors
which subsequently appear in the solution listing. The equivalent GAMS declaration for these
variables would be:
VARIABLES
Y(R,T) Output in region R in period T
K(T) "Aggregate capital stock, period T"
I0 Base year investment;
As with the usual GAMS syntax, when a variable descriptor contains a punctuation symbol such as
,, it is required to enclosed in quotes.
4.4.1 Domain Restriction
MPSGE is designed so that all and only those variables which are declared are actually employed
in a particular model. This form of explicit declaration helps to catch nuisance bugs in large-
dimensional datasets.
The explicit declaration feature in MPSGE means that wildcard declarations, such as X(*,*,*)
are not permitted. It also means that some care must be exercised when a database includes missing
goods. Considerd, for example, a model in which g is the set of goods in the underlying database,
and P(g) is the associated vector of prices for these commodities. If a subset of the goods are missing
from the database, then the declaration of P(g) must be restricted to those goods which are actually
appear in the model. If y0(g) is a vector in which a value of zero indicates that the associated good
is not in the dataset. Appropriate declaration for the price vector could then be:
$COMMODITIES:
P(g)$y0(g) ! Commodity price vector
Detailed cross-checking can be somewhat annoying for users accustomed to the conventional algebraic
GAMS syntax in which the declared domain of a variable may include many more scalar elements
than are actually used in the model.
In order to simplify the declaration of irregular domains for variables in MPSGE the declaration
syntax accomodates the GAMS conditional operator $. The condition expression following the
101
dollar sign is passed through to the GAMS compiler and must conform to conventional GAMS syntax
rules for exceptions.
To illustrate how this might work in a more complicated situation, suppose that a dynamic, multi-
sectoral, multi-regional model accounts for the production of good i in region r and time period
t with X(i,r,t). Suppose that base year production levels are given by x0(i,r), and suppose,
furthermore, that the model includes an upper bound on production in later periods given by
u(i,r,t).
We would then only want to declare X(i,r,t) when both x0(i,r) and u(i,r,t) are nonzero. The
MPSGE declaration to do this could be:
$SECTORS:
X(i,r,t)$(min(x0(i,r),u(i,r,t)) > 0) ! Production levels
The computed conditional ($()) is handy because it avoids the need to introduce any additional
symbols into the program. If, however, the same conditional restriction appears at several points in
a model it may be helpful to dene a set with which to control declarations for several variables.
Suppose, for example that in the previous example there are several variables associated with the
production of good i in region r in time period t. The GAMS code might then introduce a dynamic
tuple:
SET IX(i,r,t) Active production sectors;
IX(i,r,t) = YES$(min(X0(i,r),U(i,r,t)) > 0);
We then could, for example, have declarations such as:
$SECTORS:
X(i,r,t)$IX(i,r,t) ! Production levels
...
$COMMODITIES:
PX(i,r,t)$IX(i,r,t) ! Output prices
RK(i,r,t)$IX(i,r,t) ! Capital returns
...
4.5 Function Declarations
A general equilibrium model is based on technology, preferences, policy instruments (most notably
tax rates) and primary factor endowments. Technology and policy instruments are described in
$PPROD blocks. Preferences and primary factor endowments are described in $DEMAND blocks.
4.5.1 $PROD Block Syntax
Most of the power and subtleties of the MPSGE framework for applied general equilibrium anal-
ysis centers on the $PROD tables. The information conveyed in a $PROD block includes which is
characterized:
102
Reference quantities for inputs and outputs.
Reference producer prics of inputs and outputs.
Exogenous taxes applied to inputs and outputs.
Endogenous taxes applied to inputs and outputs.
The nested constant elasticity of substitution (CES) / constant elasticity of transformation
(CET) elasticity structure at the reference point.
All records in a $PROD block must begin with either an I: or O: record. The recognized labels in
these records within a $PROD block include:
Q: Reference quantity. Default value is 1. When specied, it must be the second eld, immediately
following I: or O:.
P: Reference price. The default value of the reference price is 1.
A: Tax revenue agent. This eld must be followed by a consumer name.
T: Tax rate eld identier. (More than one tax may apply to a single entry.)
N: Endogenous tax. This label must be followed by the name of an auxiliary variable.
M: Endogenous tax multiplier. The advalorem tax rate is the product of the value of the endogenous
tax and this multiplier.
va:, kle:, etc. Nesting assignments referencing identiers introduced in the $PROD record. Only
one such label may be applied at a time, although several nesting assignemnts may be included
on a given line when exception operators identify only a single nest assignment to be included.
At an abstract level, the MPSGE representation of technology can be thought of as a second-order
Taylor approximation to the underlying production function at the benchmark point. A second
order approximation to f(x) might be written:
Q(x) = f( x) +f

( x)(x x) + (x x)
f(x)|
x= x
2
(x x) +o(x x)
3
The intercept term, f( x), corresponds to the values which appear in the Q: elds these values
correspond to a feasible point in the space of inputs and outputs, the point at which the technology
is evaluated. The slope term, f

( x), corresponds to values in the P: elds. These are marginal rates


of substitution and transformation, the slope of the isoquants of the production function at the
benchmark point. The matrix of second order, f(x)|
x= x
, corresponds to both the nesting structure
and the elasticities of the CES function. A given structure of nest and subnest elasticities corresponds
to a particular set of own- and pairwise elasticities and a specic second-order approximiation to
the Jacobian matrix at the benchmark point.
4.5.2 A Simple $PROD Block
Here is a typical production function, one in which factors of production from each region r are
combine in a Cobb-Douglas function to produce output:
103
$PROD:Y(r) s:1
O:P(r) Q:y0(r)
I:W(f,r) Q:x0(f,r) P:w0(f,r)
The price variables which appear in this function are P and W (both declared as $COMMODITIES:).
The activity variable in the function is Y , a variable which must have been declared in $SECTORS:.
Both f and r which appear in this function are sets, and y0, x0 and w0 must have been declared
previously in the program as parameters.
This $PROD block characterizes a Cobb-Douglas production function in which the elasticity of sub-
stitution between inputs is one, as indicated by s:1 in the rst line. The s: eld in a $PROD
block relates the top level substitution.
The O: label indicates an output, and the I: label indicates an input. The Q: elds in both records
represent reference quantities. The P: eld in the input record refers to the reference price of the
input.
If we were to write this function in conventional algebraic format, it might be:
y(r) = phi(r) * sum(f, x(f,r)**alpha(f,r)
in which variable x(f,r) stands for the input of factor f in region r, phi(r) is a scale parameter,
and alpha(f,r) is a matrix of share parameters. The MPSGE syntax for this function implicitly
denes both these parameters as follows:
alias (f,ff)
alpha(f,r) = w0(f,r)*x0(f,r) / sum(ff, w0(ff,r)*x0(ff,r));
phi(r) = y0(r) / sum(f, x0(f,r)**alpha(,r));
Consider the cost minimization problem:
minimize sum(f, w0(f,r) * x(f,r))
x
subject to phi(r) * sum(f, x(f,r)**alpha(f,r)) = y0(r)
The calibrated values of alpha and phi assure that the solution to this cost minimization problem
is x(f,r) = x0(f,r). Any modeling exercise based on conventional algebraic function forms would
require the assignment of alpha and phi. While this is quite simple in the present example, the
practical diculty is that as the form or nesting structure of the production function change, so too
does the number of assigned values of the function coecients.
4.5.3 $PROD Block An Example with Nesting
The following production function describes a nested CES production function, one in which good
X is produced using labor, capital and intermediate inputs:
$PROD:X s:esub id:0 va:(esub/5)
104
O:PX Q:x0
I:PY(g) Q:yx0(g) id:
I:PL Q:lx0 P:pl0 va:
I:PK Q:kx0 P:pk0 va:
This production function can be portrayed graphically using a nesting diagram:
I:PX Q:x0

@
@
@
@
@
@
@
@
`
s:esub
@
@
@
`

`
I:PY(g) Q:yx0(g)
I:PK Q:kx0 P:pk0
I:PL Q:lx0 P:pl0
id:0 va:esub/5
The rst record in the $PROD block contains the nest identier for top level inputs (a reserved name),
s:. The record introduces two new nest identiers, a: and va:. These nest identiers are arbitrary
names with up to four characters. The nest identier for top level outputs is t:. Both t: and s:
are reserved names.
In the $PROD block shown here, commodities PY(g) enter jointly in xed proportions in nest id:,
while labor ( PL) and capital (PK) enter as part of the value-added nest (va:).
Provided that esub is not equal to 1 or 5, the function form described by this $PROD block could be
written in conventional algebraic format as:
x = f(y, K, L) =
_
min
g
(y
g
)

+ (1 ) (L

+ (1 )K

)
/
_
1/
In this function = 1-1/esub and =1-5/esub. The share parameters, in the function, and
could be dened on the basis of data in the $PROD block, but their values are messy and dicult to
derive. Given the values of those share parameters, however, the value of can be calibrated using
base year output.
The values of share parameters (, , and ) are chosen such that a solution to the following problem
is consistent with the benchmark point. That is, if we solve:
minimize PL * L + PK * K + SUM(g, PY(g) * y(g))
subject to f(y,K,L) = x0
the optimal value is L=lx0, K=kx0, y(g)=yx0(g). The key idea here is that when the functional form
is calibrated to a reference price-quantity point, then if we evaluate the cost-minimization problem
at the same price point we get back the benchmark quantity point.
105
4.5.4 $PROD Block Multi-level Nesting
CES and CET functions can be nested to arbitrary depth in MPSGE. It is somewhat rare to nd
applications in which functions are nested deeper than three levels, but instances can arise where
this is required. A typical application of deeply nested function is in the representation of energy
demand.
Here is a simple example of a function with multiple levels of nesting:
X = min
_
min
g/ E
(
y
g
a
g
),
_

_
K

L
1
_

+ (1 )
_
y

E
y
1
N
_

_
1/
_
in which electric and nonelectric energy form the set E{E, N}.
The nesting tree is dene in the $PROD record through the introduction of pointers to the parent
nest for the kl and en nests (the name of the parent node in the nesting tree is listed in paretheses
immediately after the nest identier, e.g. kl(e) and en(e)).
The tricky bit in representing this function in MPSGE is the assignment of P("N") and P("E") to
the EN: nest. Conditional assignments may be applied to nest assignments for inputs and outputs.
This permits arbitrary assignments of elements from a single vector input to multiple nests. Here is
the MPSGE representation of this function:
set en(g) Electric and non-electric energy /E, N/;
...
$PROD:X s:esub id:0 e:sigma kl(e):1 en(e):1
O:PX Q:x0
I:P(g) Q:yx0(g) id:$(not en(g)) en:$en(g)
I:PL Q:lx0 P:pl0 kl:
I:PK Q:kx0 P:pk0 kl:
Here is a graphical representation of the MPSGE function as a nesting tree:

@
@
@
@
@
@
@
@
@
@
@
@
`
s:0
@
@
@
`
id:0
`
e:sigma
`
kl:1
`
en:1

@
@
@

O:PX Q:x0
I:PK Q:kx0 I:P("E") Q:yx0("E")
I:PL Q:lx0 I:P("N") Q:yx0("N") I:P(g) Q:yx0(g)
g / {E, N}
4.5.5 $PROD Block Joint Outputs
The following production function describes a production function which produces goods D and E
as joint products:
106
$PROD:E t:eta
O:PD Q:d0 P:pd0
O:PE Q:e0 P:pe0
I:PY Q:y0
The rst record in this $PROD block species a value for t:, the top-level elasticity of transformation.
Commodities with prices PD and PE are produced using inputs of the commodity with price PY.
The functional form described by this $PROD block could be written in conventional algebraic format
to express Y inputs as a function of D and E outputs:
y = g(D, E) = (D
1+
+ (1 )E
1+
)
/(1+)
As in the case of elastic inputs, the calibrated values of is chosen such that a solution to the
producer maximization problem when faced with benchmark prices (PD = PE = 1) corresponds to
the benchmark quantities. The scale factor is then assigned:
= y
_


D
1+
+ (1 )

E
1+
_
1/(1+
This means that the optimal solution to the problem:
maximize D + E
subject to g(D,E) = y0
is D=d0 and E=e0. The CET functional form is calibrated to a reference price-quantity point, then
if we evaluate the cost-minimization problem at the same price point we get back the benchmark
quantity point.
4.5.6 Taxes on Inputs in a $PROD Block
An input record in a production block may contain the following elds related to ad-valorem taxes:
A: Tax revenue agent. This eld must reference a consumer name.
T: Tax rate eld identier. (More than one tax may apply to a single entry.)
N: Endogenous tax. This label must be followed by the name of an auxiliary variable.
M: Endogenous tax multiplier. The advalorem tax rate is the product of the value of the endogenous
tax and this multiplier.
Rules relating to the application of taxes on inputs are as follows:
A tax revenue agent must be specied prior to a T: or N: eld. One important extremely
valuable sevice provided by MPSGE is that taxes may not be applied without consistent ac-
counting of associated tax revenue in consumer incomes. A tax therefore cannot be introduced
without have specifying a consumer which receives the revenue.
107
If revenue from a particular tax is to be paid to more than one consumer, then two (or more)
tax elds may be introduced on a single input with revenue accruing to dierent consumers.
In the following example two taxes are applied on the input of PL, one of which accrues to
consumer FED (the federal government) and another which accrues to consumer STATE (the
state government):
I:PL Q:l0 A:FED T:tlfica A:STATE T:tlinc
The tax rate on an input is evaluated on a net basis. The user cost of an input is the market
(net) price marked up by all applicable taxes. In the previous example the user cost of labor
is given by:
PLUSER = PL * (1 + tlfica + tlinc)
The net tax must be greater than -1, i.e. the user cost of any input must be positive.
Endgenous taxes are described by a pair of elds, labelled N: and M:. The N: eld identies
the auxiliary variable which is proportional to the tax rate, and the M: eld indicates the
proportionality factor. Consider the input record:
I:PL Q:l0 A:FED N:TFED M:tlfica A:STATE N:TSTATE M:tlinc
In this case the user cost of labor is given by:
PLUSER = PL * (1 + TFED * tlfica + TSTATE * tlinc)
4.5.7 Taxes on Outputs in a $PROD Block
An output record in a production block may contain elds relating to proportional taxes:
A: Tax revenue agent. Must be followed by a consumer name.
T: Tax rate eld identier. (More than one tax may apply to a single entry.)
N: Endogenous tax. This label must be followed by the name of an auxiliary variable.
M: Endogenous tax multiplier. The advalorem tax rate is the product of the value of the endogenous
tax and this multiplier.
Rules relating to the application of taxes on outputs are as follows:
A tax revenue agent must be specied prior to a T: or N: eld.
If revenue from a particular tax is to be paid to more than one consumer, then two (or more)
tax elds must be introduced. In the following example two taxes are applied on the output of
PX, one of which accrues to consumer FED (the federal government) and another which accrues
to consumer STATE (the state government):
I:PX Q:l0 A:FED T:tvat A:STATE T:tsales
108
The tax rate on an output is evaluated on a gross basis. The user price of an output is
the market (gross) price marked down by all applicable taxes. In the previous example the
producer price of X is given by:
PXUSER = PX (1 - tvat - tsales)
The gross tax must be less than 1, i.e. the producer price of any output must be positive.
Endgenous taxes are described by a pair of elds, labelled N: and M:. The N: eld identies
the auxiliary variable which is proportional to the tax rate, and the M: eld indicates the
proportionality factor. Consider the output record:
I:PX Q:l0 A:FED N:TFED M:tvat A:STATE N:TSTATE M:tsales
In this case the user cost of labor is given by:
PXUSER = PX * (1 - TFED * tvat - TSTATE * tsales)
4.5.8 Modeling technical change
Suppose that good X is produced using inputs of K and L. Write the production function in calibrated
share form:
X = X0 * (theta * (L/L0)**rho + (1-theta) * (K/K0)**rho)**(1/rho)
At reference prices PL0, PK0, the demands for labor and capital are L0 and K0, and the level of
output is X0.
We use this point to dene the value share, i.e.
theta = PL0*L0/(PL0*L0+PK0*K0)
Now, suppose we have a technical change parameter which is labor augmenting, so:
X = X0 * (theta * (L*gamma/L0)**rho + (1-theta) *(K/K0)**rho)**(1/rho) > where gamma>1.
We can alter the function by setting L0=L0/gamma, but we need to hold theta constant. The
problem (when using MPSGE) is that L0 is used to compute theta. In order to alter L0 while
holding theta xed, we let PL0=gamma*PL0.
In the MPSGE program, technical change then is represented as:
$PROD:X s:esub
O:PX Q:X0
I:PL Q:(L0/gamma) P:(PL0*gamma)
I:PK Q:K0 P:PK0
109
The intuitive explaination for introducing gamma in the reference price is that this incorporates
the rebound eect which is commonly part of technical change. Car engines get more ecient
with the introduction of CAFE standards, so people drive more and gasoline demand is virtually
unaected. Economic eects once again thwart well intentioned environmental policy!
4.5.9 $DEMAND Block Syntax
A demand block provides reference commodity demands and primary factor endowments for con-
sumers. These blocks eectively characterize nal demand, as they describe both initial endowments
and preferences. The information provided in a $DEMAND block includes:
Reference quantities of demanded goods.
Reference prices of demanded goods.
Endowment quantities with optional rationing multipliers
Elasticity nesting structure for nal demand.
The income level of any conssumer is the sum of factor income and tax revenue income. Tax revenue
is determined by the level and assignment of taxes on producer inputs and outputs. Those income
ows are not repeated in the $DEMAND block which only describes initial endowment income.
The recognized labels in an D: (reference demand ) record within a $DEMAND block include:
Q: Reference demand quantity. Default value is 1. When specice, the Q: eld must be the second
eld in the record, follow immediately after the D: eld.
P: Reference demand price. Default value is 1.
The recognized labels in an E: (endowment) record include:
Q: Reference quantity.
R: Rationing instrument indicating an auxiliary variable.
4.5.10 Applying Taxes on Final Demand
In MPSGE taxes may not be applied directly to consumer demands. If a sales tax is to be applied on
consumer demand, it is necessary to incorporate a aggregate consumption good and consumption
activity though which to apply the tax.
Let us illustrate with an example. The following demand block is invalid because a tax eld (T:) is
not recognized in a D: record:
$DEMAND:HH
D:P(g) Q:c0(g) P:pc0(g) A:GOVT T:tc(g)
E:W(f) Q:e0(f)
Alternatively, the logical framework presented here may be easily represented using a production
function for aggregate utility and an associated price indes:
110
$PROD:U
O:PU Q:u0
I:P(g) Q:c0(g) P:pc0(g) A:GOVT T:tc(g)
$DEMAND:HH
D:PU
E:W(f) Q:e0(f)
in which u0 = SUM(g, c0(g)*pc0(g)).
4.5.11 Classical Unemployment with Rationed Endoments
The R: eld is only used in an endowment record. The R: eld is used to ration a commodity
endowment using an auxiliary variable. The simplest example of how this might work is classical
unemployment. A model with full employment might have a demand block such as:
$DEMAND:HH
D:PC Q:c0
E:PL Q:l0
E:RK Q:k0
It might be of interest to perform an equilibrium calculation in which the wage rate is assumed
to be downward rigid. This is done in MPSGE by adding an auxiliary variable u representing the
unemployment rate. Here is what the demand function then looks like:
$DEMAND:HH
D:PC Q:c0
E:PL Q:l0
E:PL Q:(-l0) R:U
E:RK Q:k0
$CONSTRAINT:U
PL =G= PC;
The auxiliary variable removes workers from the labor market as it increases from 0. The number of
workers who are unemployed is chosen such that the real wage (the price of labor in terms of units
of nal consumption) remains xed with a value of unity. (The equation would be written literally
as PL/PC = 1 but this could create problems with divide by zero, and for this reason it is better
expressed as a linear function.
4.6 Constraints
Auxiliary constraints in MPSGE models conform to standard GAMS equation syntax. The may refer
to any of the four classes of variables, $SECTORS, $COMMODITIES, $CONSUMERS and $AUXILIARY, but
they may not reference variables names declared within a $REPORT block.
Complementarity conditions apply to upper and lower bounds on auxiliary variables and the asso-
ciated constraints. For this reason, the orientation of the equation is important. When an auxiliary
variable is designated POSITIVE (the default), the auxiliary constraint should be expressed as a
greater or equal inequality (=G=). If an auxiliary variable is designated FREE, the associated
constraint must be expressed as an equality (=E=).
111
$CONSTRAINT:TAU
G =G= X * Y;
$CONSTRAINT:MU(I)$MU0(I)
MU(I) * P(I) * Q(I) =G= SUM(J, THETA(I,J) * PX(J));
The exception applied in this example restricts the equation only to those elements of set I for which
MU0(I) is not zero.
4.7 Report Variables
The GAMS interface to MPSGE normally returns level values only for the central variables - those
declared within $SECTORS:, $COMMODITIES:, $CONSUMERS: and $AUXILIARY: sections. An equilib-
rium determines not only these values, but also levels of demand and supply by individual sectors
and consumers. Given benchmark information, elasticities and the equilibrium values, all such de-
mands can be computed, but this can be tedious to do by hand. In order to have these values
returned by MPSGE it is necessary to indicate the name of the variable into which the value is to
be returned.
The general form is as follows:
$REPORT:
V:variable name I:commodity PROD:sector
V:variable name O:commodity PROD:sector
V:variable name D:commodity DEMAND:consumer
V:variable name W:consumer
The rst row returns an input quantity, the second row returns an output quantity, the third returns
a demand quantity, and the fourth row returns a consumer welfare index. (Note: the level value
returned for a $CONSUMER variable is an income level, not a welfare index.)
$REPORT:
V:DL(S) I:PF("L") PROD:Y(S)
V:DK(S) I:PF("K") PROD:Y(S)
V:SX(G,S)$SX0(G,S) O:PX(G) PROD:X(S)
V:D(G,H) D:P(G) DEMAND:RA(H)
V:W(H) W:RA(H)
Note that the $ exception is only meaninful on the rst entry. Also notice that the domain of the
report variable must conform to the domain of the subsequent two entries.
N.B. Report variables are provided only for returning equilibrium demand and supply quantities.
These variables may not be reference in auxiliary constraints.
112
4.8 Exception Handling
The GAMS exception operator can be used on virtually any entry in the MPSGE input le. For
example, if you want to have sector X(S) have one production structure for elements S in a subset
T(S), you can provide separate production function declarations as follows:
$PROD:X(S)$T(S)
... ! sector X described for S in T
$PROD:X(S)$(NOT T(S))
... ! sector X described for S not in T.
4.9 Switches and Debug Output
Run-time tolerances and output switches may be specied within the vector-syntax model specica-
tion or using the PUT facility, they can be written directly to the MPS input le. Output switches
control the level of debug output written by the MPSGE subsystem to the solver status le. Reports
provided by $ECHOP, $FUNLOG and $DATECH can be returned to the listing le by specifying OPTION
SYSOUT=ON; within the GAMS program prior to the SOLVE statement. The recognized MPSGE
parameters are:
$ECHOP: logical Default=.FALSE.
is a switch for returning all or part of the scalar MPSGE le to the solver status le. In order to
have this output printed in the listing le, enter the GAMS statement OPTION SYSOUT=ON; prior
to solving the model.
$PEPS: real Default=1.0E-6
is the smallest price for which price-responsive demand and supply functions are evaluated. If a
price is below PEPS, it is perturbed (set equal to PEPS) prior to the evaluation.
$EULCHK: logical Default=.TRUE.
is a switch for evaluating Eulers identity for homogeneous equations. The output is useful for
monitoring the numerical precision of a Jacobian evaluation. When a price or income level is
perturbed in a function, the Euler check may fail.
$WALCHK: logical Default=.TRUE.
is a switch for checking Walrass law. Like EULCHK, this switch is provided primarily to monitor
numerical precision. When an income level is perturbed, the Walras check may fail.
113
$FUNLOG: logical Default=.FALSE.
is a switch to generate a detailed listing of function evaluations for all production sectors and
consumers.
FUNLOG triggers a function evaluation report which provides detailed output describing the evaluation
of supply and demand coecients. The information provide is sucient that an industrious graduate
student should be able to reproduce the results (given a pencil, paper and slide rule).
The evaluation report has the following headings:
T Coecient type with the following interpretation:
IA Input aggregate
OA Output aggregate
I Input
O Output
D Demand
E Endowment
N Name (either nest identier or commodity name)
PBAR Benchmark price (the P: eld value)
P Current price (gross of tax)
QBAR Benchmark quantitity (the Q: eld value)
Q Current quantity
KP Identier for parent entry in nesting structure.
ELAS Associated elasticity (input or output aggregates only)
When $FUNLOG:.TRUE is specied, a complete report of demand and supply coecients for every
production and demand function in every iteration. Be warned that with large models this can
produce an enrmous amount of output!
$DATECH: logical Default=.FALSE.
is a switch to generate a annotated listing of the function and Jacobian evaluation including a
complete listing of all the nonzero coecients.
MPSGE generates an analytic full rst-order Taylor series expansion of the nonlinear equations in
every iteration. Nonzero elements of the Jacobian matrix are passed to the system solver (MILES
or PATH) which uses this information in the direction-nding step of the Newton algorithm. Coef-
cients are produced with codes which help interpret where they came from. The following codes
are used:
114
W0 indicates an element from the orthogonal part of F().
W1 indicates an element from the non-orthogonal part of F().
B indicates a linear term from F.
E0 indicates a homogeneous Jacobian entry.
E1 indicates a non-homogeneous Jacobian entry.
The Euler checksum examines elements from the linearization which are type E0. The Walras
check sum examines elements from the function evaluation which are type W0.
Needless to say, the $DATECH:.TRUE. switch produces a very big status le for large models. It is
not something which is very useful for the casual user.
115
116
5. Three Small MPSGE Models
5.1 Overview
This section of the paper introduces MPSGE model building using a two- good, two-factor (2x2)
example. This is addressed to readers who may be unfamiliar with GAMS and/or the original
(scalar) MPSGE syntax. The discussion provides some details on the formulation and specication
of one small model from the MPSGE library. Subsequently, two extensions are presented, one which
illustrates equal yield constraints and another which introduces a pure public good. These examples
are by no means exhaustive of the classes of equilibrium structures which can be investigated using
the software, but they do provide a starting point for new users.
The structure of MPSGE model HARBERGER is generic Arrow-Debreu with taxes. Households
obtain income by supplying factors of production to industry or collecting tax revenue. This income
is then allocated between alternative goods in order to maximize welfare subject to the budget
constraint.
Firms operate subject to constant returns to scale, selecting factor inputs in order to minimize cost
subject to technological constraints. For an algebraic description of a model closely related to this
one, see Shoven and Whalley (1984). The present model diers in two respects from the Shoven-
Whalley example. First, in this model there are intermediate inputs to production while in the
Shoven-Whalley model goods are produced using only value-added. Second, this model incorporates
a labor-leisure choice so that the excess burden of factor taxes here incorporates the disincentive to
work associated with a lower net wage.
5.2 Benchmark Data
The following table presents most of the input data for a two good, two factor, closed economy
model. This is an economy in which, initially, taxes are levied only on capital inputs to production.
We treat tax revenue as though it were returned lump-sum to the households.
Sectors Consumers
----------------------------------------------------
X Y OWNERS WORKERS GOVT
----------------------------------------------------
PX 100 -20 -30 -50
PY -10 80 -40 -30
PK -20 -40 60
PL -50 -10 60*
----------------------------------------------------
TK -20 -10 30
TRN 10 20 -30
----------------------------------------------------
117
* 60 = labor endowment net leisure demand= 100 - 40
The input data is presented in the form of a balanced matrix, the entries in which represent the
value of economic transactions in a given period (typically one year). Social accounting matrices
(SAMs) can be quite detailed in their representation of an economy, and they are also quite exible.
All sorts of inter-account taxes, subsidies and transfers can be represented through an appropriate
denition of the accounts.
5.2.1 Rectangular Social Accounts
Traditionally, a SAM is square with an exact correspondence between rows and columns. (For
an introduction, see Pyatt and Round, Social Accounting Matrices: A Basis for Planning, The
World Bank, 1985.) The numbers which appear in a conventional SAM are typically positive,
apart from very special circumstances, whereas the rectangular SAM displayed in Figure 1 follows
a sign convention wherein supplies or receipts are represented by positive numbers and demands or
payments are represented by negative numbers. Internal consistency of a rectangular SAM implies
that row sums and column sums are zero. This means that supply equals demand for all goods and
factors, tax payments equal tax receipts, there are no excess prots in production, the value of each
household expenditure equals the value of factor income plus transfers, and the value of government
tax revenue equals the value of transfers to households.
With simple MPSGE models, it is convenient to use a rectangular SAM format. This format empha-
sizes how the MPSGE program structure is connected to the benchmark data. In the rectangular
SAM, we have one row for every market (traded commodity), one column for every production
sector, and one column for every consumer. Benchmark equilibrium is reected in the row and
column sums. Columns corresponding to sectors sum to zero reecting zero excess prot (the value
of output equals the cost of inputs). Columns corresponding to consumers sum to zero indicating
income balance. Rows sum to zero indicating market clearance.
In the present model, there are four markets, for goods X and Y and factors L and K; two production
sectors (X and Y) and three consumers (OWNERS, WORKERS and GOVT).
5.3 Partitioning the Social Accounts
Consider a generalized version of the model in which the set of production sectors be denoted S
(here, S = {X,Y} ). Let the set of goods be G. Production sectors are mapped one-to-one with the
goods, so we see that sets S and G are in fact the same set. Let F denote the set of primary factors
(here, F={L,K}), and let H denote the set of households (here H={OWNER,WORKER}).
Now that we have identied the underlying sets, we may interpret the input matrix as a set of
parameters with which we can easily specify the benchmark equilibrium. It is quite common to
begin a general equilibrium modelling project with a large input-output Figure or social accounting
matrix which may then be mapped onto a number of submatrices, each of which is dimensioned
according to the underlying sets used in the model.
It should be emphasized at this point that there is an enormous dierence between Figures 1 and
2. While Figure 1 concisely represents an equilibrium for a single two-sector model, Figure 2 rep-
resents an arbitrary set of commodities, factors, production sectors and households. Scalability is
an enormous advantage of the GAMS/MPSGE modeling environment. Model implementation and
118
debugging can be conducted on a tiny prototype, and then the same computer code can be employed
with a large-scale dataset.
Sectors Consumers
------------------------------------------
(S) Households(H) Government
------------------------------------------
Goods Markets (G): A(G,S)-B(G,S) -C(G,H)
Factor Markets (F): -FD(F,S) E(F,H)-D(F,H)
Capital taxes: -T("K",S) GREV
Transfers: TRN(H) -GREV
5.4 Extracting Data from the Social Accounts
The GAMS specication of benchmark data is presented in Figure 3 which begins with a statement
of the underlying sets (G, F, H). The statement ALIAS (S,G); simply says that S and G both
reference {X,Y}. Thereafter follows the social accounting data table and declarations for the various
submatrices. The parameters ELAS() and ESUB() are elasticities (free parameters) which can be
chosen independently from the benchmark accounts. The parameters TF and PF are calibrated tax
and reference price arrays which are computed given benchmark factor and tax payments. (In this
model, average and marginal tax rates are not distinguished, so the benchmark marginal tax rate is
simply the tax payment divided by the net factor income.)
A general equilibrium model determines only relative prices. For purposes of reporting or construct-
ing value-indices, we use a Laspeyres quantity index, THETA(G), the elements of which correspond
to shares of aggregate consumer expenditure in the benchmark period.
1
2 * SECTION (i) DATA SPECIFICATION AND BENCHMARKING
3
4 SETS G GOODS AND SECTORS /X, Y/,
5 F PRIMARY FACTORS /K, L/,
6 H HOUSEHOLDS /OWNER, WORKER/;
7
8 ALIAS (S,G);
9
10 TABLE SAM(*,*) SOCIAL ACCOUNTING MATRIX
11
12 X Y OWNER WORKER GOVT
13 X 100 -20 -30 -50
14 Y -10 80 -40 -30
15 K -20 -40 60
16 L -50 -10 60
17 TK -20 -10 30
18 TRN 10 20 -30
19
20
21 PARAMETER
22 A(S) BENCHMARK OUTPUT
23 B(G,S) USE MATRIX (GOODS INPUTS BY SECTOR)
24 C(G,H) HOUSEHOLD DEMAND
25 FD(F,S) FACTOR DEMAND BY SECTOR
119
26 E(F,H) FACTOR ENDOWMENTS
27 D(F,H) FACTOR DEMAND BY HOUSEHOLDS
28 T(F,S) TAX PAYMENT BY FACTOR BY SECTOR
29 TRN(H) TRANSFER REVENUE
30 ELAS(S) ELASTICITY OF SUBSTITUTION IN PRODUCTION
31 ESUB(H) ELASTICITY OF SUBSTITUTION IN DEMAND
32 GREV BENCHMARK GOVERNMENT REVENUE
33 TF(F,S) FACTOR TAX RATE
34 PF(F,S) BENCHMARK FACTOR PRICES GROSS OF TAX
35 THETA(G) WEIGHTS IN NUMERAIRE PRICE INDEX
36 WBAR(H) BENCHMARK WELFARE INDEX;
37
38 * EXTRACT DATA FROM THE SOCIAL ACCOUNTING MATRIX:
39
40 A(S) = SAM(S,S); B(G,S) = MAX(0, -SAM(G,S));
41 C(G,H) = -SAM(G,H); FD(F,S) = -SAM(F,S);
42 E(F,H) = SAM(F,H); D(F,H) = 0;
43 T("K",S) = -SAM("TK",S); TRN(H) = SAM("TRN",H);
44
45 * INSTALL "FREE" ELASTICITY PARAMETERS:
46
47 E("L","WORKER") = 100; D("L","WORKER") = 40;
48 ELAS(S) = 1; ESUB(H) = 0.5;
49
50 * INSTALL FUNCTIONS OF BENCHMARK VALUES:
51
52 GREV = SUM(H, TRN(H));
53 TF(F,S) = T(F,S) / FD(F,S);
54 PF(F,S) = 1 + TF(F,S);
55 THETA(G) = SUM(H, C(G,H));
56 THETA(G) = THETA(G) / SUM(S, THETA(S));
57 WBAR(H) = SUM(G, C(G,H)) + SUM(F, D(F,H));
5.5 The MPSGE Model
The MPSGE description of this model is shown in Figure 4. Declarations following the $MODEL
statement indicate that the model involves one class of production activities (AL(S)), three classes
of commodities (P(G), W(F) and PT), and two types of consumers, private consumers (RA(H) ), and
a government consumer (GOVT).
One $PROD: block describes the single class of production activities, and two $DEMAND: blocks
characterize endowments and preferences for the two classes of consumers.
Consider the records associated with production sector AL(S). The entries on the rst line of a $PROD:
block are elasticity values. The s:0 eld indicates that the top-level elasticity of substitution
between inputs is zero (Leontief). The entry va:ELAS(S) indicates that inputs identied as
belonging to the va: aggregate trade o with an elasticity of substitution ELAS(S) (at the second
level of the production function). In these production functions, the primary factors (W(F)) are
identied as entering in the va: aggregate.
The nesting assignments within an MPSGE model can be easily modied by the assignment of inputs
to aggregates, as has been done in this model using the va: nest. This exibility is very helpful
when testing robustness with respect to changes in the elasticity structure of a model. (A note on
syntax: nesting identiers are limited to four characters.)
1
2 * SECTION (ii) MPSGE MODEL DECLARATION
120
3
4 $ONTEXT
5
6 $MODEL:HARBERGER
7
8 $SECTORS:
9 AL(S)
10
11 $COMMODITIES:
12 P(G) W(F) PT
13
14 $CONSUMERS:
15 RA(H) GOVT
16
17 $PROD:AL(S) s:0 va:ELAS(S)
18 O:P(S) Q:A(S)
19 I:P(G) Q:B(G,S)
20 I:W(F) Q:FD(F,S) P:PF(F,S) A:GOVT T:TF(F,S) va:
21
22 $DEMAND:RA(H) s:1 gds:ESUB(H)
23 D:P(G) Q:C(G,H) gds:
24 D:W(F) Q:D(F,H)
25 E:W(F) Q:E(F,H)
26 E:PT Q:TRN(H)
27
28 $DEMAND:GOVT
29 D:PT Q:GREV
30
31 $REPORT:
32 V:CD(G,H) D:P(G) DEMAND:RA(H)
33 V:DF(F,H) D:W(F) DEMAND:RA(H)
34 V:EMPLOY(S) I:W("L") PROD:AL(S)
35 V:WLF(H) W:RA(H)
36
37
38 $OFFTEXT
39
40 * Invoke the preprocessor to declare the model for GAMS:
41
42 $SYSINCLUDE mpsgeset HARBERGER
43
44
45 * ------------------------------------------------------------------
46 * SECTION (iii) BENCHMARK REPLICATION
47
48 HARBERGER.ITERLIM = 0;
49 $INCLUDE HARBERGER.GEN
50 SOLVE HARBERGER USING MCP;
51 ABORT$(ABS(HARBERGER.OBJVAL) GT 1.E-4)
52 "*** HARBERGER benchmark does not calibrate.";
53 HARBERGER.ITERLIM = 1000;
54
5.5.1 Comments Regarding the Model
The records within a $PROD: block begin with O: or I:. An O: indicates an output and an
I: represents an input. In both types of records, Q: is a quantity eld indicating a reference
input or output level of the named commodity. A P: signies a reference price eld. This price
is measured as a user cost, gross of applicable taxes. The default values for reference price and
reference quantity are both unity (i.e., a value of 1 is installed if a P: or Q: eld is missing).
121
The va: and T: elds in a $PROD: block indicate tax agent and ad-valorem tax rate, respectively.
The tax agent is specied before the tax rate. A single input or output coecient may have two
or more taxes applied. Consumers are treated symmetrically, and there is thus no restriction on
the consumer to whom the tax is paid. Typically, however, one consumer is associated with the
government.
To better understand the relationship between reference prices and base year tax rates, consider
inputs of W.K to sector AL.X in this model. The benchmark payment to capital in the X sector is 20
and the tax payment is 20. Hence the ad-valorem tax rate in the benchmark equilibrium is 100%
(T:1), and the reference price of capital, market price of unity times (1 + 100%), is 2 (P:2). If in a
counterfactual experiment the tax rate on capital inputs to sector X is altered, this will change the
T: eld but it will not change the P: eld. Q: and P: characterize a reference equilibrium point,
and these are therefore unaected by subsequent changes in the exogenous parameters.
It is important to remember that the $PROD:AL(S) block represents as many individual production
functions as there are elements in set S (two in this case). Within the $PROD:AL(S) block, inputs
refer to sets G and F , while the output coecient, O:P(S), refers only to set S. Sets referenced within
a commodity name in an I: or O: eld may be sets which are controlled by the sets referenced
in the function itself, in which case only a scalar entry is produced. In $PROD:AL(S) there are only
outputs of commodity S in sector S.
The rst line of a $DEMAND block also contains elds (e.g., s:, gds:, cl: etc.) which represent
elasticities of substitution. The subsequent records may begin with either an E: eld or a D: eld.
These, respectively, represent commodity endowments and demands. In the demand elds, the P:
and Q: entries are interpreted as reference price and reference quantity, analogous to the input elds
in a $PROD block. Ad-valorem taxes may not be applied on nal demands, so that if consumption
taxes are to be applied in a model they must be levied on production activities upstream of the nal
demand.
The benchmark values for all activity levels and prices are equal to the default value of unity,
and therefore we are able to specify values in the Q: elds directly from the benchmark data. An
equivalent model could be specied in which the benchmark activity levels for AL(S) equal, for
example, A(S,S). This would then require rescaling the input and output coecients for those
sectors, and it would not necessarily be helpful, because in a scaled model it is more dicult to
verify consistency of the benchmark accounts and MPSGE input le. Furthermore, for numerical
reasons it is advisable to scale equilibrium values for the central variables to be close to unity.
Government transfers to households are accomplished through the use of an articial commodity
(PT). The government is identied as the agent who receives all tax revenue (see the A:GOVT entry
in both of the $PROD: blocks). Commodity PT is the only commodity on which GOVT spends this
income, hence government tax revenue is divided between the two households in proportion to their
endowments of the articial good. In order to scale units so that the benchmark price of PT is unity,
the $30 of government tax revenue chases 10 units of PT assigned to OWNER and 20 units assigned to
WORKER. (See values for TRN(H) in Figure 3.)
The $REPORT section of the input le requests the solution system to return values for inputs, outputs,
nal demands or welfare indices at the equilibrium. Only those items which are requested will be
written to the solution le. Each record in the report block begins with a V: (variable name) eld.
These names must be distinct from all other names in the model. The second eld of the report
record must have one of the labels I:, O: or D: followed by a commodity name, or the label W:
followed by a consumer name. The third elds label must be PROD: in an I: or O: record, and it
must be DEMAND: if it is a D: record.
122
5.5.2 MPSGE Formulation: Key Ideas
There are two points regarding the MPSGE function format which are important yet easily misun-
derstood by new users:
(i) The elasticities together with the reference quantities and reference prices of inputs and outputs
completely characterize the underlying nested CES functions. No other data elds in the $PROD:
block alters the technology. If, for example, a tax rate changes as part of a counter-factual experi-
ment, this has no eect on the reference price. The value in the P: eld depends on the benchmark
value of the T: eld if the model has been calibrated, but subsequent changes in T: do not change
the underlying technology.
(ii) Tax rates are interpreted dierently for inputs and outputs. The tax rate on inputs is specied
on a net basis, while the tax rate on outputs is specied on a gross basis. That is, the user cost of
an input with market price p subject to an ad-valorem tax at rate t is p (1 + t), while the user cost
of an output subject to an ad-valorem tax at rate t is p (1 - t). (A tax increases the producer cost
of inputs and decreases the producer value of outputs.)
MPSGE provides a limited number of economic components with which complex models can be
constructed. There are some models which lie outside the MPSGE domain, but in many cases it is
possible to recast the equilibrium structure in order to produce an MPSGE model which is logically
equivalent to the original model - usually after having introduced some sort of articial commodity
or consumer. In the present model, the use of commodity PT to allocate government revenue between
households provides a fairly typical example of how this can be done. In the process of making such
a transformation, one often gains a meaningful economic insight.
5.5.3 Computing Counter-factual Scenarios
The GAMS code shown below species and solves three counterfactual equilibria. In these experi-
ments, the nonuniform system of capital taxes from the benchmark is replaced by three alternative
uniform factor tax structures: a tax on labor, a tax on capital, and a tax on both labor and capital.
In each case, the tax rate is chosen to replace the benchmark tax revenue at benchmark prices and
demand (ignoring induced substitution eects). Following each solution, the equilibrium values for
tax revenue, welfare (Hicksian equivalent variation), employment, prices and output are stored in
parameter REPORT.
1 * ------------------------------------------------------------------
2 * SECTION (iv) COUNTER-FACTUAL SPECIFICATION AND SOLUTION:
3
4 SET SC COUNTERFACTUAL SCENARIOS TO BE COMPUTED /
5 UNIF_L UNIFORM TAX ON LABOR,
6 UNIF_K UNIFORM TAX ON CAPITAL,
7 UNIF_VA UNIFORM VALUE-ADDED TAX/
8
9 PARAMETER TAXRATE(F,S,SC) COUNTERFACTUAL TAX RATES,
10 REPORT(*,*,*,SC) SOLUTION REPORT - % CHANGES,
11 PINDEX PRICE DEFLATOR;
12
13
14 * SPECIFY COUNTER-FACTUAL TAX RATES TO ACHIEVE CETERIS
15 * PARIBUS BALANCED BUDGET:
16
17 TAXRATE("L",S,"UNIF_L") = GREV / SUM(G, FD("L",G));
18 TAXRATE("K",S,"UNIF_K") = GREV / SUM(G, FD("K",G));
19 TAXRATE("L",S,"UNIF_VA") = GREV / SUM((F,G), FD(F,G));
123
20 TAXRATE("K",S,"UNIF_VA") = GREV / SUM((F,G), FD(F,G));
21
22 LOOP(SC,
23
24 * INSTALL TAX RATES FOR THIS COUNTERFACTUAL:
25
26 TF(F,S) = TAXRATE(F,S,SC);
27
28 $INCLUDE HARBERGER.GEN
29 SOLVE HARBERGER USING MCP;
30
31 * ------------------------------------------------------------------
32 * SECTION (v) REPORT WRITING:
33
34 * REPORT SOME RESULTS:
35
36 PINDEX = SUM(G, P.L(G) * THETA(G));
37
38 REPORT("REVENUE","_",SC) = 100 * (PT.L/PINDEX - 1);
39 REPORT("TAXRATE","_",SC) =
40 100 * SMAX((F,S), TAXRATE(F,S,SC));
41 REPORT("WELFARE",H,SC) = 100 * (WLF.L(H) - 1);
42 REPORT("EMPLOY",S,SC) = 100 * (EMPLOY.L(S)/FD("L",S) - 1);
43 REPORT("PRICE",G,SC) = 100 * (P.L(G)/PINDEX - 1);
44 REPORT("PRICE",F,SC) = 100 * (W.L(F)/PINDEX - 1);
45 REPORT("OUTPUT",S,SC) = 100 * (AL.L(S) - 1);
46 );
47 DISPLAY REPORT;
5.6 Alternative Models
The standard MPSGE model is based on xed endowments and tax rates, but many empirical
models do not t into this structure. For example, in the model HARBERGER, the level of each
replacement tax was specied to be consistent with equal yield, but as a result of the endogenous
response of prices and quantities, the resulting tax revenues diered signicantly from the benchmark
levels. For example, when the capital tax is replaced by a uniform labor tax at a rate which, in the
absence of labor supply response, produces equal yield, we nd that tax revenue in fact declines
by 39%. In order to perform dierential (equal yield) tax policy analysis, it is therefore necessary
to accommodate the endogenous determination of tax rates as part of the equilibrium computation.
This is one of many possible uses of auxiliary variables in MPSGE.
5.6.1 Tax Analysis with Equal Yield
The following GAMS code presents the MPSGE model denition for test problem SHOVEN. This
model is equivalent to the HARBERGER, apart from the addition of an auxiliary variable TAU.
Within MPSGE, auxiliary variables can either represent price-adjustment instruments (endogenous
taxes) or they can represent a quantity-adjustment instruments (endowment rations). In model
SHOVEN, TAU is used to proportionally scale factor taxes in order to achieve a target level of gov-
ernment revenue. The auxiliary variable rst appears in the $PROD:AL(S) block, following the
declaration of a tax agent. There are two elds associated with an endogenous tax. The rst eld
(N:) gives the name of the auxiliary variable which will scale the tax rate. The second eld (M:)
species the multiplier. If the M: eld is omitted, the multiplier assumes a default value of unity. If
the value in the M: eld is zero, the tax does not apply.
The auxiliary variable TAU also appears at the bottom of the le where it labels an associated
124
equation. An auxiliary variable may or may not appear in its associated constraint. The constraint
associated with TAU is based on a price index dened by THETA(G). The equilibrium level of TAU
is selected to provide level of tax revenue such that the value of transfers to households is held
constant. (Endowments of the commodity PT are xed, so when the value of PT is xed, then so too
are the value of transfers from GOVT to each of the households.)
SHOVEN illustrates how an auxiliary variable can be interpreted as a tax instrument. In the MPSGE
syntax, auxiliary variables may also be employed to endogenously determine commodity endow-
ments. There is no restrictions on how a particular auxiliary variable is to be interpreted. A single
variable could conceivably serve simultaneously as an endogenous tax as well as a endowment ratio,
although this would be rather unusual.
1 $ONTEXT
2
3 $MODEL: SHOVEN
4
5 $SECTORS:
6 AL(S)
7
8 $COMMODITIES:
9 P(G) W(F) PT
10
11 $CONSUMERS:
12 RA(H) GOVT
13
14 $AUXILIARY:
15 TAU
16
17 $REPORT:
18 V:CD(G,H) D:P(G) DEMAND:RA(H)
19 V:DF(F,H) D:W(F) DEMAND:RA(H)
20 V:EMPLOY(S) I:W("L") PROD:AL(S)
21 V:WLF(H) W:RA(H)
22
23 $PROD:AL(S) s:0 va:ELAS(S)
24 O:P(G) Q:A(G,S)
25 I:P(G) Q:B(G,S)
26 I:W(F) Q:FD(F,S) P:PF(F,S)
27 + A:GOVT N:TAU$TF(F,S) M:TF(F,S)$TF(F,S) va:
28
29 $DEMAND:RA(H) s:1 gds:ESUB(H)
30 D:P(G) Q:C(G,H) gds:
31 D:W(F) Q:D(F,H)
32 E:W(F) Q:E(F,H)
33 E:PT Q:TRN(H)
34
35 $DEMAND:GOVT
36 D:PT Q:GREV
37
38 $CONSTRAINT:TAU
39 PT =E= SUM(G, THETA(G) * P(G));
40
41 $OFFTEXT
An algebraic formulation of the Shoven model is provided in Appendix D for the interested reader.
125
5.6.2 Public Goods and Endogenous Taxation
Consider a nal extension of the 2x2 model in which tax revenue funds a pure public good. Model
SAMUELSON presented in Figure 8. This model illustrates one of several ways that public goods can
be modelled in MPSGE. Here the level of public provision is determined by a Samuelson-condition
equating the sum of individual marginal rates of substitution (marginal benet) with the marginal
rate of transformation (marginal cost). Unlike the equal yield formulation, the tax revenues collected
by GOVT are not returned lump-sum but are instead used to nance provision of a pure public good.
This representation of government has not been widely adopted in the CGE literature, perhaps
because of the diculties involved in specifying preferences for public goods.
The relevant characteristic of a pure public good entering nal demand is that each consumer
owns the same quantity. Agents attitudes toward public goods dier, and because there is no
market, agents valuations of the public good will also dier. In an MPSGE model, the separate
valuations are accommodated through the introduction of personalized markets for public good -
one market for each consumer. In the model, consumer expenditure encompasses both private and
public purchases, and consumer income encompasses both private and public endowments. An
individual is endowed with a quantity of her own version of the public good determined by the level
of public expenditures. An increase in taxes, to the extent that it increases tax revenue, will increase
the level of public provision.
In this model, the structure of relative factor taxes is exogenous but the aggregate level of taxes is
not. Tax rates are scaled up or down so that the sum of individual valuations of the public good
(the marginal benet) equals the cost of supply of the public good (the direct marginal cost).
Consider features of model SAMUELSON which do not appear in SHOVEN:
(i) There are new commodities PG and VG(H). The rst of these represents the direct marginal cost
of public output from sector GP, a Leontief technology which converts private goods inputs into
the public good. For the SAMUELSON structure, all government revenues apply to purchases of the
public good (observe that the only good demanded by consumer GOVT is PG ). The prices VG(H)
represent the individual consumer valuations of the public good. Commodity VG(H) appears only
in the endowments and demands of consumer RA(H). The endowment record for VG(H) includes a
quantity V(H) which is the benchmark valuation of the public good by agent H.
(ii) There are two auxiliary variables. TAU has the same interpretation as in the SHOVEN, determining
the aggregate tax level. Auxiliary variable LGP is a rationing instrument representing an index of
the level of public goods provision, scaled to unity in the benchmark. Consumer RA(H) thus is
endowed with a quantity of VG(H) given by V(H) * LGP .
(iii) The constraint for TAU in SAMUELSON diers from the TAU constraint in SHOVEN. Here the con-
straint represents the Samuelson condition, equating the marginal cost (PG*GREV) and the sum of
individuals marginal benet ( SUM(H,VG(H)*V(H)) ). The constraint for LGP simply assigns LGP
equal to the sector GP activity level. (The LGP variable and constraint are only needed because the
R: eld only accepts auxiliary variables.)
1 $ONTEXT
2
3 $MODEL: SAMUELSON
4
5 $SECTORS:
6 AL(S) GP
7
8 $COMMODITIES:
126
9 P(G) W(F) PG VG(H)
10
11 $CONSUMERS:
12 RA(H) GOVT
13
14 $AUXILIARY:
15 TAU LGP
16
17 $REPORT:
18 V:CD(G,H) D:P(G) DEMAND:RA(H)
19 V:DF(F,H) D:W(F) DEMAND:RA(H)
20 V:EMPLOY(S) I:W("L") PROD:AL(S)
21 V:WLF(H) W:RA(H)
22
23 $PROD:AL(S) s:0 va:ELAS(S)
24 O:P(G) Q:A(G,S)
25 I:P(G) Q:B(G,S)
26 I:W(F) Q:FD(F,S) P:PF(F,S)
27 + A:GOVT N:TAU$TF(F,S) M:TF(F,S)$TF(F,S) va:
28
29 $PROD:GP s:0
30 O:PG Q:GREV
31 I:P(G) Q:GD(G)
32
33 $DEMAND:RA(H) s:1 gds:ESUB(H)
34 D:P(G) Q:C(G,H) gds:
35 D:W(F) Q:D(F,H)
36 D:VG(H) Q:V(H)
37 E:VG(H) Q:V(H) R:LGP
38 E:W(F) Q:E(F,H)
39
40 $DEMAND:GOVT
41 D:PG Q:GREV
42
43 $CONSTRAINT:TAU
44 GREV * PG =E= SUM(H, V(H) * VG(H));
45
46 $CONSTRAINT:LGP
47 LGP =E= GP;
48
49 $OFFTEXT
5.6.3 Comparing Model Results
Although the foregoing discussion has focused on the nuances of MPSGE model syntax, but there are
many interesting economic questions which can be addressed using even small-scale models such as
the ones described here. Consider the output listing from parameter REPORT is displayed in Figure 9.
It is perhaps surprising to note that none of the uniform tax structures represents a Pareto-superior
choice compared to the benchmark tax structure. Furthermore, from the standpoint of aggregate
welfare (WELFARE.TOTAL = income-weighted sum of individual EVs), only the uniform capital tax
represents an improvement.
INDEX 1 = HARBERGER
UNIF_K UNIF_L UNIF_VA
REVENUE._ 3.9 -38.9 -0.8
TAXRATE._ 50.0 50.0 25.0
WELFARE.OWNER 1.9 42.4 18.5
WELFARE.WORKER -0.1 -26.8 -10.9
WELFARE.TOTAL 0.6 -1.3 -3.48143E-2
127
EMPLOY .X -5.3 -6.9 -8.4
EMPLOY .Y 20.5 34.4 22.1
PRICE .X -10.4 -11.2 -10.3
PRICE .Y 11.8 12.8 11.8
PRICE .K 3.9 59.5 24.5
PRICE .L -4.7 -38.9 -23.5
OUTPUT .X 3.6 -1.0 0.4
OUTPUT .Y -3.7 2.0 -2.0
INDEX 1 = SHOVEN
UNIF_K UNIF_L UNIF_VA
TAXRATE._ 47.1 134.2 25.3
WELFARE.OWNER 3.3 40.2 18.3
WELFARE.WORKER -1.0 -29.2 -10.8
WELFARE.TOTAL 0.6 -3.6 -3.51710E-2
EMPLOY .X -5.0 -19.7 -8.5
EMPLOY .Y 21.5 12.1 21.9
PRICE .X -10.4 -9.0 -10.3
PRICE .Y 11.9 10.2 11.8
PRICE .K 6.2 49.8 24.2
PRICE .L -5.0 -56.5 -23.6
OUTPUT .X 3.6 -7.9 0.3
OUTPUT .Y -3.4 -2.0 -2.1
INDEX 1 = SAMUELSON
UNIF_K UNIF_L UNIF_VA
REVENUE ._ -1.4 -14.5 -6.7
TAXRATE ._ 45.7 88.8 22.8
WELFARE .OWNER 4.7 43.9 21.1
WELFARE .WORKER -2.0 -31.4 -12.9
WELFARE .TOTAL 0.5 -3.7 -0.4
EMPLOY .X -4.9 -7.5 -5.9
EMPLOY .Y 24.5 37.5 29.7
PRICE .X -10.7 -11.3 -10.9
PRICE .Y 12.2 13.0 12.5
PRICE .K 7.8 60.3 29.0
PRICE .L -6.0 -51.8 -24.5
OUTPUT .X 3.0 -2.2 0.9
OUTPUT .Y -2.3 3.3 -2.58148E-2
PROVISION._ -0.8 -13.9 -6.1
5.7 Algebraic Representations
5.7.1 Harberger
Zero Net Profit
The unit cost of production in sector A(h, s) is given by a nested Leontief-CES function dened over
the cost of intermediate inputs and primary factors with ad-valorem taxes on factor demands. In
equilibrium, the unit cost must be no less than the market price of output:

s
=

g
p
g
B
bs
+
s
_
_

fs
(w
f
(1 +t
fs
))
1
s
_
_
1
1
s
p
s
0 s|
s
= 1
and

s
=

g
p
g
B
bs
+
s
_
_

f
(w
f
(1 +t
fs
))

fs
_
_
p
s
0 s|
s
= 1
128
Income Balance for Government
Government tax income (PT) is determined by the value of tax revenue, calculated using activity
levels, compensated demands, market prices and ad-valorem tax rates:
PT =

s
(w
f
(1 +t
fs
))
AL
s
w
f
t
fs
Income Balance for Households
Household income is determined by the net of tax return to primary factors plus the household share
of government revenue:
M
h
=

f
w
f
E
fh
+s
h
PT
Market Clearance for Goods
Producer output is equal to the sum of intermediate plus nal demand:
AL
g

s
AL
s
B
gs
+

h
M
h
e
h
(p)
_
e
h
(p)
p
g
_

h
where gamma
h
is the household budget share devoted to the consumption of goods, and e
h
is the
unit expenditure function which may be written:
e
h
(p)
_

ih
p
1
h
i
_ 1
1
h
Market Clearance for Factors
The aggregate supply of factors equals the sum of producer and consumer demand. Producers pay
taxes on factor inputs, consumers do not because we consider these demands to be leisure or
household production. Consumer demands for factors are specied as Cobb-Douglas (constant
budget shares):

h
E
fh
=

s
AL
s

s
(w
f
(1 +t
fs
))
+

fh
M
h
w
f
5.7.2 Shoven
Zero Net Profit
The unit cost of production in sector A
h
s is given by a nested Leontief-CES function dened over the
cost of intermediate inputs and primary factors with ad-valorem taxes on factor demands. Unlike
the Harberger models, tax rates in this model are determined endogenously. In equilibrium, the unit
cost must be no less than the market price of output:

s
=

g
p
g
B
bs
+
s
_
_

fs
(w
f
(1 +t
fs
))
1
s
_
_
1
1
s
p
s
0 s|
s
= 1
129
and

s
=

g
p
g
B
bs
+
s
_
_

f
(w
f
(1 +t
fs
))

fs
_
_
p
s
0 s|
s
= 1
Income Balance for Government
Government tax income (PT) is determined by the value of tax revenue, calculated using activity
levels, compensated demands, market prices and ad-valorem tax rates:
PT =

s
(w
f
(1 +t
fs
))
AL
s
w
f
t
fs
Equal Yield
In equilibrium, tax rates are multiplicatively adjusted to achieve a target level of government revenue:
PT =

g
p
g
Income Balance for Households
Household income is determined by the net of tax return to primary factors plus the household share
of government revenue:
M
h
=

f
w
f
E
fh
+s
h
PT
Market Clearance for Goods
Producer output is equal to the sum of intermediate plus nal demand:
AL
g

s
AL
s
B
gs
+

h
M
h
e
h
(p)
_
e
h
(p)
p
g
_

h
where
h
is the household budget share devoted to the consumption of goods, and e
h
h is the unit
expenditure function which may be written:
e
h
(p)
_

ih
p
1
h
i
_ 1
1
h
Market Clearance for Factors
The aggregate supply of factors equals the sum of producer and consumer demand. Producers pay
taxes on factor inputs, consumers do not because we consider these demands to be leisure or
household production. Consumer demands for factors are specied as Cobb-Douglas (constant
budget shares):

h
E
fh
=

s
AL
s

s
(w
f
(1 +t
fs
))
+

fh
M
h
w
f
130
5.7.3 Samuelson
Zero Net Profit for Private Production
The unit cost of production in sector A
h
s is given by a nested Leontief - Cobb-Douglas function
dened over the cost of intermediate inputs and primary factors with ad-valorem taxes on factor
demands. Unlike the Harberger models, tax rates in this model are determined endogenously. In
equilibrium, the unit cost must be no less than the market price of output:

s
=

g
p
g
B
bs
+
s
_
_

f
(w
f
(1 + t
fs
))

fs
_
_
p
s
0 s
Zero Net Profit for Public Sector Contractors
The unit cost of public provision is determined by the market price of commodity inputs to the
Leontief activity. Input requirements are dened by a vector of public sector input coecients, a
h
g.
In equilibrium, the price paid by the government equals the cost of market inputs:

g
p
g
a
g
p
G
0
Income Balance for Government
Government tax income (PT) is determined by the value of tax revenue, calculated using activity
levels, compensated demands, market prices and ad-valorem tax rates. In equilibrium, the value of
tax revenue equals the market cost of public sector output:
PT =

s
(w
f
(1 + t
fs
))
AL
s
w
f
t
fs
= p
G
G
Income Balance for Households
Household income is determined by the net of tax return to primary factors plus the imputed value
of public provision:
M
h
=

f
w
f
E
fh
+v
h
G
Market Clearance for Private Goods
Producer output is equal to the sum of intermediate plus nal demand:
AL
g

s
AL
s
B
gs
+

h
M
h
e
h
(p)
_
e
h
(p)
p
g
_

h
where
h
is the household budget share devoted to the consumption of goods, and e
h
h is the unit
expenditure function which may be written:
e
h
(p)
_

ih
p
1
h
i
_ 1
1
h
131
Personalized Markets for Public Goods
We assume a pure public good in this model, hence each household may attach a dierent marginal
valuation to public provision in an equilibrium. In order to compute these marginal values, we include
a separate public good market for each houshold which balances the level of provision with the
household demand:
G =

Gh
M
h
v
h
in which
Gh
is the budget share of public goods in the top-level Cobb-Douglas preferences of
household h.
Market Clearance for Factors
The aggregate supply of factors equals the sum of producer and consumer demand. Producers pay
taxes on factor inputs, consumers do not because we consider these demands to be leisure or
household production. Consumer demands for factors are specied as Cobb-Douglas (constant
budget shares):

h
E
fh
=

s
AL
s

s
(w
f
(1 + t
fs
))
+

fh
M
h
w
f
Samuelson Rule for Optimal Provision of Public Goods
The tax rate multiplier is adjusted to balance the marginal cost of public provision with the sum-
mation across households of marginal willingness to pay. Due to the existence of household factor
demand, factor taxes are necessarily distortionary and there will be an excess social cost of public
funds. For this reason, the Samuelson rule is neither necessary nor sucient for optimal provision.
We apply the rule here merely to illustrate the programming methodology, even though the resulting
equilibrium may be suboptimal:
p
G
=

h
v
h
132
6. An Empirical Model
This chapter was jointly authored with Miles Light.
6.1 Introduction
The analysis of economic policy in a micro-consistent framework demands both theory and data.
A common theoretical basis for economic analysis is the Shoven-Whalley (1992) applied general
equilibrium framework which is quite exible and can be applied to a large number of economy-wide
issues (commercial policy, tax reform, environmental policy, etc.). The Shoven-Whalley approach is
normally based on a multi-sectoral dataset which is provided by an input-output table or a Social
Accounting Matrix (SAM). In a textbook exposition, the development of the model and the dataset
are conceptually separate activities; in practice, however, these two activities proceed in parallel.
This paper is intended to document the development of a pilot general equilibrium model for Colom-
bia based on a recent (1996) input-output table. To do this, we follow a path starting with the
Colombian national accounts, then into GAMS-readable format, through structural assumptions
and functional forms, and ending with the nal model structure. We then take the model through a
typical exercise: we calculate the least-cost source of public funds. Because this is an introductory
paper, we do not attempt to model non-standard aspects of indirect taxation such as tax avoidance
or corruption
1
. For concreteness, we formulate a static model with constant-returns to scale. It is
understood that this analysis will ultimately provide a point of departure for subsequent assessments
of tax policy options based on more complex formulations.
The paper has the following structure. In Section 6.2, we consider general features of an IO table and
a Social Accounting Matrix. Section 6.5 describes the process of importing the Social Accounts from
a spreadsheet into GAMS. Section 6.3 presents the key equations in the mcfmodel.gms formulation.
We conduct an illustrative calculation of the marginal cost of additional revenue from dierent tax
sources in Section 6.4.
6.2 Social Accounting
Payments for goods and services can be represented concisely by using a social accounting frame-
work. Dierent industries, consumers and government agents sell and purchase goods, then those
transactions are recorded and combined to form a Social Accounting Matrix (SAM). The informa-
tion contained in a SAM is the starting-point for most general equilibrium models. See Pyatt and
Round (1985) or Ben Kings What is a SAM, (1981) for a more detailed introduction to SAM con-
struction and interpretation. A more recent treatment such as Keuning and Ruijter, Guidelines to
the Construction of a Social Accounting Matrix, (1998) may also be useful.
1
However, we do include an informal labor sector which does not pay labor taxes
133
The business of interpreting a particular countrys accounting data, and creating a sensible economic
framework around a SAM is not so obvious. Often, the social accounts will contain more information
than than necessary for a straightforward GE model. For example, an industry may purchase and
sell the same commodity simultaneously. We know that this probably represents transactions for
slightly dierent commodities within a certain sector, but since we aim to build an overview of
the economy, this sort of simultaneous transaction represents a redundancy. In this section we will
discuss how to interpret a SAM and build a workable CGE model around this data. The Colombian
1996 social accounts are discussed as a specic example of how to build a static GE model from
national accounting data. Some important considerations when doing such an exercise are:
The type of policy analysis What is the purpose of the modeling exercise? If the purpose is
tax-analysis, then it makes sense to include as much domestic tax information as possible, while
other portions of the data (such as specic trade data) can be treated generically. Conversely, a
model to analyze international trade patterns would imply a dierent data aggregation routine
and a dierent model.
The scope of the analysis Is the analysis regional (e.g., is it one state in the United States),
national, or global? The scope of the analysis will help determine where the important data
is.
Quality of data Some portions of national accounting are almost completely ctitious. The
nancial (capital) accounts, for example, are often notoriously inaccurate. Local experts should
use their specic knowledge of the accounts to downplay shady reporting and focus upon what
is known to be more accurate.
6.2.1 SAM Layout
The core of a SAM is the Input-Output table for production. The IO table shows production and use
of commodities, distinguished by sector. In this case, the Colombia 1996 SAM contains 13 sectors,
but other SAMs may contain 100 sectors or more. Each sector uses outputs from other sectors as
intermediate inputs. The IO also includes factors of production such as labor and capital, which are
sold by households and purchased by dierent industries.
Beyond the core IO table are government and household activities. These activities include items
like government taxation and provision, household savings and private or public investment. The
government often represents a substantial portion of the economy in developing countries, so the
transfers between rms, households and institutions are usually included. Colombia is no exception,
government activity there accounts for almost 25% of GDP.
Other miscellaneous information may be available and possibly important. In the case of Colombia,
the informal labor sector represents a large portion of total labor (compared to other countries).
Of course, understanding the scope of informal labor supply and tax avoidance is crucial when
investigating how best to support the government budget. The large informal labor market in
Colombia means labor taxes are not a promising candidate for collecting tax revenues.
Table 6.1 shows the layout for a typical (rectangular) SAM
2
. The sub-matrix A shows industrial
production and use of commodities. This is the core portion of the SAM. Sub-matrix B contains
nal consumption data. This portion of the SAM shows who ended up buying nal production of
2
A rectangular SAM is another way to represent the national accounts. Instead of using Row/Column notation
for sales and purchases as in a square SAM, a rectangular SAM uses negative gures to represent inputs and positive
gures to represent outputs.
134
each commodity. Notice that export is considered to be a nal consumer in this framework. Sub-
matrices C and D list consumption of imports and sales of exports. These imports are either
consumed for intermediate use or nal use. There is often a BOP element, which shows the relative
value of exports minus imports.
Factors of production and other types of endowments are included using sub-matrices E and
F. Submatrix E represents the sales of labor and capital to industry and F represents most of
the household earnings . Institutional transfers, taxes, trade and transportation markups, and any
other transaction is usually listed at the bottom of the SAM using components G and H. Much
of the tricky interpretation relates to the transfers and margins at the bottom of a SAM.
Table 6.1: A Typical (Rectangular) SAM
INTERMEDIATE USE FINAL USE
by Production Sectors Private Govt
1 2 ...j... n consum. consum. Invest. Export
1
Domestic 2
Production :
by i A B
sector :
n
Trade C D
Value added:
-labor
-capital E F
Transfers
-taxes G H
-margins
6.2.2 Colombian 1996 SAM
The SAM for Colombia is shown in Table 6.2. This is a square SAM, because it has an equal num-
ber of rows and columns. The row-sums and column-sums should be equal for any consistent square
SAM. Industrial production as shown in Table 6.2 is aggregated in this document for presentation
purposes only. The 1996 SAM has detailed sectoral tax information, two types of labor (formal and
informal), and two types of rms and capital (public and private). These features are incorporated
into the model. The SAM does not oer household information by income class. This means that
the current model should focus upon eciency issues, rather than distributional impact. Most of
the accounts listed to the right of the ROW account are considered transfers in a static model. A
dynamic model can account for these accumulated variables more accurately.
Next we will discuss the changes that were made to the SAM while constructing the static CGE
model, mcfmodel.gms, and we will construct a rectangular SAM as used in the model.
135
Table 6.2: Original Square SAM for Colombia 1996
(Industrial Detail Aggregated)
Manu- Servcs Govnt Formal Informal Capital Other VAT Commerc Transprt
facturing Services Labor Labor Ind.Tax Margin Margin
Manufact. 15418.3 11206.1 1112.6
Service 8007.9 31629.5 5102.3
Gov Svcs
Formal L. 6766.1 19990.9 10610.1
Informal L. 10723.7 14183.3
Capital 6551.1 20766.1 2026.4
Other Ind.Tx. 364.8 877.4 188.8
VAT 958.7 3227.2
Tariffs 258.7 842.6
Comm. Marg. 6133.8 -6133.8
Trns. Marg. 930.7 -930.7
Indir.Tax 2385.6 119.9
Subsidies -81.9 -47.5
Direct Tax
Households 37376.4 24906.3 6350.7
Government 2742.9 1429.5 4186.9 1100.7
Pub firms 5782.8
Priv firms 14468.5
ROW 5467.1 15525.7 3.1
Acummulation
Stocks
Public Inv
Private Inv
Original Square SAM for Colombia 1996 (continued...)
Indirect Subsidies Direct H.Holds Govnt Public Private ROW Accum- Stock Public Private
Taxes Taxes Firms Firms ulation Invest Invest
Manufact. 24108.5 10704.8 778.5 5.9 550.3
Service 40940.5 4602.1 -219.8 5025.9 16168.1
Gov Svcs 916.9 18122.5
Formal L. 12.4
Informal L.
Capital
Other Ind.Tx.
VAT
Tariffs
Comm. Marg.
Trns. Marg.
Indir.Tax
Subsidies
Direct Tax 1555.5 48.5 4133.1
Households 115.2 4702.1 604.2 8881.3 4178.8
Government 2505.5 -128.4 5737.1 5593.1 6647.1 1061.1 2453.8 203.9
Pub firms 442.5 109.2 713.3 33.6
Priv firms 7714.7 2177.5 950.6 11098.9 736.1
ROW 678.5 163.4 2489.6
Acummulation 5727.7 -3823.7 4143.5 7375.2 3855.4
Stocks 559.7
Public Inv 5030.7
Private Inv 16718.4
136
6.2.3 Data Management and Model-Building
Some adjustments to thte 1996 social accounting matrix were required in order to produce a dataset
consistent with the static model. This section goes through a few of the interpretations for the
Colombian data. We feel that GAMS provides the most consistent environment for data adjustments,
hence the rst step in the process is to import the SAM from the XLS worksheet into GAMS. We
imported the 1996 data into gams using xlimport, then began compartmentalizing the accounts for
the model.
6.2.4 Details
The SAM for mcfmodel.gms is shown in Table 6.3. We itemize some aspects of the data adjustments
and the interpretations below:
Intermediate Inputs The IO table is copied almost exactly as is appears in the 1996 SAM. One
change was a netting of production outputs and the own-use of output within an industry. For
example, the 118.8 million dollars going from Other Crops to itself (cell E9 in the spreadsheet) was
subtracted from production.
Indirect Taxes Indirect taxes represent a composite of three items from the original SAM: indirect
taxes (21), other indirect taxes (26), and subsidies (27).
Labor taxes are shown in the original SAM as a single tax on formal labor supply. This tax is divided
up and applied at the production level, so that each producer pays a small share of the total labor
tax (as an input tax).
Capital Taxes - treated similarly to labor taxes, each production sector pays their share of the total
tax as an input tax.
Trade and Transport Margins The SAM contains margins, or markups, between production and
consumption. The trade margins represent transportation costs or markups for retail shops. We
can see that these margins must be paid by most industries, but they are collected (indicated
by a negative number in the SAM) by other sectors. The transport industry collects most of
the transportation margins, and the service industry collects commercial margins. The problem
arises because the margins have both positive and negative entries. The traditional interpretation
is that they are negative inputs to production. However, production functions are not dened
for negative numbers, so these margins had to be accounted-for elsewhere. To solve the problem, a
separate margin commodity was created for inputs and for outputs. Positive margins were treated
as an input to production for most sectors, negative margins were treated as an additional output
for the transport, oil, and service sectors. This portion of the SAM is a good example of how some
of the more mysterious entries must be interpreted.
Foreign Exchange Colombia is a Small Open Economy (SOE) because Colombias international trade
activities have a minimal impact on world prices. We record trade using the pfx (price of foreign
exchange) commodity. pfx represents Colombias exchange rate on the world market. For example, if
imports fall relative to exports, the decreased demand for pfx will make foreign goods seem relatively
less-expensive. In the Rectangular SAM, the pfx row only shows net exports. In the model, imports
are combined with their domestically-produced counterparts before nal consumption. Exports are
explicitly sold in exchange for pfx.
Capital Transfers Items 31 and 32 in the original SAM show capital transfers between public and pri-
vate companies and other agents in the economy. These transfers are nancial transactions, which
137
are important, especially in monetary economics. But since we are working with real production
and consumption, these accounts are omitted.
Resources Payments Natural resources are an important factor for extraction industries, because
they are a xed factor. The inclusion of this xed factor reects the fact that extraction industries
exhibit decreasing returns to scale, so that a developing country cannot simply extract natural
resources indenitely. We included a resource payment, which is considered part of the return to
capital, and reects a certain level of xed inputs. Country experts should consider the best value-
share to choose for each industry. The rectangular SAM shows these estimates for the current static
model.
Other Items Accumulation (34) and the Change in Stocks (35) have also been omitted from the
model along with the capital transfers.
Table 6.3: Rectangular Social Accounting Matrix for MCFMODEL
Manufact Service Government Government Investment Household Total:
Industries Industries Services Agent Agent
Manufact 44976.4 -10910.2 -1436.7 -1918.7 -30710.8 0.0
Service -9120.6 68626.7 -4778.0 -20389.9 -34338.3 0.0
Gov Serv 19039.2 -18122.5 -916.6 0.0
FOREX 4690.9 -10376.3 6344.3 -658.9 0.0
Formal L -7577.5 -18066.0 -10168.5 35812.0 0.0
Informal L -11285.8 -13620.5 24906.3 0.0
Privat K -3728.1 -16818.4 20546.4 0.0
Public K -2026.3 2026.3 0.0
Resources -2637.6 2637.6 0.0
VAT -1571.1 -2615.2 4186.3 0.0
TM -349.6 -751.0 1100.6 0.0
TL -329.0 -784.5 -441.5 1555.1 0.0
TK -1135.1 -2998.9 4134.0 0.0
IndTx -2758.7 -860.1 -188.1 3806.9
Trans Marg -945.2 945.2 0.0
Comerc Marg -8229.1 8229.1 0.0
Investment -5030.8 22308.5 -17277.7 0.0
Total: 0.0 0.0 0.0 0.0 0.0 0.0
6.2.5 Checking Consistency
Since the original 1996 SAM was consistent, our primary goal after including and adjusting the
accounts via the static model is that all of the accounts still balance. In the model, we create an
aggregate good, called and Armington Composite Commodity, which combines domestic production
and imports. This aggregate commodity, A
j
, is used as an intermediate input or for nal demand.
At a minimum, we check supply/demand balance using this commodity. On the left side, A
j
is
a combination of domestic production, imports and (specic to Colombia) trade and transport
margins:
A
j
= D
j
+M
j
P
M
j
+

m
(Mrg
D
j
Mrg
S
j
)
Now, we know that A
j
is supplied for intermediate and nal demand, so that the following equation
must hold:
A
j

i
ID
ij
C
j
I
j
G
j
= 0.
If a SAM is not balanced, the analyst gure out what went wrong, and then decide how to remedy
the situation. Another issue is the interpretation of certain taxes and subsidies. For example, value-
138
Table 6.4: Echo Print of Base Year Value Shares
X/(X +D)% L/V % M/(M +D)% L
F
/(L
F
+L
I
)% GDP%
COF 90 100 0 30 1
CRO 0 95 1 19 5
LVS 2 92 6 19 1
FFH 62 23 0 100 3
OIL 70 66 10 38 2
MIN 37 31 0 68 0
THR 35 99 21 28 6
FOD 5 64 5 45 4
NRI 11 53 22 84 4
NSI 18 65 24 67 3
HTC 16 48 57 91 3
CON 0 56 0 61 7
TRN 8 91 6 65 5
ELE 0 26 0 100 3
COM 10 36 4 98 2
SER 0 66 2 51 35
GOV 0 84 0 100 14
1. X/(X +D)% is the export value-share in total production.
2. L/V % is the labor value-share in total value-added.
3. M/(M +D)% is the import value-share in total consumption.
4. L
F
/(L
F
+L
I
)% is the formal labor share of total labor.
5. GDP% is the percentage of total GDP.
added tax (VAT) can be interpreted as a tax on labor and capital as factors of production, or it can
be interpreted as a consumption tax (since investment is not taxed). The tax system adopted for
mcfmodel.gms is described in Section 6.3.4. The implication of any assumptions are usually checked
by conducting a sensitivity analysis, where the results from a policy simulation are tested with and
without imposing certain modeling assumptions.
In is section we described how to convert a SAM into a CGE model conceptually. We also describe
the specic computational details about how to convert the original SAM data, located in an Excel
spreadsheet, into a GAMS dataset and model. These details are listed in Appendix 6.5.
6.2.6 Forensic Calculations
When assessing a new dataset it is helpful to rst develop a sense of the key statistics in the social
accounting matrix. Table 6.4 provides some of these indicators, including the export share of market
supply (E/(E + D), the labor share of value-added (L/V ), the import share of domestic supply
(M/(M + D)), formal labor share of wage payments (L
F
/(L
F
+ L
I
)), and (in the nal column)
sectoral shares of aggregate GDP.
Value-added and indirect tax rates are computed from the SAM and are round to vary considerably
across sectors. Likewise, we use the tari and import rows from the SAM to compute the benchmark
tari rates. All of these tax rates are shown in Table 6.5.
139
Table 6.5: Percentage Tax Rates from 1996 SAM
V AT T
Y
T
M
V AT T
Y
T
M
COF 1 NSI 25 1 5
CRO 2 HTC 53 1 6
LVS 6 CON 1
FFH 6 TRN 1 1
OIL 2 4 ELE -1
MIN 1 19 COM 21 1
THR 3 SER 2 1
FOD 2 1 6 GOV 1
NRI 24 14 5
6.3 A Static General Equilibrium Model
In this section, we work through the model framework for the basic static model: mcfmodel.gms.
A typical analysis may require a custom-tailored version of this basic model, but the underlying
assumptions and model structure will typically remain intact. Thus, the documentation underlying
this model can be recycled for subsequent models derived from the mcfmodel.gms general structure.
mcfmodel incorporates several key elements of the social accounts, including:
Two types of labor (formal and informal)
Five sets of tax instruments:
1. Value-added taxes, applied to primary factor inputs (vat)
2. Import taris (t
M
)
3. Direct taxes on capital (t
K
)
4. Direct taxes on formal labor (t
F
)
5. Indirect taxes and substitutions on production (t
i
)
Armington dierentiation of domestic and foreign goods, include a constant-elasticity of substi-
tution aggregation of imports and domestic goods and a constant elasticity of transformation
between goods produced for domestic and export markets
Constant investment demand
Constant elasticity of transformation between labor supplied to the formal and informal labor
markets. When the elasticity is set to zero, both types of labor are in xed supply.
6.3.1 General Overview of GE Modeling
The static model recreates an Arrow-Debreu (1954) general economic equilibrium model
3
. Each
consumer has an initial endowment of labor, capital, and resources, and a set of preferences resulting
in demand functions for each commodity. Market demands are the sum of consumer and intermediate
demand. All of the consumers are typically combined to for a representative agent, with aggregated
3
For a detailed discussion of general-equilibrium, see Arrow and Hahn (1971), and Shoven and Whalley (1992).
140
demand and total endowments. Commodity market demands depend on all prices and satisfy
Walrass law. That is, at any set of prices, the total value of consumer expenditures equals consumer
incomes. Technology is described by constant returns to scale production functions. Producers
maximize prots. The zero homogeneity of demand functions and the linear homogeneity of prots
in prices (i.e. doubling all prices double money prots) imply that only relative prices are of any
signicance in such a model. The absolute price level has no impact on the equilibrium outcome.
Equilibrium in this model is characterized by a set of prices and levels of production in each industry
such that the market demand equals supply for all commodities. Since producers are assumed to
maximize prots, and production exhibits constant returns to scale, this implies that no activity
(or cost-minimizing technique for production functions) does any better than break even at the
equilibrium prices. Mathiesen (1985) has shown that an Arrow-Debreu model can be formulated and
solved as a complimentarity problem. Accordingly, three types of equations dene an equilibrium:
market clearance, zero prot, and income balance.
6.3.2 Economic Flows
The relationship between dierent sectors and consumers in mcfmodel is shown in Figure 6.1. Taxes
are discussed in the next section and therefore, for simplicity, do not appear in this gure.
E Y
D M A
RA, Gov
G I C

-
?

H
H
H
H
H
H
H
H
HY
J
J
J
J]

? ? ?
K
L
R
Figure 6.1: Flows in mcfmodel.gms
Production (denoted as Y ) combines three factors: capital K, labor L, resources R, and intermediate
inputs A, to produce outputs going to the domestic market D or the export market E. An Armington
Composite good (Armington, 1969) (denoted as A) is a combination of domestic goods D and imports
M. Armington aggregate goods are the basic consumption commodity. They are consumed by
industry as an intermediate input and they are also goods for nal consumption, C, government
141
consumption G, and or investment I. Consumers, RA, and the government, Gov are endowed with
factors of producton (L, K, R), which get sold to industry (Y ). They are also the nal consumers,
who use income from factor sales to purchase Armington goods (C via A), to invest (I), or to create
government services (G).
6.3.3 Symbol Table
Any model exposition can quickly become confusing when symbols are ambiguous. Key symbols are
listed in Table 6.6.
Note that these symbols may not correspond directly to symbols in the computer code. For example,
we use i and j for set identiers in the paper, but in the mcfmodel.gms model code, the set identiers
are s and ss.
The model has the production sectors detailed in Table 6.7.
142
Table 6.6: Symbol Lookup Table
Set Label Elements
i (or j) Sectors (listed in Table 6.7)
l Labor types {formal, informal}
k Capital types {public, private}
m Margin types {trade, commerce}
Symbol Description
Y
i
Production of good i
x
ij
Intermediate Input: level of A
i
used in sector j production
L
i
Formal labor input into sector i
L
Ii
In-formal labor input into sector i
K
i
Capital input into sector i

R
i
Fixed-supply natural resource input into sector i
A
i
Armington aggregate good (Imports plus Domestic)
E
i
Export output of good i
D
i
Domestic output of good i
M
i
Imports of good i
I
i
Investment demand i
G
i
Government demand
C
i
Household nal demand
a
ij
Share parameter for factor inputs
Taxes
t
i
, t
F
, t
K
Production, Formal-labor, and Capital taxes, respectively
vat
i
Value-added tax
Prices
p
i
Output price of the Armington aggregate, A
i
w
l
Wage for formal or in-formal labor
rk Single-period (rental) price of capital
pfx Aggregate exchange rate
143
Table 6.7: Sectors in the 1996 SAM
cof Coee
cro Other crops
lvs Livestock
ffh Forestry shing and hunting
oil Oil
min Other Minerals
thr Coee Threshing
fod Foodstus
nri Natural Resources Intensive Industries
nsi Non-skilled Labor Intensive Industries
htc Capital and High Technology Industries
con Construction
trn Transport
ele Electricity Gas and Water
com Communications
ser Private Services
gov Government Services
6.3.4 Functional Forms
The Constant Elasticity of Substitution (CES) function is adopted for the static model. CES func-
tions are widely accepted by economists because they are globally regular, and can be dened by their
zeroth, rst, and second order properties. This means that the location (price and quantity), slope
(marginal rate of substitution), and curvature (or convexity) completely characterize a CES produc-
tion or consumption function. MPSGE is a convenient modeling tool because it accepts these three
arguments and automatically constructs a CES function in the model. This allows economists to
take a high-level approach to production and consumption. Production and consumption structure
is dened by showing the linkage between sectors and the elasticity of substitution in consumption
and production.
Using this convention, the model structure for mcfmodel is shown in Figure 6.2, where is the
elasticity of substitution and is the elasticity of transformation.
Production Functions
Production Inputs Goods are produced according to a nested Leontief-Cobb Douglas technology.
Intermediate inputs and aggregate value-added enter at the top level:
Y
i
= min
_
min
j
_
x
ji
a
ji
_
,
v
i
b
i
_
Value-added represents a Cobb-Douglas aggregation of labor, capital and sector-specic resources:
4
v
i
= L

F
Fi
L

I
Ii
K

i
R

i
4
The numerical model permits the more general CES functional form for valued-added based on model input
esubkl. When this input is unity, value-added aggregates are Cobb-Douglas as shown here.
144
Figure 6.2: mcfmodel.gms production structure
R K L

@
@
@
6 6 6
A
1
... A
j

L
L
L
@
@
@
!
!
!
!
!
a
a
a
a
a
Y
i
!
!
!
!
!
a
a
a
a
a
E
i
D
i
M
i
A
i
!
!
!
!
!
a
a
a
a
a
-
6
C, G, I
`
` `
`
_
= 1 = 0
= 0
= 1
= 4
?
RA
in which constant returns to scale implies that
F
+
I
+ + = 1.
5
Production Outputs Each production sector Y produces two types of commodities: domestic goods
D
i
and goods for export E
i
. These goods are assumed to be imperfect substitutes, and they have
a constant elasticity of transformation. An algebraic formulation of this transformation function is
written:
Y
i
= g(D
i
, E
i
) =
_

D
i
D
1+1/
i
+ (1
D
i
)E
1+1/
i
_
1/(1+1/)
where
D
i
is the benchmark value share of domestic sales in total output for sector i and corresponds
to the model input etrndx.
Imports The model adopts an Armington representation of the import demand. Armington goods,
A
i
, are produced by combining domestic goods with imports from the same sector. These goods are
treated as imperfect substitutes (e.g., Coee from Colombia vs. Java). We use as the Armington
elasticity, which corresponds to esubdm in the computer code.
A
i
=
_

M
i
M
11/
i
+ (1
M
i
)D
11/
i
_
1/(11/)
Some confusion can arise trying to distinguish between production, Y
i
, output (D
i
,E
i
) and the
consumption good (A
i
). The Armington aggregate good is the main commodity for use in production
and nal demand. It combines domestic output, D
i
(which is produced via Y
i
), with imports, M
i
.
5
For purposes of illustration we assume that sector-specic resource inputs are a given fraction of the base year
capital earnings: Coee (25), Other crops (25), Livestock (25), Forestry shing and hunting (25), Oil (75), Other
Minerals (75), Natural Resources Intensive Industries (50). Model input resource can be used to scale assumed
resource shares of base year capital income. When resource=0, sector-specic resources are omitted from the model.
145
Trade Balance The real exchange rate () is determined by supply of exports and demand for
imports, which is determined in units of foreign currency.

i
p
E
i
E
i
+B =

i
p
M
i
M
i
Holding all else equal, rising import demand will increase , which reects increased demand for
external currency. The xed parameter B denotes the exogenously-specied current account balance.
Because this is a small-open economy, import and export prices (p
E
i
, p
M
i
) are xed exogenously.
Consumption, Investment and Government
Final Consumption A single representative agent (RA) is endowed with primary factors of produc-
tion: capital, labor, and resources. The RA demands investment, private and government goods.
Investment and government output are exogenous, while private demand is determined by utility
maximizing behavior. The RA utility function is a Cobb-Douglass:
U(A
i
) =

i
A

i
i

i
= 1
The RA maximizes utility subject to a budget constraint:
max
A
i
U(A
i
)
s.t.

i
p
i
A
i
p
K
K +p
L
(L
I
+L
F
) +p
R
R +trn I
Investment In the static formulation, investment demand is held constant at base-year levels. In-
vestments are aggregated into a single, national investment pool, then distributed among production
and government sectors according to base-year accounts. Investment funds come from households
and government. The level of investment can be altered in the steady-state formulation, which is
discussed in section 6.3.5.
Government The government spends money on the purchase of government services and investment.
Purchases are supported with tax revenue, capital rents, and net foreign exchange transfers. Total
tax revenues are described in section 6.3.4.
Tax Structure
Production inputs are subject to three types of taxes, value-added is taxed at rated vat
i
, formal
labor is taxed at rate t
F
and capital earnings are taxed at rate t
K
. Resource inputs are sector-
specic, hence their inputs are xed and the tax applied to resource inputs is lump-sum. Capital
and labor allocations are, however, price-responsive. Hence dierences in VAT rates across sectors
lead to eciency costs which are captured in the model. Tax-inclusive cost of production is then:
Cost
Y
i
=

j
p
j
x
ji
+ (1 +vat
i
)[w
F
(1 +t
F
)L
F
i
+w
I
L
I
i
+ (1 +t
K
)(rkK
i
+r
i
R
i
)]
Tax-inclusive output value for Y is:
V alue
Y
i
= (1 +t
Y
i
)
_
p
D
i
D
i
+p
X
i
X
i
_
146
In equilibrium, the tax-inclusive cost of production equals output value across all sectors, this rep-
resents the zero-prot market condition.
Import taris are included into the Armington commoditys unit cost function:
p
i
=
_

M
i
_
p
M
i
(1 +t
M
i
)
p
i
M
_
1
+
_
p
D
i
p
i
D
_
1
_
1/(1)
The benchmark tax rate applied on formal labor inputs (t
F
) is based on direct tax payment by
households in the SAM and gross payments to formal labor. In Colombia, the imputed tax rate on
a net basis is 4.3%. The benchmark tax rate applied to private capital (t
K
) is based on the direct
tax payments by private rms and the gross payments to capital in all non-government sectors. The
imputed tax rate here is 17.8%.
The Colombian static model tax application is shown graphically in Figure 6.3.
E
i
Y
i
D
i
M
i
A
ji
RA
G I C
GOV

-
?

H
H
H
H
H
H
H
H
HY
J
J
J
J]

-
? ?
K
L
R
t
Y
t
Y
t
F
t
K
t
K
t
M
?
vat, t
F
, t
Y
, t
M
, t
K
Figure 6.3: Taxes in mcfmodel.gms
147
6.3.5 Other Model Features
Steady-State
A major drawback of static analysis is the presence of a xed capital stock which does not align
with investment. Logically, the level of investment depends upon depreciation, interest rates and the
capital stock. Static CGE models usually fail to address the possible changes to investment and the
capital stock the counterfactual. We remedy this drawback by including the Steady-State option.
The Steady-State feature allows capital and investment to change in response to policy directives,
as would happen in a long-run analysis. The adjustment process is consistent with the following
complimentarity condition:
(p
inv
= rk)
The scale parameter, , is complimentary to the steady-state investment equation above, so when rk
rises relative to p
inv
, scales up government and private investment to reect the arbitrage condition.
Thus, in the steady-state equilibrium, adjusts investment so that investment is consistent with
the return to capital. This is done in the MPSGE program using a $constraint:
$constraint:kstock
pinv =e= rk("private");
kstock ( in the documentation) then scales government and private investment in the $demand
blocks:
$demand:govt
d:p(s) q:g0(s)
e:pinv q:(-govtinv) r:kstock
e:rk(k) q:govtk(k) r:kstock
e:pfx q:govttrn
$demand:hh
d:pc q:(sum(s,c0(s)))
e:pinv q:(-hhinv) r:kstock
e:rk(k) q:hhk(k) r:kstock
e:pfx q:hhtrn
e:wage q:(sum(l,ls0(l)))
e:pr(s) q:rd0(s)
If kstock is xed at unity, then the steady-state feature is disabled, allowing for a short-run
comparative-static analysis.
Informal Labor Supply
The labor supply in mcfmodel.gms is xed. However, this labor endowment can be allocated to
either formal labor supply (L
F
) which is taxed, or informal labor (L
I
) which is un-taxed. Agents
choose how much of each type to supply according to relative wages. The benchmark data reects
a substantial informal labor supply, with almost 40% of the total labor endowment going to the
informal sector. The labor-supply unit-revenue function is written:
w =
_

L
_
w
F
w
F
_
1+
L
+ (1
L
)
_
w
I
w
I
_
1+
L
_
1/(1+
L
)
148
Where
L
represents the model elasticity etrnl. The detailed labor supply and demand structure
is shown in Figure 6.4.
Figure 6.4: Detailed Labor Supply/Demand
L
@
@
@

@
@
@
L
I
L
F
`
= 1
_

L
RA
Y
The rst partial-derivative (
w
w
l
) determines sector-specic labor supply:
L
F
=
L
_
w
w
F
_

L
L
I
= (1
L
)
_
w
w
I
_

L
Labor is taxed as an input to production by the direct labor tax (t
F
) and value-added taxes (vat).
These taxes change equilibrium wages, and the corresponding split between formal and informal
labor supply.
6.3.6 Harris-Todaro Employment
We include a richer description of labor migration and unemployment in the Harris-Todaro model,
called htmodel.gms.
In this formulation unemployment, urban-rural migration, and the real wage are linked. The ur-
ban (formal) unemployment rate is determined by a wage equation, which uses a wage elasticity
parameter, . The real wage for formal labor and informal labor is determined by the total labor
supply, after migration, and the total demand for each type of labor. Migration between formal and
informal labor markets equalize the informal wage and the expected wage in the formal market.
Unemployment
The unemployment rate is determined through a wage equation which postulates a negative rela-
tionship between the real wage rate and the rate of employment:
w
P
= g(ur) (6.1)
149
where P denotes a consumer goods price index and ur is the unemployment rate, taken to be 16%
for 1997 in Colombia. This type of wage equation can be derived from trade union wage models, as
well as from eciency wage models (e.g., Hutton and Ruocco, 1999). Figure ?? illustrates the wage
curve in a traditional labor market diagram (instead of the w/p - ur space from equation 6.1). In
this gure, the real wage rate is measured on the vertical axis and the quantity of labor is measured
on the horizontal axis.
Figure 6.5: The formal-sector wage curve and unemployment
Full employment occurs with the real wage rate of (w/P)
0
a the intersection of the (inverse) labor
demand function, L, and the formal labor supply function, L
S
. Here, we replace the labor supply
curve with the real wage curve from equation (6.1). Consequently, the equilibrium wage rate (w/P)
1
lies above the market clearing wage rate. This causes unemployment equal to (L
S
)
1
L
1
.
In htmodel.gms, we specify the wage equation, g(ur) using an elasticity parameter, :
w
P
= g(ur) = ur
1/
if < (6.2)
and
w
P
= 1 if =
As , the real wage curve approaches a a neoclassical, downward-rigid real wage.
Migration
Following Todaro (1970), we link the labor migration rate, the real-wage dierential, and unemploy-
ment. Migration occurs when the expected real wage stream for urban employment is high relative
to rural (informal) employment. In our treatment, workers migrate into the formal labor sector until
informal wages are equal to expected formal wages.
w
I
= (1 ur) w
F
(6.3)
The expected wage in the formal sector is the wage, w
F
, times the employment rate (1ur). In the
htmodel, we specify the initial unemployment rate to be 16%, which was the 1997 rate in Colombia.
As ur rises, the gap between formal and informal wages widens.
Labor supply for the formal and informal sectors is determined by the migration rate and the
unemployment rate. First, the supply of formal labor is equal to the employed fraction of the
workers who chose to migrate to the formal sector:
L
F
= L
F
0

1 ur
1 ur
0

m
m
0
(6.4)
where m is the migration rate between the informal and formal labor sectors, ur
0
is the initial
unemployment rate, and L
F
0
is the benchmark formal labor supply. Then the informal labor supply
is equal to those workers who did not migrate:
L
I
= L
I
0

1 m
1 m
0
. (6.5)
150
The analyst is free to choose the elasticity of transformation between the formal and informal labor
sectors. In the Overview of the Harris-Todaro model for Colombia, this elasticity is estimated at
3
10
.
In the htmodel framework, the net migration level will depend upon this elasticity of transformation,
as well as the wage equation parameter, , and the unemployment rate.
6.3.7 Equilibrium Conditions
Three equation classes dene an Arrow-Debreu equilibrium in mcfmodel.gms:
Zero Prots: Cost
i
(p) Rev
i
(p) Y
i
Market Clearance: D
i
+M
i

j
A
ij
+E
i
+RA
i
+GOV
i
p
i
Income Balance:

i
p
i
A
i
w

L +p
K

K +p
R

R +trn I for (GOV,RA)
Zero Prot Thee rst class of constraint requires that in equilibrium no producer earns an excess
prot, i.e. the value of inputs per unit activity must be equal to or greater than the value of outputs.
The corresponding complementary variable for a zero prot condition is output (Y
i
). Holding all
else equal, if output prices rise for commodity i, production activity increases until marginal cost
equals marginal revenue.
Market Clearance The second class of equilibrium conditions is that at equilibrium prices and ac-
tivity levels, the supply of any commodity must balance or exceed excess demand by consumers
and producers. The equation above refers to produced commodities, a similar constraint holds for
endowed goods like labor, capital and resources.
The corresponding complementary (dual) variable for the market clearance condition is price (p
i
or
p
F
, p
K
, P
R
, w). Prices adjust until supply equals demand for a given commodity or factor.
Income Balance The third condition is that at an equilibrium, the value of each agents income
must equal the total value of expenditures. We always work with utility functions which exhibit
non-satiation, so Walras law always holds.
6.4 Conducting Economic Policy Analysis
6.4.1 Example: Compute the Marginal Cost of Funds
Having implemented the model we do some initial calculations in which we assess the welfare cost
of the ve tax instruments. In each calculation we proportionally increase tax rates by 10%. The
tax streams we evaluate are the value-added tax (revenue 4.2), the import tari (1.1), the labor
tax (1.6), the direct tax on capital (4.1) and other indirect taxes (3.8). When we scale tax rates,
consumers and producers adjust behavior to produce a new equilibrium consistent with a new level
of government income and expenditure. Government expenditure increases less than proportionally
151
Table 6.8: Marginal Eciency and Incidence of Base Year Taxes
Y IELD MCF MCF
F
MCF
I
MCF
K
VAT 70% 1.27 -0.12 -0.19 -0.71
TY 75% 1.30 -0.02 -0.52 -0.38
TM 66% 1.09 0.11 -0.61 -0.26
TL 71% 1.10 -0.36 -0.18 -0.15
TK 62% 1.10 0.33 -0.18 -1.20
to the tax rate as a result of changes in individual behavior.
Table 6.8 indicates the results of calculations with the static model. There is one row for each of
the tax instruments. The rst column of Table 6.8 indicates the responsiveness of the tax based to
changes in the tax rate. A 70% yield means that when the tax rate is increased by 10%, aggregate
tax revenues only increase by 7%. The column titled MCF indicates the marginal cost of funds,
based on the welfare cost of a marginal tax increase. This column suggests that in a static model
the system of indirect taxes (TY ) is the most costly source of tax revenue while the import tari
(TM) is the least costly revenue source, in which the economic cost of raising $1 of additional public
revenue costs roughly $1.10.
The nal three columns in Table 6.8 indicate the marginal incidence of each tax instrument for formal
labor (MCF
F
), informal labor (MCF
I
) and capital (MCF
K
). The marginal incidence indicates the
percentage change in the real return to each of these factors per percentage increase in tax revenue.
The value of -0.12 for VAT for formal labor indicates that a one percent increase in tax revenue
nanced through an increase in the VAT produces a 0.2% decrease in the real wage of formal sector
workers and a 0.7% decrease in the real return to capital.
6.4.2 Short Run vs. Long Run Tax Incidence
Table 6.9: Tax Eciency in the Steady-State
Y IELD MCF MCF
F
MCF
I
MCF
K
K
VAT 67% 1.72 -0.45 -0.44 -0.07 -1.65%
TY 73% 1.56 -0.20 -0.71 0.02 -0.88%
TM 64% 1.32 -0.06 -0.79 0.16 -0.21%
TL 70% 1.20 -0.43 -0.24 0.01 -0.14%
TK 57% 1.86 -0.20 -0.65 -0.07 -2.31%
1. The K column shows the percentage change in the national
capital stock.
The cost of additional funds, when taken from a long-run perspective shows us two things. First,
152
the cost of funds is much higher when agents are allowed more time to adjust. The marginal cost
of funds (MCF) column in Table 6.9 is about 50% higher when taken from a long-run perspective.
This is intuitive, since in the long-run, the demand for all goods is relatively more elastic, which
implies a less-ecient tax instrument. Second, we see that raising direct labor taxes is less costly
in the long-run. This is obvious given that we are now allowing capital stock to adjust to changes
in the economy. In most dynamic tax analyses (cite some papers here), investigators nd that
labor taxation is preferred from an eciency standpoint because long-run labor supply is relatively
inelastic when compared to long-run capital supply. Import taris remain a relatively in-expensive
source of government revenues relative to capital or indirect taxation.
6.5 Data Processing
The rst step in dealing with a SAM is to transfer the data into GAMS readable format. In order
to transfer an Excel le into GAMS format, we use the following:
sam1996.xls (Original data le)
sam.gms (Data extraction program)
xllink.exe (XL conversion utility)
gams2prm.gms (GAMS data utility)
If you do not have xllink.exe and gams2prm.gms, read about how to download and install them
at: http://debreu.colorado.edu/inclib/tools.htm
We start with the Microsoft Excel le named sam1996.xls. The spreadsheet consists of row and
column headings, and a 37x37 data matrix. The data ows from the xls le into the model as
depicted in Figure 6.6:
Figure 6.6: Data Flow from Excel to GAMS
sam1996.xls --------> sam.dat ---------> mcfmodel.gms ----> output
| |
sam.gms data-checking
xlimport.gms sam(r,c)
gams2prm.gms map(*,r)
First, sam.gms manages the data transfer from .xls to .dat, then sam.dat is included directly
into the main GAMS model, mcfmodel.gms. The rst part of mcfmodel.gms interprets the national
accounts data and checks for consistency. At this point, the data is ready to be included in the CGE
model. In order to minimize the number of potential mistakes, we stress the necessity of multiple
checks during the process of data transformation and model building.
153
Converting the data from XL format into GAMS-readable format is a one-time aair. Once the data
is converted, only the GAMS dataset (sam.dat) is required
6
. Each step in this process is described
below.
6.5.1 The Excel input le
Each account is referenced in the xls le using a long description, such as Forestry, Fishing and
Hunting. To facilitate moving the data out of the spreadsheet, row and column index numbers are
used to identify each element. The descriptive sector names will be re-applied downstream, in the
model itself.
Figure 6.7: The 1996 Colombia SAM with Numbered Rows and Columns
6.5.2 Reading the SAM into GAMS with XLIMPORT
A small GAMS program, called sam.gms moves the 1996 data from xls format into a GAMS
dataset
7
. sam.gms uses the spreadsheet import routine, xlimport
8
, which must be installed before
data can be moved between GAMS and Excel. The basic syntax for xlimport is as follows:
$LIBINCLUDE xlimport parameter le range
where
parameter is a name of the GAMS parameter to which data will be retrieved;
le is a name of a le from which data will be read;
range is a range of data in the file which needs to be imported.
This command is part of sam.gms, shown below:
sam.gms (partial listing):
1 set r /1*37/; alias (r,c);
2 parameter sam(r,c) Original SAM data for 1996;
3 $libinclude xlimport sam sam1996.xls samdata
4
5 file kdat/sam.dat/; put kdat;
6 $libinclude gams2prm sam
6
Of course, hold onto the original data in case sam.dat becomes unreadable or is deleted!
7
It is useful to note that a GAMS dataset is simply a text le which complies with GAMS syntax. GAMS datasets
are not binary, and they can be opened and viewed with any text editor.
8
xlimport, xlexport, and xldump are all functions included in the xllink.exe utility. For installation and syntax
information, visit http://debreu.colorado.edu/xllink/xllink.htm
154
Line 1 denes the row and column dimensions for the spreadsheet to import. Thus, rows and columns
1 . . . 37 should correspond to rows/columns in the spreadsheet. Next, the parameter sam(r,c) is
dened as a 37x37 matrix to hold the original spreadsheet data. sam(r,c) is used as a temporary
place-holder for the data until economic parameters are dened in the main GAMS model. Line 3
executes the xllink.exe utility and extracts the data from the Excel spreadsheet.
A new datale is created using lines 5 and 6. First an output handle (kdat) is created. This handle
is an alias for the physical le, called sam.dat, the GAMS data le. The gams2prm utility is used
to export sam(r,c) into the le sam.dat.
Here is the dataset created using sam.gms:
sam.dat (partial listing):
parameter sam Original SAM data for 1996/
*=>gams2prm sam
* Called from J:\SAM.GMS, line 1479
* 11/29/01 09:41:04
1.2 2.1250985919499E+00
1.3 5.6248830334883E-01
1.4 1.0322435297989E-01
1.6 4.4898020242278E-05
1.7 2.0578320648199E+02
1.8 2.2765243456326E+01
1.9 5.2251918488353E+00
1.10 7.3400583958944E-06
1.11 3.1007968762837E-01
1.12 2.7406671636713E-01
1.14 3.4119510427834E-02
...
sam.dat is a text le which can be inserted directly into any GAMS program. The gams2prm utility
dened the parameter sam, using the same description as in sam.gms, then wrote out each element
of the matrix according to index number. For example, element 1.9, equal to about 5.22 million
1996 dollars, represents the input of Coee into the Natural Resource Intensive Industries sector.
We insert sam.dat into the main GAMS program, mcfmodel.gms, then dene each data element for
use in the model.
6.5.3 Economic Accounting and Consistency Checks
At this point, we can include the data into mcfmodel.gms and make some economic interpretations.
The sam.dat data le is inserted by using the $include directive, as in
mcfmodel.gms (partial listing):
$include sam.dat
This pastes the contents of sam.dat into the program exactly where the $include statement is used.
155
Data Mapping GAMS provides users with the luxury of using human notation for set elements.
For example, the Oil sector in the model could have been called sector 5, but a much better
abbreviation is something like oil. So we dene a set of production sectors, S, with each row of
the SAM as elements:
mcfmodel.gms (partial listing):
set s Sectors /
cof Coffee
cro Other crops
lvs Livestock
ffh Forestry fishing and hunting
Next, we make an association between the set S, and the rows/columns in the dataset. This can
be done eciently by using a temporary set called map(*,r). Where the basis of this set can be
anything in the rst dimension (denoted by the wildcard symbol, *), but only elements of the set
r in the second dimension (which contains the digits 1 . . . 37). It is easy to see that the denition
of map simply connects each element of s to the corresponding row in the SAM. Coee (cof) is
connected with row number 1, and so on:
set map(*,r) Mapping onto the SAM rows /
cof.1 Coffee
cro.2 Other crops
lvs.3 Livestock
ffh.4 Forestry fishing and hunting
oil.5 Oil
Parameter Assignments The base-year economic ows are dened by picking elements from sam(r,c).
For example, intermediate inputs are inserted into the parameter id0(s,ss) by picking out the di-
agonal elements:
loop((s,ss,r,c)$(map(s,r)*map(ss,c)),
id0(s,ss) = sam(r,c);
sam(r,c) = 0;
);
Final consumption is assigned to a parameter called c0(s), and is dened by picking up the elements
of column number 29:
c0(s) = sam(c,"29");
To verify that we are getting the correct element from the 1996 spreadsheet, take a look at the
IO table and verify that households consume 12,613 million dollars worth of Foodstus, then check
corresponding values for c0:
---- 675 PARAMETER C0 Household consumption demand
thr 3.443, fod 12.613, nri 6.552, nsi 6.602, htc 6.243
156
ser 20.924, gov 0.917
As expected, the fod listing above shows 12.613 billion, or 12,613 million
9
.
The rest of these parameters are assigned similarly. The loop statement repeats the exercise for
each sector and column, so long as map(s,c) exists. A portion of these assignments is below:
loop((s,c)$map(s,c),
* Extract components of final demand:
c0(s) = sam(c,"29"); sam(c,"29") = 0;
g0(s) = sam(c,"30"); sam(c,"30") = 0;
x0(s) = sam(c,"33"); sam(c,"33") = 0;
* Extract margin supply and demand:
md0("trade",s) = max(0, sam("25",c));
ms0("trade",s) = max(0, -sam("25",c));
... and so on ...
6.5.4 Accounting Identities
Some simple accounting checks often help ensure the national accounts have been correctly inserted.
For example, we check a consumption-production identity. Domestic consumption, a0(s), can be
calculated two ways, via domestic production and imports:
a
0
s
= d
0
s
+m
0
s
pm
0
s
+

m
_
md
0
m,s
ms
0
m,s
_
or via nal demand, investment, and government:
a
0
s
=

ss
id
0
s,ss
+c
0
s
+i
0
s
+g
0
s
The equivalence is checked in mcfmodel.gms using parameter denitions:
a0(s) = d0(s) + m0(s)*pm0(s) + sum(m, md0(m,s)-ms0(m,s));
parameter mktchk(s) Cross check of consistency;
mktchk(s) = a0(s) - sum(ss, id0(s,ss)) - c0(s) - i0(s) - g0(s);
display mktchk;
mktchk is displayed in the listing le:
---- 723 PARAMETER MKTCHK Cross check of consistency
cof 5.80092E-15, cro 7.21645E-16, lvs 8.64846E-15, ffh 2.17465E-14,
oil -7.5530E-15, min 4.87175E-15, thr 5.79536E-14, fod 3.98848E-13,
nri -7.1831E-14, nsi 7.27196E-14, htc 1.84741E-13, con -3.7303E-14,
trn 1.77636E-15, ele -9.3259E-15, com 2.84217E-14, ser 9.85656E-13,
gov 1.70530E-13
The accounts are consistent because mktchk is a very small number
10
.
9
The values from the original IO table were scaled by 1000, making the unit of measurement, billions of US dollars.
10
Typically, we consider numbers less than 1e-6 to be fairly small, and 1e-10 small enough to be a result of computer
tolerances.
157
158
7. Nested CES Functions
This chapter of the guide provides some backgound documentation on the application of nested CES
functions. While MPSGE greatly simplies the use of CES functions, an informed user needs to
understand the properties and application of the functional form in order to construct useful models.
7.1 CES Utility
In many economic textbooks the constant-elasticity-of-substitution (CES) utility function is dened
as:
U(x, y) = (x

+ (1 )y

)
1/
It is a tedious but straight-forward application of Lagrangian calculus to demonstrate that the
associated demand functions are:
x(p
x
, p
y
, M) =
_

p
x
_

p
1
x
+ (1 )

p
1
y
and
y(p
x
, p
y
, M) =
_
1
p
y
_

p
1
x
+ (1 )

p
1
y
.
The corresponding indirect utility function has is:
V (p
x
, p
y
, M) = M
_

p
1
x
+ (1 )

p
1
y
_ 1
1
Note that U(x, y) is linearly homogeneous:
U(x, y) = U(x, y)
This is a convenient cardinalization of utility, because percentage changes in U are equivalent to
percentage Hicksian equivalent variations in income. Because U is linearly homogeneous, V is
homogeneous of degree one in M:
V (p
x
, p
y
, M) = V (p
x
, p
y
, M)
159
and V is homogeneous of degree -1 in p.
V (p
x
, p
y
, M) =
V (p
x
, p
y
, M)

.
Furthermore, linear homogeneity permits us to form an exact price index corresponding to the cost
of a unit of utility:
e(p
x
, p
y
) =
_

p
1
x
+ (1 )

p
1
y
_ 1
1
The indirect utility function can then be written:
V (p
x
, p
y
, M) =
M
e(p
x
, p
y
)
Conceptually, this equation states that the utility which can be realized with income M and prices
p
x
and p
y
is equal to the income level divided by the unit cost of utility. The key idea is that
when the underlying is linearly homogeneous, utility can be represented like any other good in the
economy. Put another way, without loss of generality, we can think of each consumer demanding
only one good.
7.2 CES Technology
In the representation of technology, we have a set of relationships which are directly analogous to the
CES utility function. These relationships are based on the cost and compensated demand functions.
If we have a CES production function of the form:
y(K, L) = (K

+ (1 )L

)
1/
the unit cost function then has the form:
c(p
K
, p
L
) =
1

p
1
K
+ (1 )

p
1
L
_ 1
1
and associated demand functions are:
K(p
K
, p
L
, y) =
_
y

__
c(p
K
, p
L
)
p
K
_

and
L(p
K
, p
L
, y) =
_
y

__
(1 )c(p
K
, p
L
)
p
L
_

.
In most large-scale applied general equilibrium models, we have many function parameters to specify
with relatively few observations. The conventional approach is to calibrate functional parameters
to a single benchmark equilibrium. For example, if we have benchmark estimates for output, labor,
160
capital inputs and factor prices , we calibrate function coecients by inverting the factor demand
functions:
=
p
K

K
p
K

K + p
L

L
, =
1

, =
p
K

K
1/
p
K

K
1/
+ p
L

L
1/
and
= y
_

+ (1 )

1/
7.3 The Calibrated Share Form
Calibration formulae for CES functions are messy and dicult to remember. Consequently, the
specication of function coecients is complicated and error-prone. For applied work using cali-
brated functions, it is much easier to use the calibrated share form of the CES function. In the
calibrated form, the cost and demand functions explicitly incorporate
benchmark factor demands
benchmark factor prices
the elasticity of substitution
benchmark cost
benchmark output
benchmark value shares
In this form, the production function is written:
y = y
_

_
K

K
_

+ (1 )
_
L

L
_

_
1/
The only calibrated parameter, , represents the value share of capital at the benchmark point, i.e.
=
p
K

K
p
K

K + p
L

L
The corresponding cost functions in the calibrated form is written:
c(p
K
, p
L
) = c
_

_
p
K
p
K
_
1
+ (1 )
_
p
L
p
L
_
1
_ 1
1
where
c = p
L

L + p
K

K
161
and the compensated demand functions are:
K(p
K
, p
L
, y) =

K
y
y
_
p
K
c
p
K
c
_

and
L(p
K
, p
L
, y) =

L
y
y
_
c p
L
c p
L
_

Normalizing the benchmark utility index to unity, the utility function in calibrated share form is
written:
U(x, y) =
_

_
x
x
_

+ (1 )
_
y
y
_

_
1/
The unit expenditure function can be written:
e(p
x
, p
y
) =
_

_
p
x
p
x
_
1
+ (1 )
_
p
y
p
y
_
_ 1
1
,
the indirect utility function is:
V (p
x
, p
y
, M) =
M

Me(p
x
, p
y
)
,
and the demand functions are:
x(p
x
, p
y
, M) = x V (p
x
, p
y
, M)
_
e(p
x
, p
y
) p
x
p
x
_

and
y(p
x
, p
y
, M) = y V (p
x
, p
y
, M)
_
e(p
x
, p
y
) p
y
p
y
_

.
The calibrated form extends directly to the n-factor case. An n-factor production function is written:
y = f(x) = y
_

i
_
x
i
x
i
_

_
1/
and has unit cost function:
C(p) =

C
_

i
_
p
i
p
i
_
1
_ 1
1
and compensated factor demands:
x
i
= x
i
y
y
_
C p
i

C p
i
_

162
7.4 Exercises with CES Functions
1. Show that given a generic CES utility function:
U(x, y) = (

+ (1 )y

)
1/
can be represented in share form using:
x = 1, y = 1, p
x
= t, p
y
= t(1 ),

M = t.
for any value of t > 0.
2. Consider the utility function dened:
U(x, y) = (x a)

(y b)
1
A benchmark demand point with both prices equal and demand for y equal to twice the
demand for x. Find values for which are consistent with optimal choice at the benchmark.
Select these parameters so that the income elasticity of demand for x at the benchmark point
equals 1.1.
3. Consider the utility function:
U(x, L) = (L

+ (1 )x

)
1/
which is maximized subject to the budget constraint:
p
x
x = M +w(

L L)
in which M is interpreted as non-wage income, w is the market wage rate. Assume a benchmark
equilibrium in which prices for x and L are equal, demands for x and L are equal, and non-
wage income equals one-half of expenditure on x. Find values of and consistent with these
choices and for which the price elasticity of labor supply equals 0.2.
4. Consider a consumer with CES preferences over two goods. A price change makes the bench-
mark consumption bundle unaordable, yet the consumer is indierent. Graph the choice.
Find an equation which determines the elasticity of substitution as a function of the bench-
mark value shares. (You can write down the equation, but it cannot be solved in closed form.)
5. Consider a model with three commodities, x, y and z. Preferences are CES. Benchmark
demands and prices are equal for all goods. Find demands for x, y and z for a doubling in the
price of x as a function of the elasticity of substitution.
6. Consider the same model in the immediately preceeding question, except assume that prefer-
ences are instead given by:
U(x, y, z) = ( min(x, y)

+ (1 )z

)
1/
Determine from the benchmark, and nd demands for x, y and z if the price of x doubles.
163
7. Consider a two-period model in which consumers maximizes the discounted present value of
utility:
U(c
1
, c
2
) =
c
1
1
1
+
c
1
2
1
subject to the budget constraint:
c
1
+
c
2
1 +r
= 1 +
1
1 +r
in which is the discount factor, is the intertempoal elasticity parameter and r is the given
interest rate.
Use the calibrated share formulation to show (on inspection) that the equivalent variation of
a change in the interest rate from r
0
to r is equal to:
EV = M/

M 1 =
_
2 +r
2 +r
0
__
1 +r
0
1 +r
__
1 +
1/
(1 +r)
1/1
1 +
1/
(1 +r
0
)
1/1
_/(1)
1
8. Mikki once lived in Boulder and spent 30% of her income for rent, 10% for food and 60% for
skiing. She then moved to Georgetown where rent and food prices are identical to Boulder. In
Georgetown, however, Mikki discovered that the quality-adjusted cost of skiing was ten-times
the cost of skiing in Boulder. She adopted a lifestyle in which she spend only 30% of her
income on skiing. Suppose that her preferences are characterized by a CES utility function.
What values of and describe Mikkis utility function?
9. What fraction of Mikkis income does she spend on rent in Georgetown?
10. How much larger would Mikkis income need to be to compensate for the higher cost of skiing
such that she would be indierent between living in Boulder or Georgetown.
7.5 Benchmarking Supply Functions
This section describes how calibrate the xed factor input for constant returns to scale CES technol-
ogy and in order to obtain a specied price elasticity of supply at a reference point. We rst consider
the long-run model with one xed and one variable factor. We then consider the transitional model
in which it may be helpful to calibrate a model to both the short- and long-run supply responses.
7.5.1 A Long-run Model
For concreteness, consider output as a function of labor and capital inputs. Consider the labor
input to be variable and the capital input to be xed. We then have a CES cost function which in
equilibrium denes the price of output:
p = c(r, w)
in which w is the exogenous wage rate and r is the residual return to the sectors xed factor.
Because this factor is xed, by Shepards lemma we have the following relationship between output,
164
the supply of the xed factor and the return to the xed factor:
y
c(r, w)
r
=

R
If we use the calibrated CES cost function of the form:
c(r, w) =
_
r
1
+ (1 )w
1
_ 1
1
then the calibration problem consists of nding a values for and for which:
y
(p/w)
(p/w)
y
=
at the benchmark point.
Note that we are free to choose units of the specic factor such that its benchmark price is unity.
Hence, when we calibrate the share parameter, we are also determining the supply of the xed factor:

R = y
in which we scale the benchmark price of output to unity.
If the relative price of output and the variable factor depart from their benchmark values, the supply
constraint for sector-specic can be inverted to obtain an explicit expression for the return:
r = p
_
y

R
_
1/
where we have substituted the equilibrium price for the cost function. Substituting back into the
cost function, we have
p
1
= p
1
_
y

R
_
1

+ (1 )w
1
or
y =

R
1
1
_
1 (1 )
_
w
p
_
1
_
1
Dierentiating this expression with respect the relative price of output, and setting all prices equal
to unit, we have:
=
(1 )

This equation can be used in a variety of ways to calibrate the supply function. One approach would
be to choose the value share of the xed factor to match the base year prots, and then assign the
elasticity according to:
=

(1 )
165
Alternatively, one choose to use a Cobb-Douglas function and set the specic factor value share
accordingly:
=
1
1 +
7.5.2 Calibrating Both Short- and Long-Run Responses
In a dynamic model it may be helpful to introduce two notions of the elasticity of supply: short-run
and long-run. A simple way to introduce this distinction into a numerical model is to work with a
three factor production function:
y = f(L, K, R)
where L is labor, a production factor which is variable in both the short and long run, K is capital,
a quasi-xed production factor which is variable in the long run but xed in the short run, and R is
a sector-specic resource which is xed in both the short and long run.
We can write the long-run production function as:
y = y
_

L
_
L

L
_

+
K
_
K

K
_

+ (1
L

K
)
_
1/
The R input does not appear in the calibrated production function because we have assumed that
R is equal to the benchmark value. In the short-run model, we have:
y = y
_

L
_
L

L
_

+ (1
L
)
_
1/
If the short-run elasticity of supply is given by
S
, and the labor value share (
L
) is given in the
benchmark data, we can then calibrate the elasticity of substitution to match these inputs:
=
S
1
L

L
Let us assume that while the labor value share is observed (employment statistics are commonly
available for many secttors and regions), but the allocation of the remaining value added is not
known with certainty. We can take advantage of this uncertainty to calibrate the long-run supply
response by choosing the capital value as:

K
=

L
+
L

L
given the value of previously calibrated. It can be shown that when

L
>
S
and we nd that

K
< 1
L
.
166
7.6 Flexibility and Non-Separable CES
We let
i
denote the user price of the ith input, and let x
i
() be the cost-minizing demand for the
ith input. The reference price and quantities are
i
and x
i
. One can think of set i as {K, L, E, M}
but the methods we employ may be applied to any number of inputs. Dene the reference cost, and
reference value share for ith input by

C and
i
, where

i

i
x
i
and

i


i
x
i

C
The single-level constant elasticity of substitution cost function in calibrated form is written:
C() =

C
_

i
_

i

i
_
1
_ 1
1
Compensated demands may be obtained from Shephards lemma:
x
i
() =
C

i
C
i
= x
i
_
C()

C

i

i
_

Cross-price Allen-Uzawa elasticities of substitution (AUES) are dened as:

ij

C
ij
C
C
i
C
j
where
C
ij


2
C()

i

j
=
x
i

j
=
x
j

i
For single-level CES functions:

ij
= i = j
The CES cost function exibits homogeneity of degree one, hence Eulers condition applies to the
second derivatives of the cost function (the Slutsky matrix):

j
C
ij
()
j
= 0
or, equivalently:

ij

j
= 0
The Euler condition provides a simple formula for the diagonal AUES values:

ii
=

j=i

ij

i
167
As an aside, note that convexity of the cost function implies that all minors of order 1 are negative,
i.e.
ii
< 0 i. Hence, there must be at least one positive o-diagonal element in each row of
the AUES or Slutsky matrices. When there are only two factors, then the o-diagonals must be
negative. When there are three factors, then only one pair of negative goods may be complements.
Let:
k index a second-level nest
s
ik
denote the fraction of good i inputs assigned to the kth nest

k
denote the benchmark value share of total cost which enters through the kth nest
denote the top-level elasticity of substitution

k
denote the elasticity of substitution in the kth aggregate
p
k
() denote the price index associated with aggregate k, normalized to equal unity in the benchmark,
i.e.:
p
k
() =
_

i
s
ik

i

i
)
1
k
_ 1
1
k
The two-level nested, nonseparable constant-elasticity-of-substitution (NNCES) cost function is then
dened as:
C() =

C
_

k
p
k
()
1
_ 1
1
Demand indices for second-level aggregates are needed to express demand functions in a compact
form. Let z
k
() denote the demand index for aggregate k, normalized to unity in the benchmark;
i.e.
z
k
() =
_
C()

C
1
p
k
()
_

Compensated demand functions are obtained by dierentiating C(). In this derivative, one term
arise for each nest in which the commodity enters, so:
x
i
() = x
i

k
z
k
()
_
p
k
()
i

i
_

k
= x
i

k
_
C()

C
1
p
k
()
_

_
p
k
()
i

i
_

k
Simple dierentiation shows that benchmark cross-elasticities of substitution have the form:

ij
= +

k
(
k
)s
ik
s
jk

k
Given the benchmark value shares
i
and the benchmark cross-price elasticities of substitution,
ij
,
we can solve for values of s
ik
,
k
,
k
and . A closed-form solution of the calibration problem is
168
not always practical, so it is convenient to compute these parameters using a constrained nonlin-
ear programming algorithm, CONOPT, which is available through GAMS, the same programming
environment in which the equilibrium model is specied. Perroni and Rutherford prove that cali-
bration of the NNCES form is possible for arbitrary dimensions whenever the given Slutsky matrix
is negative semi-denite. The two-level (N N) function is exible for three inputs; and although
we have not proven that it is exible for 4 inputs, the only diculties we have encountered have
resulted from indenite calibration data points.
7.7 Calibrating Three Factor Cost Functions
1 $TITLE Two nonseparable CES calibrations for a 3-input cost function.
2
3 * Model-specific data defined here:
4
5 SET i Production input aggregates / A,B,C /; ALIAS (i,j);
6
7 PARAMETER
8
9 theta(i) Benchmark value shares /A 0.2, B 0.5, C 0.3/
10
11 aues(i,j) Benchmark cross-elasticities (off-diagonals) /
12 A.B 2
13 A.C -0.05
14 B.C 0.5 /;
15
16 * Use an analytic calibration of the three-factor CES cost
17 * function:
18
19 ABORT$(CARD(i) <> 3) "Error: not a three-factor model!";
20
21 * Fill in off-diagonals:
22
23 aues(i,j)$aues(j,i) = aues(j,i);
24
25 * Verify that the cross elasticities are symmetric:
26
27 ABORT$SUM((i,j), ABS(aues(i,j)-aues(j,i))) " AUES values non-symmetric?";
28
29 * Check that all value shares are positive:
30
31 ABORT$(SMIN(i, theta(i)) <= 0) " Zero value shares are not valid:",THETA;
32
33 * Fill in the elasticity matrices:
34
35 aues(i,i) = 0; aues(i,i) = -SUM(j, aues(i,j)*theta(j))/theta(i); DISPLAY aues;
36
37 SET n Potential nesting /N1*N3/
38 k(n) Nesting aggregates used in the model
39 i1(i) Good fully assigned to first nest
40 i2(i) Good fully assigned to second nest
169
41 i3(i) Good split between nests;
42
43 SCALAR assigned /0/;
44
45 PARAMETER
46 esub(*,*) Alternative calibrated elasticities
47 shr(*,i,n) Alternative calibrated shares
48 sigma(n) Second level elasticities
49 s(i,n) Nesting assignments (in model)
50 gamma Top level elasticity (in model);
51
52 * First the Leontief structure:
53
54 esub("LTF","GAMMA") = SMAX((i,j), aues(i,j));
55 esub("LTF",n) = 0;
56 LOOP((i,j)$((aues(i,j) = esub("LTF","GAMMA"))*(NOT assigned)),
57 i1(i) = YES;
58 i2(j) = YES;
59 assigned = 1;
60 );
61
62 i3(i) = YES$((NOT i1(i))*(NOT i2(i)));
63 DISPLAY i1,i2,i3;
64 LOOP((i1,i2,i3),
65 shr("LTF",i1,"N1") = 1;
66 shr("LTF",i2,"N2") = 1;
67 shr("LTF",i3,"N1") = theta(i1)*(1-aues(i1,i3)/aues(i1,i2)) /
68 ( 1 - theta(i3) * (1-aues(i1,i3)/aues(i1,i2)) );
69 shr("LTF",i3,"N2") = theta(i2)*(1-aues(i2,i3)/aues(i1,i2)) /
70 ( 1 - theta(i3) * (1-aues(i2,i3)/aues(i1,i2)) );
71 shr("LTF",i3,"N3") = 1 - shr("LTF",i3,"N1") - shr("LTF",i3,"N2");
72 );
73 ABORT$(SMIN((i,n), shr("LTF",i,n)) < 0) "Benchmark AUES is indefinite.";
74
75 * Now specify the two-level CES function:
76
77 esub("CES","GAMMA") = SMAX((i,j), aues(i,j));
78 ESUB("CES","N1") = 0;
79 LOOP((i1,i2,i3),
80 shr("CES",i1,"N1") = 1;
81 shr("CES",i2,"N2") = 1;
82 esub("CES","N2") = (aues(i1,i2)*aues(i1,i3)-aues(i2,i3)*aues(i1,i1)) /
83 (aues(i1,i3)-aues(i1,i1));
84 shr("CES",i3,"N1") =
85 (aues(i1,i2)-aues(i1,i3)) / (aues(i1,i2)-aues(i1,i1));
86 shr("CES",i3,"N2") = 1 - shr("CES",i3,"N1");
87 );
88 ABORT$(SMIN(n, esub("CES",n)) < 0) "Benchmark AUES is indefinite?";
89 ABORT$(SMIN((i,n), shr("CES",i,n)) < 0) "Benchmark AUES is indefinite?";
90
91 PARAMETER price(i) Price indices used to verify calibration,
92 aueschk(*,i,j) Check of benchmark AUES values;
93
170
94 price(i) = 1;
95
96 $ontext
97
98 $MODEL:CHKCALIB
99
100 $SECTORS:
101 Y ! PRODUCTION FUNCTION
102 D(i)
103
104 $COMMODITIES:
105 PY ! PRODUCTION FUNCTION OUTPUT
106 P(i) ! FACTORS OF PRODUCTION
107 PFX ! AGGREGATE PRICE LEVEL
108
109 $CONSUMERS:
110 RA
111
112 $PROD:Y s:gamma k.tl:sigma(k)
113 O:PY Q:1
114 I:P(i)#(k) Q:(theta(i)*s(i,k)) k.TL:
115
116 $PROD:D(i)
117 O:P(i) Q:theta(i)
118 I:PFX Q:(theta(i)*price(i))
119
120 $DEMAND:RA
121 D:PFX
122 E:PFX Q:2
123 E:PY Q:-1
124 $OFFTEXT
125 $SYSINCLUDE mpsgeset CHKCALIB
126
127 SCALAR delta /1.E-5/;
128 SET function /ltf, ces/;
129 alias (i,ii);
130
131 LOOP(function,
132 k(n) = YES$SUM(i, shr(function,i,n));
133 gamma = esub(function,"GAMMA");
134 sigma(k) = esub(function,k);
135 s(i,k) = shr(function,i,k);
136 loop(ii,
137 price(j) = 1; price(ii) = 1 + delta;
138 $INCLUDE CHKCALIB.GEN
139 SOLVE CHKCALIB USING MCP;
140 aueschk(function,j,ii) = (D.L(j)-1) / (delta*theta(ii));
141 ));
142 aueschk(function,i,j) = aueschk(function,i,j) - aues(i,j);
143 DISPLAY aueschk;
144
145 * Evaluate the demand functions:
146
171
147 $LIBINCLUDE plot
148
149 SET pr Alternative price levels /pr0*pr10/;
150
151 PARAMETER
152 demand(function,i,pr) Demand functions
153 dplot(pr,function) Demand function comparison
154
155 loop(ii,
156 LOOP(function,
157 k(n) = YES$SUM(i, shr(function,i,n));
158 gamma = esub(function,"GAMMA");
159 sigma(k) = esub(function,k);
160 s(i,k) = shr(function,i,k);
161 LOOP(pr,
162 price(j) = 1;
163 price(ii) = 0.2 * ORD(pr);
164 $INCLUDE CHKCALIB.GEN
165 SOLVE CHKCALIB USING MCP;
166 demand(function,ii,pr) = D.L(ii);
167 dplot(pr,function) = D.L(ii);
168 );
169 );
170
171 * Display the comparisons:
172
173 $LIBINCLUDE PLOT dplot
174 );
175
176 DISPLAY demand;
7.8 Calibrating Four Factor Cost Functions
1 $TITLE Numerical calibration of Nested CES from KLEM elasticities
2
3 SET i Production input aggregates / K, L, E, M/; ALIAS (i,j);
4
5 * Model-specific data defined here:
6
7 PARAMETER
8 theta(i) Benchmark value shares /K 0.2, L 0.4, E 0.05, M 0.35/
9
10 aues(i,j) Benchmark cross-elasticities (off-diagonals) /
11 K.L 1
12 K.E -0.1
13 K.M 0
14 L.E 0.3
15 L.M 0
16 E.M 0.1 /;
17
18 SCALAR epsilon Minimum value share tolerance /0.001/;
19
172
20 * Fill in off-diagonals:
21
22 aues(i,j)$aues(j,i) = aues(j,i);
23
24 * Verify that the cross elasticities are symmetric:
25
26 ABORT$SUM((i,j), ABS(aues(i,j)-aues(j,i))) " AUES values non-symmetric?";
27
28 * Check that all value shares are positive:
29
30 ABORT$(SMIN(i, theta(i)) le 0) " Zero value shares are not valid:",theta;
31
32 * Fill in the elasticity matrices:
33
34 aues(i,i) = 0; aues(i,i) = -SUM(j, aues(i,j)*theta(j))/theta(i); DISPLAY aues;
35
36 * Define variables and equations for NNCES calibration:
37
38 SET n Nests within the two-level NNCES function /N1*N4/,
39 k(n) Nests which are in use;
40
41 VARIABLES
42 S(i,n) Fraction of good I which enters through nest N,
43 SHARE(n) Value share of nest N,
44 SIGMA(n) Elasticity of substitution within nest N,
45 GAMMA Elasticity of substitution at the top level,
46 OBJ Objective function;
47
48 POSITIVE VARIABLES S, SHARE, SIGMA, GAMMA;
49
50 EQUATIONS
51 SDEF(i) Nest shares must sum to one,
52 TDEF(n) Nest share in total cost,
53 ELAST(i,j) Consistency with given AUES values,
54 OBJDEF Maximize concentration;
55
56 ELAST(i,j)$(ORD(i) > ORD(j))..
57
58 aues(i,j) =E= GAMMA +
59
60 SUM(k, (SIGMA(k)-GAMMA)*S(i,k)*S(j,k)/SHARE(k));
61
62 TDEF(k).. SHARE(k) =E= SUM(i, theta(i) * S(i,k));
63
64 SDEF(i).. SUM(n, S(i,n)) =E= 1;
65
66 * Maximize concentration at the same time keeping the elasticities
67 * to be reasonable:
68
69 OBJDEF.. OBJ =E= SUM((i,k),S(i,k)*S(i,k))
70
71 - SQR(GAMMA) - SUM(k, SQR(sigma(k)));
72
173
73 MODEL CESCALIB /ELAST, TDEF, SDEF, OBJDEF/;
74
75 * Apply some bounds to avoid divide by zero:
76
77 SHARE.LO(n) = epsilon;
78
79 SCALAR solved Flag for having solved the calibration problem /0/
80 minshr Minimum share in candidate calibration;
81
82 SET tries Counter on the number of attempted calibrations /T1*T10/;
83
84 OPTION SEED=0;
85
86 LOOP(tries$(NOT solved),
87
88 * Initialize the set of active nests and the bounds:
89
90 k(n) = YES;
91 S.LO(i,n) = 0; S.UP(i,n) = 1;
92 SHARE.LO(n) = epsilon; SHARE.UP(n) = 1;
93 SIGMA.LO(n) = 0; SIGMA.UP(n) = +INF;
94
95 * Install a starting point:
96
97 SHARE.L(k) = MAX(UNIFORM(0,1), epsilon);
98 S.L(i,k) = UNIFORM(0,1);
99 GAMMA.L = UNIFORM(0,1);
100 SIGMA.L(k) = UNIFORM(0,1);
101 SDEF.M(i) = 0; TDEF.M(k) = 0; ELAST.M(i,j) = 0;
102
103 SOLVE CESCALIB USING NLP MAXIMIZING OBJ;
104
105 solved = 1$(CESCALIB.MODELSTAT LE 2);
106 IF (solved,
107 minshr = SMIN(k, SHARE.L(k)) - epsilon;
108 IF (minshr EQ 0,
109 k(n)$(SHARE.L(n) = epsilon) = NO;
110 S.FX(i,n)$(not k(n)) = 0;
111 SHARE.FX(n)$(not k(n)) = 0;
112 SIGMA.FX(n)$(not k(n)) = 0;
113 DISPLAY "Recalibrating with the following nests:",k;
114 SOLVE CESCALIB USING NLP MAXIMIZING OBJ;
115 IF (cescalib.modelstat gt 2, solved = 0;);
116 minshr = SMIN(k, SHARE.L(k)) - epsilon;
117 IF (minshr=0, solved = 0;);
118 );
119 );
120 );
121 IF (solved, DISPLAY "Function calibrated:",GAMMA.L,SIGMA.L,SHARE.L,S.L;
122 ELSE DISPLAY "Function calibration fails!";
123 );
124
174
C
0
C
1
C
2
C
k
C
L
p
j
p
i
,
,
,
,
,
,
,
, ,
,
,
,
, ,

@
@
@
@
@
@

@
@
@

@
@
@

Figure 7.1: A Multi-level Nested CES Cost Function


7.9 Price Elasticities in Nested CES Functions
Suppose that we have a nested cost function of arbitrary depth and complexity. The prices for goods
i and j, p
i
and p
j
are arguments of C(p). Assume that the cost function C(p) is nested. In the
simplest two level case, we would have:
C(p) =
_

k
c
k
(p)
1
0
_
1/1
0
in which:
c
k
(p) =
_

iI
k

ik
p
1
k
i
_
1/1
k
where I
k
indicates the set of commodities entering nest k.
In a more general case, we could have cost aggregates as arguments to other cost aggregates. The
gure shown below displays a graph of the nested CES cost function in which we number the nested
cost functions which lead from the top level to nest containing good i as C
0
(top level), C
1
, . . . , C
L
.
If we construct the cost function from a calibrated benchmark in which input prices and total cost
175
are unity , we can scale the benchmark values of the subaggregate cost functions as unity and express
the demand for good i as:
x
i
= x
i
_
C
L
p
i
_

L
_
C
L1
C
L
_

L1
. . .
_
C
0
C
1
_

0
= x
i
p

L
i
C

0
0
L

n=1
C

n1
n
7.9.1 The Own-Price Elasticity of Demand
By Shephards lemma the derivative of C
n
with respect to p
i
equals the demand for good i per unit
of aggregate n. Recalling that all prices are scaled to unity, the benchmark quantity of aggregate
n equals the sum of the inputs which enter directly or indirectly into that cost function:

X
n
=

jI
n
x
j
and
C
n
p
i

p=1
=
_
0 i / I
n
x
i

X
n
i I
n
We then can compute the compensated own-price elasticity of demand for good i:

i

x
i
p
i

p=1
=
L
+ x
i
_

0
+
L

n=1

n1

X
n
_
7.9.2 The Cross-Price Elasticity of Demand
When we evaluate the elasticity of demand for i with respect to a change in the price of good j, we
can let k denote the deepest price aggregate which contains both p
i
and p
j
. (See Figure 7.1).
The cross derivative can then be computed using the demand function for x
i
, taking into account
the impact of p
j
on C
k
, C
k1
, . . . , C
0
:
x
i
p
j

p=1
= x
i
_

0
C
0
p
j
+
k

n=1
(
n

n1
)
C
n
p
j
_
One means of representing the dependence of x
i
on p
j
is with the Allen-Uzawa elasticity-of-substitution
which:

ij

x
i
p
j
C
0
x
i
x
j
=
0
+
k

n=1

n1
X
n
As a logical check on this elasticity, consider two special cases:
1.
n
=
0
n
This then leads to single level CES, impling a constant cross elasticity of substitution between
all input pairs.
176
2.
n
= 0 n < k
We then have Leontief demand for aggregate k, implying that the elasticity of substitution
between i and j is given by

ij
=
k
N.B. The cross elasticity between i and j is independent of the subnest elasticity for all nests
n > k.
177

Das könnte Ihnen auch gefallen