MPSGE: A User's Guide

advertisement
MPSGE: A User’s 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
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 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
2.9.2
Variable, Equation and Model Definitions . . . . . . . . . . . . . . . . . . . .
10
2.9.3
Equilibrium Computation and Reporting . . . . . . . . . . . . . . . . . . . .
10
3 Getting Started with GAMS/MPSGE
i
1
13
CONTENTS
3.1
3.2
3.3
3.4
What is a General-Equilibrium Model? . . . . . . . . . . . . . . . . . . . . . . . . . .
13
3.1.1
The conceptual framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
3.1.2
Steps in Applied General-Equilibrium Modeling . . . . . . . . . . . . . . . . .
15
Example M1: 2-good, 2-factor closed economy with fixed 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
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
Specific 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 tariff (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 flows (M410) . . . . . . . . . . . . . . . . . . . . . . . .
82
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 Tariffs 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
4.5
Domain Restriction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
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
iii
Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.7
Report Variables
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.9
Switches and Debug Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
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.6
5.7
5.5.1
Comments Regarding the Model . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.5.2
MPSGE Formulation: Key Ideas . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.5.3
Computing Counter-factual Scenarios . . . . . . . . . . . . . . . . . . . . . . 123
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
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.3
6.2.1
SAM Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.2.2
Colombian 1996 SAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.2.3
Data Management and Model-Building
6.2.4
Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.2.5
Checking Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6.2.6
Forensic Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
. . . . . . . . . . . . . . . . . . . . . 137
A Static General Equilibrium Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
iv
CONTENTS
6.4
6.5
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
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
Data Processing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6.5.1
The Excel input file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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
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
v
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
The Own-Price Elasticity of Demand . . . . . . . . . . . . . . . . . . . . . . . 176
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 simplifies the modelling process and makes AGE modelling
accessible to any economist who is interested in the application of these models. In addition to
solving specific 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 embedded in a GAMS program. To use MPSGE a user must learn the syntax and conventions of this
model definition 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 efficiently solved as complementarity problems.
Mathiesen’s formulation may be posed in terms of three sets of “central variables”:
p
a non-negative n-vector of commodity prices including
all final 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 satisfies a nonlinear system of equations (and inequalities) 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 endowments plus aggregate producer supply must be greater than or equal to aggregate demand by
1
producers and consumers.
Producer activity level ⇔ Zero profit 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 definition We employ uncompensated demand functions in
MPSGE which implies that equilibrium expenditure cannot exceed equilibrium income for any
consumer. Equations which define 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 weren’t 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 advalorem 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 equilibrium condition defined 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 explaination of the underlying model structure. On the other hand, the algebraic formulation presents
a number of difficulties, 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 programming errors. This simplification 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. Specification of model variables and equations.
4. Calibration of coefficients of preferences and technology.
5. Replication of the benchmark equilibrium to verify that the model equations and the derived
coefficients are internally consistent.
6. Definition of scenarios and solution of the scenarios.
7. Report generation (tables and figures)
8. Interpretation and writing.
MPSGE offers 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 specification of the equations which define a general
equilibria. The novice modeller benefits from using MPSGE because it provides a clear framework
for the underlying model. The expert modeller benefits 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 calculusbased microeconomics course. A minimal level of preparation would be Hal Varian’s undergraduate
microeconomics textbook ( Intermediate Microeconomics: A Modern Approach, Norton & Company).
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 effort. 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 first 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 different design philosophies. MPSGE was
(and is) appropriate for a specific class of nonlinear equations, while GAMS is capable of representing 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 framework for novice modellers. When used by experts, MPSGE reduces the setup cost of producing an
operational model and the cost of testing alternative specifications.
In contrast, the GAMS modelling language is designed for managing large datasets. The use of
sets and detached-coefficient 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 specification of the model structure. Economic equilibrium
models, particularly those based on complicated functions such as nested constant-elasticity-ofsubstitution (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 errorprone 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
specification 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 files. When you copy the GAMS systems files
without the license file, 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 file from the GAMS
website. Once you have obtained setup.exe, execute this file to install:
• The GAMS system and all the associated solver subsystems.
• On-line documentation
• A model library
If you don’t have a license file 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 files 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 define a new project in the directory where
your model files will be located.
• Pay attention to where you locate the project file for a new model. When GAMS is used from
the command line, the “current directory” determines the location of the listing file, include
files, option files, put files etc. When executing a Windows program, there is no current
directory. The “current directory” when running the GAMS/IDE is defined by the location of
the associated project file.
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 files 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!). Subdirectory projectID\doc keeps various pieces of documentation assembled during the model
development. This may include PDF files from various places, ancillary data files, and a number of “notes to myself” written at different 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 define 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 programmer’s
text editor.
2.3
Programming Editors
Programmers’ text editors can provide efficiency advantages as a means of developing GAMS programs. 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 you’ve identified 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
offers an excellent “GAMS mode” with keyword highlighting, 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 nonextensible.
Other Editors
Description
MetaPAD
This editor is small yet fully functional, and it is free
OxEdit+GAMS
This is Philip Viton’s 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, it’s a powerful,
extensible tool.
TextPad
This is not freeware but it’s not expensive, and there is
a set of syntax files 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 satisfied with the model:
(i) Debug the code, trying to stick to your current design and avoiding elaboration of the
model formulation or dataset.
(ii) Define the scenarios you will run with the model, and devise a set of tables and figures
which you will generate using model results. Put your best-guess numbers in each table,
and sketch each figure. 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 figures using the scenario solution values.
(v) Look at the results, compare the actual results with your conjectured results. Pay attention 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 formulation.
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), you’ll 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 fields that GAMS
provides, and think about what you write.
• GAMS models offer sufficient flexibility to permit the development of several different user
interfaces, however we recommend that you first focus first 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 User’s 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 files:
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 definitions and Solve statements
Display and other reporting statements
• Outputs
–
–
–
–
–
2.7
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 files
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 first 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 identified by “***” in the listing file. Compilation errors often cascade
– one error causes others. We have found that it is often best to correct the first compilation
error and leave subsequent errors to be addressed after the first 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 file.
2.9
2.9.1
A Simple GAMS Program
Set and Data Definitions
This GAMS program illustrates a simple spatial price equilibrium model formulated as a complementarity 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 define sets, data and the logical structure of models and (ii)
procedural statements, those which instruct the computer to undertake a specific set of tasks in a
particular sequence. The declarative part of GAMS program consists of statements which define
sets and data. All statements in this first part of this program are declarative. As most GAMS
programs, this program begins by declaring sets, parameters and associated data.
1
Sets
2
9
i
j
canning plants
markets
/ seattle, san-diego /
/ new-york, chicago, topeka / ;
3
4
5
Parameters
a(i)
Reference supplies /seattle 350, san-diego 600/,
6
b(j)
7
Reference demand /new-york 325, chicago 300, topeka 275/,
8
esub(j)
9
10
Demand elasticities
/ new-york 1.5, chicago 1.2, topeka 2.0 /;
11
12
Table d(i,j)
13
14
15
seattle
san-diego
distance in thousands of miles
new-york
chicago
topeka
2.5
1.7
1.8
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 Definitions
The second section of the program is also strictly declarative. It defines 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
26
27
28
Positive variables
w(i)
p(j)
x(i,j)
shadow price at supply node i,
shadow price at demand node j,
shipment quantities in cases;
Equations
supply(i)
fxdemand(j)
prdemand(j)
profit(i,j)
supply limit at plant i,
fixed demand at market j,
price-responsive demand at market j,
zero profit conditions;
29
30
31
32
33
34
35
36
profit(i,j)..
w(i) + c(i,j)
=g= p(j);
supply(i)..
a(i) =g= sum(j, x(i,j));
fxdemand(j)..
sum(i, x(i,j))
=g=
b(j);
prdemand(j)..
sum(i, x(i,j))
=g=
b(j) * (pbar(j)/p(j))**esub(j);
37
38
39
40
41
42
43
44
45
46
*
*
*
Declare two models based on these equations, one in which
we assume fixed demand and another with price-responsive
demand:
47
48
49
Model fixedqty / profit.x, supply.w, fxdemand.p/ ;
Model equilqty / profit.x, supply.w, prdemand.p/ ;
2.9.3
Equilibrium Computation and Reporting
The final portion of this simple GAMS program consists of a series of procedural statements which
are executed sequentially. The first statement assigns the numeric value to parameter c(i,j) based
10
on parameters which have been previously defined.
The inital values of the variables are assigned before the first model solution. Thereafter the equilibrium 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
57
p.l(j) = 1;
w.l(i) = 1;
58
59
*
Solve the fixed demand model:
60
61
Solve fixedqty using mcp;
62
63
64
65
report("fixed",i,j) = x.l(i,j);
report("fixed","price",j) = p.l(j);
report("fixed",i,"price") = w.l(i);
66
67
68
*
*
Calibrate the demand functions to the
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
77
78
report("equil",i,j) = x.l(i,j);
report("equil","price",j) = p.l(j);
report("equil",i,"price") = w.l(i);
79
80
81
82
*
*
*
Compute a counter-factual equilibrium in
which the cost of shipments from Seattle
to Chicago are reduced by 50\%:
83
84
c("seattle","chicago") = 0.5 * c("seattle","chicago");
85
86
87
88
89
Solve fixedqty using mcp;
report("fixed",i,j) = x.l(i,j);
report("fixed","price",j) = p.l(j);
report("fixed",i,"price") = w.l(i);
90
91
92
*
*
Compute the same scenario in the fixed demand
model:
93
94
95
96
97
Solve equilqty using mcp;
report("equil",i,j) = x.l(i,j);
report("equil","price",j) = p.l(j);
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 specific 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
Rosenthal’s 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 User’s 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 find 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 first.
3.1
What is a General-Equilibrium Model?
There are many models which are portrayed by their authors’ as “general equilibrium”. The term
assumes different meanings in different fields, so it is probably a good idea to begin with a definition
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 profit, 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 firms, 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 finding 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, technologies 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 tariffs influence 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 effects of policies such as tariffs 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 difficulties, 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 field 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 theorist’s point of view. We have to assume specific
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. General equilibrium is then represented as the solution to a well-defined mathematical problem. More
specifically, there are two general ways of formulating this mathematical problem. The first is to
model the economy as an optimization or programming problem. This tends to be the first 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 firm. 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 firms 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 firms will react to prices, taxes, and other variables.
Once we have done this, finding general-equilibrium is reduced to finding 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, finding 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 profits 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) profits 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
Numbers
Numbers
Numbers
of
of
of
of
goods and factors
consumers
countries
active markets
2. Chose functional forms for production, transformation, and utility functions; specification of
side constraints.
• Includes choice of outputs and inputs for each activity
15
• Includes specification of initially slack activities
3. Construct micro-consistent data set.
• Data satisfies zero profits for all activities, or if profits are positive, assignment of revenues
• Data satisfies 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.
Let’s now turn to a concrete example of a simple general-equilibrium model.
3.2
Example M1: 2-good, 2-factor closed economy with fixed factor endowments 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 (fixed) supply, but can move freely between
sectors. px , py , pL , and pK are the prices of X, Y , L and K, respectively. I is consumer’s income
and pw will be used later to denote the price of one unit of W . These are the equations of the model.
X = X(Lx , Kx )
Y = Y (Ly , Ky )
L∗ = Lx + Ly
K ∗ = Kx + Ky
W = W (X, Y )
I = pl L∗ + pk K ∗ = px X + py Y
factor allocations to the two sectors? Many economists’ first reaction would be to formulate equilibrium 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 different consumer types with different
preferences and different factor endowments. What do we maximize? You could maximize the
utility of one consumer subject to an arbitrary fixed level of the utility of the other consumer,
exploiting the first 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 consumer’s
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 system. 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 efficient 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 = Cx (pL , pK ),
cy = Cy (pL , pK )
Unit cost (expenditure) function for W :
e = e(px , py )
3.2.2
Demand Functions
The next crucial step is provided by demand theory, Shepard’s 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 producer’s optimal demand for labor per unit of output (similarly for Y )
∂cx
= cxpL
∂pL
2. X producer’s demand for capital per unit of output (similarly for Y ):
∂cx
= cxpK
∂pK
3. Consumer’s demand for X per unit of utility (similarly for Y ):
∂e
= epx
∂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 profits for X
cx(pL , pK ) ≥ px
(2) Non-positive profits for Y
cy(pL , pK ) ≥ py
(3) Non-positive “profits” for W
e(px , py ) ≥ pw
(4) Supply - Demand for X
X ≥ epx (px , py )W
(5) Supply - Demand for Y
Y ≥ epy (px , py )W
(6) Supply - Demand for W
W ≥ I/pw
(7) Supply - Demand for L
L∗ ≥ cxpL X + cypL Y
(8) Supply - Demand for K
K ∗ ≥ cxpK X + cypK Y
(9) Income balance
I = pL L∗ + pK 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-profit 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 profit conditions holds as a strict inequality in equilibrium, profits 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-profit 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 profits for X
X≥0
(2) Non-positive profits for Y
Y ≥0
(3) Non-positive “profits” for W
W ≥0
(4) Supply - Demand for X
px ≥ 0
(5) Supply - Demand for Y
py ≥ 0
(6) Supply - Demand for W
pw ≥ 0
(7) Supply - Demand for L
pL ≥ 0
(8) Supply - Demand for K
pK ≥ 0
(9) Income balance
I
Now let’s 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, let’s start with a set of numbers
that satisfy zero profits, 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 different 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 signifies a receipt (sale)
in a particular market. A negative entry signifies 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 flows into the economy (sales or factor supplies),
while negative numbers represent the value of commodity flows out of the economy (factor demands
or final demands).
With this interpretation, a row sum is zero if the total amount of commodity flowing into the economy
equals the total amount of commodity flowing 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 final demands. Zero column sums thus indicate zero
profits 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 first, let’s 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 final 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) file.
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 first 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 semicolon. 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 specification, 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 “fixed”.
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 first solve statement, we do two counterfactual experiments. The
first 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
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
------------------------------------------------------
8
9
10
11
12
13
14
15
16
17
18
$OFFTEXT
19
20
21
22
PARAMETERS
TX
LENDOW
Ad-valorem tax rate for X sector inputs /0/;
Labor endowment multiplier /1/;
23
24
25
26
27
28
29
30
31
32
33
POSITIVE VARIABLES
X
Activity level for sector
Y
Activity level for sector
W
Activity level for sector
PX
Relative price of X
PY
Relative price of Y
PW
Relative price of W (unit
PL
Wage rate
PK
Rental rate
CONS
Consumer income level;
X
Y
W
expenditure function)
34
35
36
37
38
EQUATIONS
PRF_X
Zero profit for sector X
PRF_Y
Zero profit for sector Y
PRF_W
Zero profit for sector W (Hicksian welfare index)
39
40
41
MKT_X
MKT_Y
21
Supply-demand balance for commodity X
Supply-demand balance for commodity Y
42
43
44
MKT_L
MKT_K
MKT_W
Supply-demand balance for primary factor L
Supply-demand balance for primary factor L
Supply-demand balance for aggregate demand
I_CONS
Income definition for CONS;
45
46
47
48
49
*
Zero profit inequalities
50
51
PRF_X..
100 * PL**0.25 * PK**0.75 * (1+TX) =G= 100*PX;
PRF_Y..
100 * PL**0.75* PK**0.25 =G= 100*PY;
PRF_W..
200 * PX**0.5 * PY**0.5 =G= 200*PW;
52
53
54
55
56
57
*
Market clearance inequalities
58
59
MKT_X..
100 * X =G= 100 * W * PX**0.5 * PY**0.5 / PX;
MKT_Y..
100 * Y =G= 100 * W * PX**0.5 * PY**0.5 / PY;
MKT_W..
200 * W =E= CONS / PW;
MKT_L..
100 * LENDOW =G= 25 * X * PL**0.25 * PK**0.75 / PL +
75 * Y * PL**0.75 * PK**0.25 / PL;
MKT_K..
100 =G= 75 * X * PL**0.25 * PK**0.75 / PK +
25 * Y * PL**0.75 * PK**0.25 / PK;
60
61
62
63
64
65
66
67
68
69
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
76
MODEL ALGEBRAIC /PRF_X.X, PRF_Y.Y, PRF_W.W, MKT_X.PX, MKT_Y.PY, MKT_L.PL
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
86
X.L=1; Y.L=1; W.L=1; PX.L=1; PY.L=1; PK.L=1; PL.L=1;
CONS.L=200;
87
88
SOLVE ALGEBRAIC USING MCP;
89
90
91
*
Solve the counterfactuals:
92
93
94
95
TX = 0.5;
LENDOW = 1;
SOLVE ALGEBRAIC USING MCP;
96
97
98
99
TX = 0;
LENDOW = 2;
SOLVE ALGEBRAIC USING MCP;
100
This file is saved in the relevant directorty as m1 mcp.gms, although you can use any name you want,
it doesn’t have to correspond to the model name.
22
At the DOS prompt type gams m1 mcp. This runs the model.
The output or listing file will automatically be written to the same directory, with name m1 mcp.lst.
In the listing file, 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.
----------------------------
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
PRF_X
PRF_Y
PRF_W
MKT_X
MKT_Y
MKT_L
MKT_K
MKT_W
I_CONS
PRF_X
PRF_Y
PRF_W
MKT_X
MKT_Y
MKT_L
MKT_K
MKT_W
I_CONS
LOWER
LEVEL
UPPER
MARGINAL
.
.
.
.
.
-100.000
-100.000
.
.
.
.
.
.
.
-100.000
-100.000
.
.
+INF
+INF
+INF
+INF
+INF
+INF
+INF
.
.
1.000
1.000
1.000
1.000
1.000
1.000
1.000
1.000
200.000
Zero profit for sector X
Zero profit for sector Y
Zero profit for sector W (Hicksian welfare index)
Supply-demand balance for commodity X
Supply-demand balance for commodity Y
Supply-demand balance for primary factor L
Supply-demand balance for primary factor L
Supply-demand balance for aggregate demand
Income definition for CONS
LOWER
----------------------------
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
X
Y
W
PX
PY
PW
PL
PK
CONS
.
.
.
.
.
1.000
.
.
.
LEVEL
1.000
1.000
1.000
1.000
1.000
1.000
1.000
1.000
200.000
UPPER
+INF
+INF
+INF
+INF
+INF
1.000
+INF
+INF
+INF
MARGINAL
.
.
.
.
.
EPS
.
.
.
Now let’s look at the results for our first counterfactual, in which we place a 50% tax on the inputs
to X production.
************** counterfactual: tax on X inputs
LOWER
-------------------------
23
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
X
Y
W
PX
PY
PW
PL
PK
.
.
.
.
.
1.000
.
.
LEVEL
0.845
1.147
0.985
1.165
0.859
1.000
0.903
0.739
UPPER
+INF
+INF
+INF
+INF
+INF
1.000
+INF
+INF
MARGINAL
.
.
.
.
.
-16.412
.
.
---- VAR CONS
.
213.359
+INF
.
We see that X production decreases, Y production increases, and welfare falls due to the distortionary 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
----------------------------
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
X
Y
W
PX
PY
PW
PL
PK
CONS
.
.
.
.
.
1.000
.
.
.
LEVEL
1.189
1.682
1.414
1.189
0.841
1.000
0.707
1.414
282.843
UPPER
MARGINAL
+INF
.
+INF
.
+INF
.
+INF
.
+INF
.
1.000 6.617E-11
+INF
.
+INF
.
+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 fixed 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 efficient 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 specific 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 doesn’t 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 agent’s 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 superficial 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 subsidies. In imperfectly competitive models, firm 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 won’t 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 file, 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
7
8
$ONTEXT [this tells the GAMS compiler to ignore what follows, but the MPSGE
compiler will recognize the model statement that follows and will
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
28
$INCLUDE MODELNAME.GEN
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
file 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
9
10
11
12
13
14
15
16
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
------------------------------------------------------
17
18
$OFFTEXT
19
20
21
22
23
PARAMETERS
TX
LENDOW
Ad-valorem tax rate for X sector inputs
Labor endowment multiplier;
24
25
26
TX = 0;
LENDOW = 1;
27
28
$ONTEXT
29
30
$MODEL:M1_MPS
31
32
33
34
35
$SECTORS:
X
Y
W
! Activity level for sector X
! Activity level for sector Y
! Activity level for sector W (Hicksian welfare index)
$COMMODITIES:
PX
PY
PL
PK
PW
!
!
!
!
!
$CONSUMERS:
CONS
! Income level for consumer CONS
36
37
38
39
40
41
42
Price
Price
Price
Price
Price
index
index
index
index
index
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
welfare (expenditure function)
43
44
45
46
47
48
49
50
$PROD:X s:1
O:PX
I:PL
I:PK
Q:100
Q:25 A:CONS T:TX
Q:75 A:CONS T:TX
51
26
52
53
54
55
$PROD:Y s:1
O:PY
I:PL
I:PK
Q:100
Q:75
Q:25
56
57
58
59
60
$PROD:W s:1
O:PW
I:PX
I:PY
Q:200
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:(100*LENDOW)
Q:100
61
62
63
64
65
66
67
$OFFTEXT
68
69
$SYSINCLUDE mpsgeset M1_MPS
70
71
PW.FX = 1;
72
73
74
$INCLUDE M1_MPS.GEN
SOLVE M1_MPS USING MCP;
75
76
77
*
Solve the counterfactuals
78
79
80
TX = 0.5;
LENDOW = 1;
81
82
83
$INCLUDE M1_MPS.GEN
SOLVE M1_MPS USING MCP;
84
85
86
TX = 0;
LENDOW = 2;
87
88
89
$INCLUDE M1_MPS.GEN
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. Let’s take an example from the above program,
adding the price field (discussed shortly).
$PROD:Y
s:1
O:PY
I:PL
I:PK
Q:100
Q: 75
Q: 25
P:1
P:1
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
specified.
Third column: Reference commodity prices (P:) - used for calibration. Default = 1 if none specified,
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 defined 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,
different 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
I:PL
I:PK
Q:100
Q:25
Q:75
A:CONS T:TX
A:CONS T:TX
The A: field“assigns” 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 consumer’s 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” field), and receives income
from endowments (the “E” fields) of labor and capital.
MPSGE automatically handles tax revenue or subsidy payments in the background, adding or subtracting them to the consumer’s endowment income.
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:(100*LENDOW)
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 fields 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
I:PK
Q: 75
P:1
P:1
$PROD: X
s:1
O:PX
Q:100
I:PL
Q: 25
I:PK
Q: 75
P:2
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 different slope through that input combination in the two cases: the marginal rate
of substitution in the first 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
I:PL
Q: 25
I:PK
Q: 75
P:1
P:1
P:1
$PROD: X
s:1
O:PX
Q:100
I:PL
Q: 50
I:PK
Q: 75
P:1
P:0.5
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 first being a clearly more efficient technology
than the second. While both will have the same share parameters on L and K (0.25 and 0.75
respectively), the first technology will have a higher multiplicative “efficiency” 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 specified outside somewhere else in the program or indeed read from
external files.
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 specified 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 first 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 different 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 file, 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 definitions (for example the use of ” ” when referring
to a specific 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)
I:PF(F)
Q:Z0(I)
Q:FD0(F,I)
A:CONS
T:T(I)
Two production (cost) functions for two goods using two factors with different factor intensities and
different tax rates across sectors are specified 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
L
K
8
9
10
11
12
X
100
Y
100
-40
-60
W
-100
-100
200
CONS
-200
100
100;
-60
-40
13
14
15
SET
16
I
F
Produced goods
Factors of production
/X, Y/,
/L, K/;
17
18
19
ALIAS (I,J), (F,FF);
20
21
PARAMETER
22
Z0(I)
FD0(F,I)
C0(I)
E(F)
T(I)
W0
23
24
25
26
27
28
Benchmark sectoral output,
Benchmark factor demands,
Benchmark consumption demand,
Factor endowments,
Sectoral ad-valorem tax rate,
Benchmark total consumption;
29
30
*
Extract data from the original format into model-specific arrays:
31
32
33
34
35
36
37
Z0(I)
FD0(F,I)
C0(I)
W0
E(F)
T(I)
=
=
=
=
=
=
BENCH(I,I);
-BENCH(F,I);
-BENCH(I,"W");
SUM(I, C0(I));
BENCH(F,"CONS");
0;
38
39
DISPLAY Z0, FD0, C0, E, T;
40
41
42
$ONTEXT
43
44
$MODEL:M1_VEC
45
46
47
48
$SECTORS:
Z(I)
W
! Commodity production index
! Welfare index
$COMMODITIES:
PW
PC(I)
PF(F)
! Utility price index
! Commodity price index
! Factor price index
$CONSUMERS:
CONS
! Representative consumer
$PROD:Z(I) s:1
O:PC(I)
I:PF(F)
Q:Z0(I)
Q:FD0(F,I)
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$PROD:W
63
64
65
31
s:1
O:PW
I:PC(I)
Q:W0
Q:C0(I)
A:CONS
T:T(I)
66
67
68
$DEMAND:CONS
D:PW
E:PF(F)
Q:W0
Q:E(F)
69
70
71
$OFFTEXT
$SYSINCLUDE mpsgeset M1_VEC
72
73
PW.FX = 1;
74
75
76
$INCLUDE M1_VEC.GEN
SOLVE M1_VEC USING MCP;
77
78
79
*
Solve the counterfactuals:
80
81
T("X") = 0.5;
82
83
84
$INCLUDE M1_VEC.GEN
SOLVE M1_VEC USING MCP;
85
86
87
E("L") = 2 * E("L");
T(I) = 0;
88
89
90
$INCLUDE M1_VEC.GEN
SOLVE M1_VEC USING MCP;
91
92
*
Present the MCP version for the sake of completeness:
93
94
95
PARAMETER
ALPHA(F,I)
BETA(I)
96
Factor input benchmark value share
Consumption value share;
97
98
99
ALPHA(F,I) = FD0(F,I) / SUM(FF, FD0(FF,I));
BETA(I) = C0(I) / W0;
100
101
102
103
104
105
106
107
EQUATIONS
PROFIT(I)
CMKT(I)
FMKT(F)
PRF_W
MKT_W
I_CONS
Zero profit condition
Commodity market clearance
Factor market clearance
Zero profit for aggregate consumption
Market clearance for aggregate consumption
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;
CMKT(I)..
Z0(I) * Z(I) =E= C0(I) * W * PROD(J, PC(J)**BETA(J)) / PC(I);
MKT_W..
W0 * W =E= CONS / PW;
FMKT(F)..
E(F) =E= SUM(I, FD0(F,I) * Z(I)
* PROD(FF, PF(FF)**ALPHA(FF,I))) / PF(F);
I_CONS..
CONS =E= SUM(F, PF(F) * E(F)) + SUM(I, T(I) * Z0(I) *
Z(I) * PROD(F, PF(F)**ALPHA(F,I)) );
112
113
114
115
116
117
118
119
120
121
122
123
MODEL ALGEBRAIC /PROFIT.Z, PRF_W.W, CMKT.PC, FMKT.PF, MKT_W.PW, I_CONS.CONS/;
124
125
126
E("L") = 100;
T(I) = 0;
127
128
SOLVE ALGEBRAIC USING MCP;
32
129
130
131
E("L") = 100;
T("X") = 0.5;
132
133
SOLVE ALGEBRAIC USING MCP;
134
135
136
E("L") = 2*E("L");
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 first 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 specification (such as changing the quantity fields,
or adding price fields 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 file accordingly.
3. Using a standard micro text which covers CES functions, try to verify that the cost functions
and the factor demand equations (using Shepard’s 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 different elasticities of substitution between different groups of
inputs.
This model is shown below. X and Y sectors each use the other sector’s output as an input, so that
each sector has three inputs. With three inputs, there may be different elasticities of substitution
between different 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
I:PL
I:PK
Q: 20
Q: 60
Q: 40
va:
va:
This production function can be portrayed graphically using a nesting diagram:
O:PY Q:120
I:PX Q:20
@
@%
&
s:0.75 @
@
@
@
@
@
&@%
va:1
@
@
I:PL Q:60
I:PK Q:40
This specifies 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 identifier 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 specifies
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 specified as equal to zero,
indicating that a fixed amount of the intermediate input is required for each unit of output. A
similar structure is specified 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 specification 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 finished there. You
also have to correctly apply Shepard’s lemma to find factor demands for use in the factor-marketclearing 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
6
7
8
9
10
11
12
Production Sectors
Consumers
Markets |
X
Y
W
|
CONS
-----------------------------------------------------PX
| 120
-20
-100
|
PY
| -20
120
-100
|
PW
|
200
|
-200
PL
| -40
-60
|
100
PK
| -60
-40
|
100
34
------------------------------------------------------
13
14
15
$OFFTEXT
16
17
18
PARAMETERS
TX;
19
20
TX = 0;
21
22
23
$ONTEXT
$MODEL: M22
24
25
26
27
28
$SECTORS:
X
Y
W
! Activity level for sector X
! Activity level for sector Y
! Activity level for sector W (Hicksian welfare index)
$COMMODITIES:
PX
PY
PL
PK
PW
!
!
!
!
!
$CONSUMERS:
CONS
! Income level for consumer CONS
29
30
31
32
33
34
35
Price
Price
Price
Price
Price
index
index
index
index
index
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
welfare (expenditure function)
36
37
38
39
40
41
42
43
44
$PROD:X s:0.5
O:PX
I:PY
I:PL
I:PK
va:1
Q:120
Q: 20
Q: 40
Q: 60
va: A:CONS
va: A:CONS
$PROD:Y s:0.75
O:PY
I:PX
I:PL
I:PK
va:1
Q:120
Q: 20
Q: 60
Q: 40
va:
va:
$PROD:W s:1
O:PW
I:PX
I:PY
Q:200
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:100
Q:100
T:TX
T:TX
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$OFFTEXT
$SYSINCLUDE mpsgeset M22
64
65
PW.FX = 1;
66
67
68
$INCLUDE M22.GEN
SOLVE M22 USING MCP;
69
70
*
Counterfactual:
71
72
73
74
TX = 1.0;
$INCLUDE M22.GEN
SOLVE M22 USING MCP;
75
76
35
100% tax on X sector inputs:
77
78
*
*
Algebraic representation -- note the complexity of two-level
CES functions which are automatically generated within MPSGE.
79
80
81
82
83
84
EQUATIONS
PRF_X
PRF_Y
PRF_W
Zero profit for sector X
Zero profit for sector Y
Zero profit for sector W (Hicksian welfare index)
85
86
87
88
89
90
MKT_X
MKT_Y
MKT_L
MKT_K
MKT_W
Supply-demand
Supply-demand
Supply-demand
Supply-demand
Supply-demand
balance
balance
balance
balance
balance
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor L
aggregate demand
I_CONS
Income definition for CONS;
91
92
93
94
95
PRF_X.. 120 * ( 1/6 * PY**(1-0.5) + 5/6 * (PL**0.4 * PK**0.6 *
(1+TX))**(1-0.5))**(1/(1-0.5)) =E= 120 * PX;
96
97
98
PRF_Y.. 120 * ( 1/6 * PX**(1-0.75) + 5/6 * (PL**0.6 * PK**0.4)**
(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
103
MKT_X.. 120 * X =E= 100 * W * PX**0.5 * PY**0.5 / PX +
20*Y*(PY/PX)**0.75;
104
105
106
MKT_Y.. 120 * Y =E= 100 * W * PX**0.5 * PY**0.5 / PY +
20*X*(PX/PY)**0.5;
107
108
MKT_W.. 200 * W =E= CONS / PW;
109
110
111
112
113
MKT_L.. 100 =E= 40 * X *
*
60 * Y *
*
(PX/((1+TX)*PL**0.4*PK**0.6))**0.5
PL**0.4 * PK**0.6 / PL +
(PY/(PL**0.6 * PK**0.4))**0.75
PL**0.6 * PK**0.4 / PL;
MKT_K.. 100 =E= 60 * X *
*
40 * Y *
*
(PX/((1+TX)*PL**0.4*PK**0.6))**0.5
PL**0.4 * PK**0.6 / PK +
(PY/(PL**0.6 * PK**0.4))**0.75
PL**0.6 * PK**0.4 / PK;
114
115
116
117
118
119
120
121
I_CONS.. CONS =E= 100*PL + 100*PK + TX * 100 * X * PL**0.4*PK**0.6 *
(PX/((1+TX)*PL**0.4*PK**0.6))**0.5;
122
123
124
MODEL ALGEBRAIC /PRF_X.X, PRF_Y.Y, PRF_W.W, MKT_X.PX, MKT_Y.PY,
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
131
TX = 0;
SOLVE ALGEBRAIC USING MCP;
132
133
*
Solve the same counterfactual:
134
135
136
TX = 1;
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 off with L at the top (CES) nest.
$PROD:X s:0.5
O:PX
I:PY
I:PL
I:PK
LY:1
Q:120
Q: 20
Q: 40
Q: 60
LY:
A:CONS
LY: A:CONS
T:TX
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 confirm 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 difficulty
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 final 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
Production Sectors
Consumers
Markets
|
A
B
W
|
CONS
-----------------------------------------------------PX
|
80
20
-100
|
PY
|
20
80
-100
|
PW
|
200
|
-200
PL
| -40
-60
|
100
PK
| -60
-40
|
100
------------------------------------------------------
5
6
7
8
9
10
11
12
13
14
15
$OFFTEXT
16
37
17
18
PARAMETERS
TA;
19
20
TA = 0;
21
22
$ONTEXT
23
24
$MODEL: M23
25
26
27
28
29
$SECTORS:
A
B
W
! Activity level for sector A (80:20 for X:Y)
! Activity level for sector B (20:80 for X:Y)
! Activity level for sector W (Hicksian welfare index)
$COMMODITIES:
PX
PY
PL
PK
PW
!
!
!
!
!
$CONSUMERS:
CONS
! Income level for consumer CONS
30
31
32
33
34
35
36
Price
Price
Price
Price
Price
index
index
index
index
index
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
welfare (expenditure function)
37
38
39
40
41
42
43
44
45
$PROD:A t:2.0
O:PX
O:PY
I:PL
I:PK
s:1
Q:80
Q:20
Q:40
Q:60
$PROD:B t:1.5
O:PX
O:PY
I:PL
I:PK
s:1
Q:20
Q:80
Q:60
Q:40
$PROD:W s:1
O:PW
I:PX
I:PY
Q:200
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:100
Q:100
A:CONS T:TA
A:CONS T:TA
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
$OFFTEXT
$SYSINCLUDE mpsgeset M23
65
PW.FX = 1;
66
67
68
69
$INCLUDE M23.GEN
SOLVE M23 USING MCP;
70
71
72
*
Counterfactual: 10% tax on X sector inputs:
73
74
75
76
TA = 0.10;
$INCLUDE M23.GEN
SOLVE M23 USING MCP;
77
78
*
Counterfactual: 100% tax on X sector inputs:
79
80
TA = 1.00;
38
81
82
$INCLUDE M23.GEN
SOLVE M23 USING MCP;
83
84
85
86
* now the mcp version, which again shows you the simplifying features
* of MPSGE
87
88
89
90
91
EQUATIONS
PRF_A
PRF_B
PRF_W
Zero profit for sector X
Zero profit for sector Y
Zero profit for sector W (Hicksian welfare index)
92
93
94
95
96
97
MKT_X
MKT_Y
MKT_L
MKT_K
MKT_W
Supply-demand
Supply-demand
Supply-demand
Supply-demand
Supply-demand
balance
balance
balance
balance
balance
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor
aggregate demand
I_CONS
Income definition for CONS;
98
99
100
101
102
*
*
Write the profit constraints as inequalities -- the tax
can cause sector A to shut down completely:
103
104
105
PRF_A.. 100 * PL**0.4 * PK**0.6 * (1+TA) =G=
100 * (0.8 * PX**(1+2.0) + 0.2 * PY**(1+2.0))**(1/(1+2.0));
106
107
108
PRF_B.. 100 * PL**0.6 * PK**0.4 =G=
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
113
114
MKT_X.. 80 * A *(PX/(0.8*PX**(1+2.0)+0.2*PY**(1+2.0))**(1/(1+2.0)))**2
+ 20 * B *(PX/(0.2*PX**(1+1.5)+0.8*PY**(1+1.5))**(1/(1+1.5)))**1.5
=E= 100 * W * PX**0.5 * PY**0.5 / PX;
115
116
117
118
MKT_Y.. 20 * A *(PY/(0.8*PX**(1+2.0)+0.2*PY**(1+2.0))**(1/(1+2.0)))**2.0
+ 80 * B *(PY/(0.2*PX**(1+1.5)+0.8*PY**(1+1.5))**(1/(1+1.5)))**1.5
=E= 100 * W * PX**0.5 * PY**0.5 / PY;
119
120
MKT_W.. 200 * W =E= CONS / PW;
121
122
123
MKT_L.. 100 =E= 40 * A * PL**0.4 * PK**0.6 / PL +
60 * B * PL**0.6 * PK**0.4 / PL;
124
125
126
MKT_K.. 100 =E= 60 * A * PL**0.4 * PK**0.6 / PK +
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
131
MODEL ALGEBRAIC /PRF_A.A, PRF_B.B, PRF_W.W, MKT_X.PX, MKT_Y.PY,
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
138
TA = 0;
SOLVE ALGEBRAIC USING MCP;
139
140
*
Solve the same counterfactuals:
141
142
143
TA = 0.10;
SOLVE ALGEBRAIC USING MCP;
144
39
145
146
TA = 1.00;
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 affect 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 find 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, σ =
3.3.3
1
ρ−1
Specific Factors (M24)
There are some inherent difficulties 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 “flats” 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
fixed or sector specific 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 specific to Y, and (iii) capital specific 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 sectorspecific resources, allows for more realistic policy experiments. Second, the returns to the specific
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 fixed 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 specific factors
affects 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
6
7
8
Here is the initial data matrix for example M21 (also M1\_MPS). As noted
in the text description, it is technically useful to interpret a portion
of capital in each sector as sector specific. Or it can in fact be a
separate factor such as land or resources.
9
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
------------------------------------------------------
10
11
12
13
14
15
16
17
18
19
20
Designate part of the capital in each sector as fixed in that sector
21
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
------------------------------------------------------
22
23
24
25
26
27
28
29
30
31
32
33
34
$OFFTEXT
35
36
37
PARAMETERS
TX;
38
39
TX = 0;
40
41
42
$ONTEXT
$MODEL:M24
43
44
$SECTORS:
41
X
Y
W
45
46
47
! Activity level for sector X
! Activity level for sector Y
! Activity level for sector W (Hicksian welfare index)
48
49
50
51
52
53
54
55
56
$COMMODITIES:
PW
PX
PY
PL
PK
PKX
PKY
!
!
!
!
!
!
!
$CONSUMERS:
CONS
! Income level for consumer CONS
Price
Price
Price
Price
Price
Price
Price
index
index
index
index
index
index
index
for
for
for
for
for
for
for
welfare (expenditure function)
commodity X
commodity Y
primary factor L
(mobile) capital
sector-specific input for sector X
sector-specific input for sector Y
57
58
59
60
61
62
63
64
65
$PROD:X s:1
O:PX
I:PL
I:PK
I:PKX
Q:100
Q: 25
Q: 50
Q: 25
$PROD:Y s:1
O:PY
I:PL
I:PK
I:PKY
Q:100
Q: 75
Q: 15
Q: 10
$PROD:W s:1
O:PW
I:PX
I:PY
Q:200
Q:100
Q:100
A:CONS T:TX
A:CONS T:TX
A:CONS T:TX
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
$DEMAND:CONS
D:PW
E:PL
E:PK
E:PKX
E:PKY
Q:200
Q:100
Q: 65
Q: 25
Q: 10
84
85
86
$OFFTEXT
$SYSINCLUDE mpsgeset M24
87
88
89
$INCLUDE M24.GEN
SOLVE M24 USING MCP;
90
91
*
Solve a counterfactual:
92
93
94
95
TX = 0.5;
$INCLUDE M24.GEN
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 efficient (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
efficient 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 first counterfactual in which Z is
allowed to operate. Can you interpret the welfare results? Hint: while the tax is distortionary, the
switch to the inefficient 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
Production Sectors
Consumers
Markets
|
X
Y
W
|
CONS
-----------------------------------------------------PX
| 100
-100
|
PY
|
100
-100
|
PW
|
200
|
-200
PL
| -40
-60
|
100
PK
| -60
-40
|
100
------------------------------------------------------
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Activity Z is unprofitable at initial equilibrium prices. It is
therefore not operated, and we cannot infer its technical properties
from the benchmark social accounting data. We assume that Z is 10\%
less efficient than X.
19
20
$OFFTEXT
21
22
23
PARAMETERS
TX;
24
25
TX = 0;
26
27
28
$ONTEXT
$MODEL:M25
29
30
31
32
33
34
$SECTORS:
X
Y
W
Z
!
!
!
!
Activity level for sector X
Activity level for sector Y
Activity level for sector W (Hicksian welfare index)
Alternative activity for producing X.
$COMMODITIES:
PX
PY
PL
PK
PW
!
!
!
!
!
Price
Price
Price
Price
Price
$CONSUMERS:
CONS
! Income level for consumer CONS
35
36
37
38
39
40
41
index
index
index
index
index
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
welfare (expenditure function)
42
43
44
45
46
$PROD:X s:1
43
O:PX
I:PL
I:PK
Q:100
Q: 40
Q: 60
$PROD:Y s:1
O:PY
I:PL
I:PK
Q:100
Q: 60
Q: 40
$PROD:Z s:1
O:PX
I:PL
I:PK
Q:100
Q: 44
Q: 66
$PROD:W s:1
O:PW
I:PX
I:PY
Q:200
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:100
Q:100
47
48
49
A:CONS T:TX
A:CONS T:TX
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
$OFFTEXT
$SYSINCLUDE mpsgeset M25
73
74
PW.FX = 1;
75
76
Z.L = 0;
77
78
79
$INCLUDE M25.GEN
SOLVE M25 USINCP MCP;
80
81
*
Let’s levy a high on sector X and see what happens:
82
83
84
85
TX = 0.25;
$INCLUDE M25.GEN
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
92
93
TX = 0.25;
$INCLUDE M25.GEN
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 fixed 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 consumer’s 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 specified 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 specifies a nesting structure in which goods have an elasticity of substitution 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
O:PW
I:PX
I:PY
I:PL
cons:1
Q:300
Q:100 cons:
Q:100 cons:
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
Production Sectors
Consumers
Markets
|
A
B
W
T |
CONS
--------------------------------------------------------PX
|
80
20
-100
|
PY
|
20
80
-100
|
PW
|
300
|
-300
PLS | -40
-60
100 |
PL
|
-100
-100 |
200
PK
| -60
-40
|
100
---------------------------------------------------------
8
9
10
11
12
13
14
15
16
17
18
19
$OFFTEXT
20
45
21
22
23
24
PARAMETERS
TL
WELFARE
REALCONS
Tax rate on labor /0/
Hicksian equivalent welfare
Real consumption;
25
26
27
$ONTEXT
$MODEL:M26
28
29
30
31
32
33
$SECTORS:
X
Y
T
W
!
!
!
!
Activity level for sector X
Activity level for sector Y
Labor supply
Activity level for sector W (Hicksian welfare index)
$COMMODITIES:
PX
PY
PL
PLS
PK
PW
!
!
!
!
!
!
Price
Price
Price
Price
Price
Price
$CONSUMERS:
CONS
! Income level for consumer CONS
34
35
36
37
38
39
40
41
index
index
index
index
index
index
for
for
for
for
for
for
commodity X
commodity Y
leisure
labor supply (factor L input)
primary factor K
welfare (expenditure function)
42
43
44
45
46
47
48
49
50
$PROD:X s:1
O:PX
I:PLS
I:PK
Q:100
Q: 40
Q: 60
$PROD:Y s:1
O:PY
I:PLS
I:PK
Q:100
Q: 60
Q: 40
51
52
53
54
55
56
57
$PROD:T
O:PLS
I:PL
58
59
Q:100
Q:100
A:CONS T:TL
60
61
62
63
64
65
$PROD:W s:0.5
O:PW
I:PX
I:PY
I:PL
cons:1
Q:300
Q:100 cons:
Q:100 cons:
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:300
Q:200
Q:100
66
67
68
69
70
71
72
73
$OFFTEXT
$SYSINCLUDE mpsgeset M26
74
75
PW.FX = 1;
76
77
78
$INCLUDE M26.GEN
SOLVE M26 USING MCP;
79
80
81
82
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;
83
84
*
Solve a counter-factual, tax labor supply at 25%
46
85
86
87
88
TL = 0.5;
$INCLUDE M26.GEN
SOLVE M26 USING MCP;
89
90
91
92
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;
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 consumer’s price of a labor supplied to the market. PLS is going to
be the producer’s 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 +
DISPLAY WELFARE, REALCONS;
PY.L*Y.L*100) / (PX.L**0.5*PY.L**0.5*200);
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 first two of these statements, parameters (declared earlier) are assigned values following the
solution to the model. The first is just the value of welfare. The second, “REALCONS”, is short for
the real value of goods consumption. This is specified 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 specified 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 benefit of removing the tax
if labor supply increases.
Finally, GAMS does not automatically write out the values of parameters in the listing file (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 affects 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 finance 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 first 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 simplification 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 file 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 different commodity name (PLF and PLI) which are the
actual inputs into production. This is just a trip so that the listing file 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 specified once, in
the LF activity, and not in every production block using formal labor.
Here is the program. You will see from the listing file 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
7
8
Activity LS transforms leisure into formal and informal labor supplies.
LF and LI are "dummy" activities used to keep track of how much labor
is supplied to each market.
9
10
11
12
13
14
15
16
17
18
19
20
Production Sectors
Consumers
Markets
|
X
Y
W
LF
LI
LS |
CONS
------------------------------------------------------------------PX
| 100
-100
|
PY
|
100
-100
|
PW
|
200
|
-200
PLF | -40
-10
50
|
PLI |
-50
50
|
PLSF |
-50
50 |
PLSI |
-50
50 |
PL
|
-100 |
100
48
PK
| -60
-40
|
100
----------------------------------------------------------------
21
22
23
24
$OFFTEXT
25
26
27
PARAMETERS
TL;
28
29
TL = 0;
30
31
32
$ONTEXT
$MODEL:M27
33
34
35
36
37
38
39
40
$SECTORS:
X
Y
LS
LF
LI
W
!
!
!
!
!
!
Activity
Activity
Activity
Activity
Activity
Activity
$COMMODITIES:
PX
PY
PL
PLSF
PLSI
PLF
PLI
PK
PW
!
!
!
!
!
!
!
!
!
Price
Price
Price
Price
Price
Price
Price
Price
Price
$CONSUMERS:
CONS
! Income level for consumer CONS
$PROD:X s:1
O:PX
I:PLF
I:PK
Q:100
Q: 40
Q: 60
level for sector X
level for sector Y
level for household labor supply
for formal labor supply
for informal labor supply
level for sector W (Hicksian welfare index)
41
42
43
44
45
46
47
48
49
50
51
index
index
index
index
index
index
index
index
index
for
for
for
for
for
for
for
for
for
commodity X
commodity Y
labor
formal labor supplied to market
informal labor supply to market
formal labor supplied to firms
informal labor supplied to firms
primary factor K
welfare (expenditure function)
52
53
54
55
56
57
58
59
60
61
62
63
64
65
$PROD:Y s:1 a:3
O:PY
Q:100
I:PLF
Q: 10
I:PLI
Q: 50
I:PK
Q: 40
a:
a:
66
67
68
69
70
$PROD:LS t:5.0
O:PLSF
O:PLSI
I:PL
Q: 50
Q: 50
Q:100
71
72
$PROD:LF
73
74
O:PLF
I:PLSF
Q: 50
Q: 50
O:PLI
I:PLSI
Q: 50
Q: 50
75
76
$PROD:LI
77
78
79
80
81
82
83
$PROD:W s:1.0
O:PW
I:PX
I:PY
84
49
Q:200
Q:100
Q:100
A:CONS T:TL
85
86
87
88
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:100
Q:100
89
90
91
$OFFTEXT
$SYSINCLUDE mpsgeset M27
92
93
PW.FX = 1;
94
95
96
$INCLUDE M27.GEN
SOLVE M27 USING MCP;
97
98
*
Solve a counter-factual, tax formal labor supply at 50%
99
100
101
102
TL = 0.5;
$INCLUDE M27.GEN
SOLVE M27 USING MCP;
103
3.3.7
Heterogeneous Households (M28)
A great many questions of interest to trade and public finance economists involve issues of distribution rather than or in addition to issues of aggregate welfare. Households (or “consumers” in
MPSGE) may differ in their preferences and more importantly in their sources of income (or their
factor endowments). For both reasons, different taxes and other government policies affect different
households in different ways. In addition to creating deadweight losses or aggregate benefits, tax
change can also significantly 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 effect outweighs the overall deadweight loss of the tax for household A, which is
actually better off. 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 differ 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 off. That would violate the first theorem of welfare economics. Try some
alternative distributions to check on this. You will need to specify two end different 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 effect 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
Production Sectors
Consumers
Markets
|
X
Y
WA
WB |
A
B
---------------------------------------------------------PX
| 100
-40
-60 |
PY
|
100
-60
-40 |
PWA |
100
| -100
PWB |
100 |
-100
PL
| -25
-75
|
90
10
PK
| -75
-25
|
10
90
----------------------------------------------------------
7
8
9
10
11
12
13
14
15
16
17
18
$OFFTEXT
19
20
21
PARAMETERS
TX;
22
23
TX = 0;
24
25
$ONTEXT
26
27
$MODEL:M28
28
29
30
31
32
33
$SECTORS:
X
Y
WA
WB
!
!
!
!
Activity level for sector X
Activity level for sector Y
Welfare index for consumer A
Welfare index for consumer B
$COMMODITIES:
PX
PY
PL
PK
PWA
PWB
!
!
!
!
!
!
Price
Price
Price
Price
Price
Price
$CONSUMERS:
CONSA
CONSB
! Income level for consumer A
! Income level for consumer B
34
35
36
37
38
39
40
41
index
index
index
index
index
index
for
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
consumer A welfare
consumer B welfare
42
43
44
45
46
47
48
49
50
*
*
*
*
More than one tax may be levied on a single transaction with
revenues accruing to different agents. As specified here, the
ad-valorem tax rate on inputs to sector X equals 2*TX. Half
of the tax revenue accrues to A and half to B.
51
52
53
54
55
$PROD:X s:1
O:PX
I:PL
I:PK
Q:100
Q: 25
Q: 75
$PROD:Y s:1
O:PY
I:PL
I:PK
Q:100
Q: 75
Q: 25
$PROD:WA s:1
O:PWA
I:PX
I:PY
Q:100
Q: 40
Q: 60
56
57
58
59
60
61
62
63
64
65
66
51
A:CONSA
A:CONSA
T:TX
T:TX
A:CONSB
A:CONSB
T:TX
T:TX
67
68
69
70
$PROD:WB s:1
O:PWB
I:PX
I:PY
Q:100
Q: 60
Q: 40
$DEMAND:CONSA
D:PWA
E:PL
E:PK
Q:100
Q: 90
Q: 10
$DEMAND:CONSB
D:PWB
E:PL
E:PK
Q:100
Q: 10
Q: 90
71
72
73
74
75
76
77
78
79
80
81
82
83
$OFFTEXT
$SYSINCLUDE mpsgeset M28
84
85
PL.FX = 1;
86
87
88
$INCLUDE M28.GEN
SOLVE M28 USING MCP;
89
90
91
*
Solve a counterfactual:
92
93
94
95
TX = 0.25;
$INCLUDE M28.GEN
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 generalequilibrium 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 specified 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:
α(I − px X ∗ )
X = X∗ +
px
Y =
(1 − α)(I − px ‘X ∗ )
py
52
The first equation is rather intuitive in words. It says that you first purchase the minimum consumption 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.
αI + (1 − α)px X ∗
px X
=
I
I
I dX
αI
=
X dI
αI + (1 − α)px 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 W then 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 final 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 insufficient to
produce X*), the solver will crash and not compute a solution. These difficulties are troubling, but
we are sure that good policy must consider the fact that really poor people consume very different
bundles of goods than rich people, and this has probably more to do with non-homogeneity than
them having homogeneous but different preferences.
1
$TITLE
Model M29: Closed 2x2 Economy --
Stone Geary (LES) Preferences
2
3
$ONTEXT
4
5
6
The observed data is:
7
Production Sectors
Consumers
Markets
|
X
Y
W
|
CONS
-----------------------------------------------------PX
| 100
-100
|
PY
|
100
-100
|
PW
|
200
|
-200
8
9
10
11
12
13
53
14
15
16
PL
| -40
-60
|
100
PK
| -60
-40
|
100
------------------------------------------------------
17
18
But calibrated to the model as:
19
20
21
22
23
24
25
26
27
28
Production Sectors
Consumers
Markets
|
X
Y
W
|
CONS
-----------------------------------------------------PX
| 100
-60
|
-40
PY
|
100
-100
|
PW
|
160
|
-160
PL
| -40
-60
|
100
PK
| -60
-40
|
100
------------------------------------------------------
29
30
$OFFTEXT
31
32
33
PARAMETERS
ENDOW;
34
35
ENDOW = 1;
36
37
$ONTEXT
38
39
$MODEL:M29
40
41
42
43
44
$SECTORS:
X
Y
W
! Activity level for sector X
! Activity level for sector Y
! Activity level for sector W (Hicksian welfare index)
$COMMODITIES:
PX
PY
PL
PK
PW
!
!
!
!
!
$CONSUMERS:
CONS
! Income level for consumer CONS
$PROD:X s:1
O:PX
I:PL
I:PK
Q:100
Q: 40
Q: 60
$PROD:Y s:1
O:PY
I:PL
I:PK
Q:100
Q: 60
Q: 40
$PROD:W s:1
O:PW
I:PX
I:PY
Q:160
Q: 60
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
E:PX
Q:160
Q:(100*ENDOW)
Q:(100*ENDOW)
Q:-40
45
46
47
48
49
50
51
Price
Price
Price
Price
Price
index
index
index
index
index
for
for
for
for
for
commodity X
commodity Y
primary factor L
primary factor K
welfare (expenditure function)
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$OFFTEXT
54
78
$SYSINCLUDE mpsgeset M29
79
80
PW.FX = 1;
81
82
83
$INCLUDE M29.GEN
SOLVE M29 USING MCP;
84
85
*
Counterfactual: double the factor endowment.
86
87
ENDOW = 2;
88
89
90
$INCLUDE M29.GEN
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 fixed in this model and the
first 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 fixed 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 specified 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
PE1
PM2
TM2
Import
Export
Import
Import
price of good 1 /1.01/,
price of good 1 /1/,
price of good 2 /1/,
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 define 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
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:50
Q:(50*PM2)
$PROD:M2
A:CONS
T:TM2
TM2 is an import tariff 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 infinitely 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” differently for the activities M1 and E2, so
that it is never profitable to export and import the same good.
Here is the model. In the first counterfacual we impose a tariff and 5% and then a tariff of 10%.
When you look at the listing files, you will see that the tariff of 10% is prohibitive, all trade ceases.
The last experiment returns the tariff 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
4
$ONTEXT
Production Sectors
Consumer
5
6
7
8
9
10
11
12
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
56
13
14
PFX
|
50
-50
------------------------------------------------------------------
15
16
$OFFTEXT
17
18
19
20
21
22
23
PARAMETERS
PE2
PM1
PE1
PM2
TM2
Export
Import
Export
Import
Import
price of good 2,
price of good 1,
price of good 1,
price of good 2,
tariff for god 2;
24
25
26
27
28
29
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1;
0.99;
1.01;
0;
30
31
$ONTEXT
32
33
$MODEL:M41
34
35
36
37
38
39
40
41
42
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONS
! Income level for representative agent
43
44
45
46
47
48
49
50
51
52
53
54
55
$PROD:X1
56
57
58
s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
s:1
O:P2
I:PL
I:PK
Q:50
Q:20
Q:30
O:PFX
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:50
Q:(50*PM2)
O:PFX
I:P2
Q:(50*PE2)
Q:50
59
60
$PROD:X2
61
62
63
64
65
$PROD:E1
66
67
68
69
$PROD:M2
70
71
72
73
$PROD:E2
74
75
76
57
A:CONS
T:TM2
77
$PROD:M1
78
79
O:P1
I:PFX
Q:50
Q:(50*PM1)
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
Q:100
80
81
$PROD:W
82
83
84
85
86
87
88
89
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:120
Q: 80
90
91
92
$OFFTEXT
$SYSINCLUDE mpsgeset M41
93
94
PW.FX = 1;
95
96
97
98
99
E2.L
M1.L
E1.L
M2.L
=
=
=
=
0;
0;
1;
1;
100
101
102
103
104
M41.ITERLIM = 0;
$INCLUDE M41.GEN
SOLVE M41 USING MCP;
M41.ITERLIM = 2000;
105
106
107
TM2 = 0.05;
108
109
110
$INCLUDE M41.GEN
SOLVE M41 USING MCP;
111
112
TM2 = 0.10;
113
114
115
$INCLUDE M41.GEN
SOLVE M41 USING MCP;
116
117
118
119
TM2 = 0.;
PE1 = 1.2;
PM1 = 1.21;
120
121
122
$INCLUDE M41.GEN
SOLVE M41 USING MCP;
Exercises:
(1) If you have an international trade textbook, review the Stopler-Samuelson theorem. Examine
the effects of the tariff and the terms-of-trade improvement and see that the results validate the
theorem. From a policy point of view, the redistribution effects of tariffs are very important and
help explain their existence.
(2) Set the tariff 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 tariff on X2 and verify
this numerically (hint: the two tax rates are not same, since the base is different, an issue discussed
in the previous chapter).
58
3.3.11
Small open economy with a benchmark tariff (M42)
This model has a 20% tariff 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 tariff, or 20% of the
value of imports (10/50). This tariff 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
6
In this example, units are chosen such that all DOMESTIC prices equal
one initially. Implied world prices are then P1/P2 = 1.2
7
8
9
10
11
12
13
14
15
16
17
18
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
------------------------------------------------------------------
19
20
$OFFTEXT
21
22
PARAMETERS
23
PE2
24
59
Export price of good 2,
25
26
27
28
PM1
PE1
PM2
TM2
Import
Export
Import
Import
price of good 1,
price of good 1,
price of good 2,
tariff for good 2;
29
30
31
32
33
34
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1/(1.2);
PM2*0.99;
1.01;
0.20;
35
36
37
$ONTEXT
38
39
$MODEL:M42
40
41
42
43
44
45
46
47
48
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONS
! Income level for representative agent
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:40
Q:20
Q:20
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
$PROD:E1
72
73
O:PFX
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:60
Q:(60*PM2)
O:PFX
I:P2
Q:(60*PE2)
Q:60
O:P1
I:PFX
Q:50
Q:(50*PM1)
s:1
O:PW
Q:200
74
75
$PROD:M2
76
77
A:CONS
T:TM2
78
79
$PROD:E2
80
81
82
83
$PROD:M1
84
85
86
87
88
$PROD:W
60
I:P1
I:P2
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:120
Q: 70
89
90
91
92
93
94
95
96
97
98
$OFFTEXT
$SYSINCLUDE mpsgeset M42
99
100
PW.FX = 1;
101
102
103
104
105
E1.L
M2.L
E2.L
M1.L
=
=
=
=
1;
1;
0;
0;
106
107
108
109
110
M42.ITERLIM = 0;
$INCLUDE M42.GEN
SOLVE M42 USING MCP;
M42.ITERLIM = 2000;
111
112
*
Counterfactual experiment is free trade
113
114
TM2 = 0;
115
116
117
$INCLUDE M42.GEN
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
affects 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 fields of the program. W for example, is calibrated as:
$PROD:W
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
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
9
all WORLD prices equal one initially.
ratio is then P2 = 1.2.
The benchmark domestic price
10
11
12
13
Note that this changes the units of measurement in good 2. There are
now 83.3333 units of good 2 consumed instead of 100, but this is
simply a change in units of measure and has no welfare consequences.
14
Production Sectors
15
Consumer
16
17
18
19
20
21
22
23
24
25
26
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
|
-10
10
------------------------------------------------------------------
27
28
$OFFTEXT
29
30
PARAMETERS
31
PE2
PM1
PE1
PM2
TM2
32
33
34
35
36
Export
Import
Export
Import
Import
price of good 2,
price of good 1,
price of good 1,
price of good 2,
tariff for good 2;
37
38
39
40
41
42
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1;
0.99;
1.01;
0.20;
43
44
45
$ONTEXT
46
47
$MODEL:M43
48
49
50
51
52
53
54
55
56
57
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONS
! Income level for representative agent
58
59
60
61
62
63
64
65
66
67
68
69
70
*
Cobb-Douglas production in both sectors:
71
62
72
73
74
75
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
76
77
$PROD:X2
78
79
80
s:1
O:P2
I:PL
I:PK
Q:33.33333
Q:20
Q:20
O:PFX
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:50
Q:(50*PM2)
O:PFX
I:P2
Q:(50*PE2)
Q:(50)
O:P1
I:PFX
Q:50
Q:(50*PM1)
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
Q:83.33333
P:1.2
81
82
$PROD:E1
83
84
85
86
$PROD:M2
87
88
A:CONS
T:TM2
89
90
$PROD:E2
91
92
93
94
$PROD:M1
95
96
97
98
$PROD:W
99
100
101
P:1.2
102
103
104
105
106
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:120
Q: 70
107
108
109
$OFFTEXT
$SYSINCLUDE mpsgeset M43
110
111
PW.FX = 1;
112
113
*
Benchmark replication
114
115
116
117
118
119
E1.L
M2.L
E2.L
M1.L
P2.L
=
=
=
=
=
1;
1;
0;
0;
1.2;
120
121
122
M43.ITERLIM = 0; $INCLUDE M43.GEN SOLVE M43 USING MCP; M43.ITERLIM =
2000;
123
124
*
Counterfactual experiment is free trade
125
126
TM2 = 0;
127
128
129
$INCLUDE M43.GEN
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 file 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 difference, 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 off, 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 difference. 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
I:PFX
Q:60
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 tariff equivalent of the quota or the ”shadow tariff”. In
one exercise following the model, you are asked to increase the size of the economy and see what
happens to this shadow tariff. To free up a variable when it has been fixed, 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
6
In this example, units are chosen such that all DOMESTIC prices equal
one initially. Implied world prices are then P1/P2 = 1.2
7
Production Sectors
8
Consumer
9
10
11
12
13
14
15
16
17
18
19
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
Q (quota rent)|
-10
10
------------------------------------------------------------------
20
21
$OFFTEXT
22
23
PARAMETERS
24
PE2
PM1
PE1
PM2
TM2
25
26
27
28
29
Export
Import
Export
Import
Import
price of good 2,
price of good 1,
price of good 1,
price of good 2,
tariff for good 2;
30
31
32
33
34
35
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1/(1.2);
PM2*0.99;
1.01;
0.20;
36
37
$ONTEXT
38
39
$MODEL:M42
40
41
42
43
44
45
46
47
48
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONS
! Income level for representative agent
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$AUXILIARY:
Q
63
64
$PROD:X1 s:1
65
O:P1
I:PL
I:PK
65
66
67
Q:150
Q:100
Q: 50
68
69
70
71
72
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:40
Q:20
Q:20
73
74
$PROD:E1
O:PFX
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:60
Q:(60*PM2)
O:PFX
I:P2
Q:(60*PE2)
Q:60
O:P1
I:PFX
Q:50
Q:(50*PM1)
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
Q:100
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:120
Q: 70
75
76
77
78
$PROD:M2
79
80
A:CONS
N:Q
81
82
$PROD:E2
83
84
85
86
$PROD:M1
87
88
89
90
$PROD:W
91
92
93
94
95
96
97
98
99
100
101
102
$CONSTRAINT:Q
1 =G= M2;
103
104
105
$OFFTEXT
$SYSINCLUDE mpsgeset M42
106
107
PW.FX = 1;
108
109
110
111
112
113
E1.L = 1;
M2.L = 1;
E2.L = 0;
M1.L = 0;
Q.L = 0.20;
114
115
116
117
118
M42.ITERLIM = 0;
$INCLUDE M42.GEN
SOLVE M42 USING MCP;
M42.ITERLIM = 2000;
119
120
*
Counterfactual experiment is free trade
121
122
Q.FX = 0;
123
124
125
$INCLUDE M42.GEN
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 tariff, the value of Q. Can you explain why?
(2) Following this experiment, fix Q at Q = 0.20, its initial value so that it is in fact a tariff.
Again double the size of the economy and compare the results of this tariff 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 firms to limit their exports to a certain quota level. The effect of this is to transfer
the quota rents to the foreign country. It is like having a tariff and giving the tariff 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
tariff revenue) and demands some of the country’s 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) field 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 first 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 different and the shadow values (Q
and V) are not the same. The switch to the auction quota creates an income effect 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 effect the quota becomes more restrictive and the shadow tariff
increases (Q is larger than V). Note that the welfare effect 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
6
In this example, units are chosen such that all DOMESTIC prices equal
one initially.
7
Production Sectors
8
Consumer
9
10
11
12
13
14
15
16
17
18
19
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 rent)|
-10
10
------------------------------------------------------------------
20
21
$OFFTEXT
22
23
PARAMETERS
24
25
26
27
28
29
PE2
PM1
PE1
PM2
TM2
Export
Import
Export
Import
Import
price of good 2,
price of good 1,
price of good 1,
price of good 2,
tariff for good 2;
30
31
32
33
34
35
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1/(1.2);
PM2*0.99;
1.01;
0.20;
36
37
38
$ONTEXT
39
40
$MODEL:M42
41
42
43
44
45
46
47
48
49
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONSH
CONSF
! Income level for domestic consumer
! Income level for foreign consumer (quota holder)
$AUXILIARY:
V
! Endogenous tax, shadow tax for VER
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
68
Q
65
! Endogenous tax, shadow tax for quota
66
67
68
69
70
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:40
Q:20
Q:20
71
72
73
74
75
76
77
$PROD:E1
78
79
O:PFX
I:P1
Q:(50*PE1)
Q:50
O:P2
I:PFX
Q:60
Q:(60*PM2)
O:PFX
I:P2
Q:(60*PE2)
Q:60
O:P1
I:PFX
Q:50
Q:(50*PM1)
s:1
O:PW
I:P1
I:P2
Q:190
Q: 90
Q:100
80
81
$PROD:M2
82
83
84
85
$PROD:E2
86
87
88
89
$PROD:M1
90
91
92
93
$PROD:W
94
95
96
97
98
99
100
101
$DEMAND:CONSH
D:PW
E:PL
E:PK
Q:190
Q:120
Q: 70
$DEMAND:CONSF
D:P1
Q:10
102
103
104
105
106
107
$CONSTRAINT:V
1 =G= M2;
108
109
110
$CONSTRAINT:Q
1 =G= M2;
111
112
113
$OFFTEXT
$SYSINCLUDE mpsgeset M42
114
115
PW.FX = 1;
116
117
118
119
120
121
122
E1.L = 1;
M2.L = 1;
E2.L = 0;
M1.L = 0;
V.L = 0.20;
Q.FX = 0;
123
124
125
126
127
M42.ITERLIM = 0;
$INCLUDE M42.GEN
SOLVE M42 USING MCP;
M42.ITERLIM = 2000;
128
69
A:CONSF
N:V
A:CONSH
N:Q
129
*
Counterfactual: replace the VER with an auction quota
130
131
132
133
Q.LO = 0;
Q.UP = +INF;
V.FX = 0;
134
135
136
$INCLUDE M42.GEN
SOLVE M42 USING MCP;
Exercise:
Replace the initial VER with a tariff of 0.20 on the import good. Assign the tariff revenue to
agent CONSF. Show that this replicates the benchmark data. Show that a tariff 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 deficit 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 effects difficult to interpret. If a policy experiment leads to an
increase in the deficit, 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 deficit fixed 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 deficit. 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 deficit is financed by
selling the initial benchmark endowment of 20 units of PFX. The latter is specified by the parameter
BOPDEF which we can change in counterfactual experiments.
$DEMAND:CONS
D:PW
E:PL
E:PK
E:PFX
Q:220
Q:120
Q: 80
Q:BOPDEF
For a counterfactual, we eliminate the deficit, 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
Production Sectors
5
Consumer
6
7
8
9
10
11
12
13
14
15
Markets
|
X1
X2
E1
M2
W
CONS
-----------------------------------------------------------------P1
|
150
-40
-110
P2
|
50
60
-110
PL
|
-100
-20
120
PK
|
-50
-30
80
PW
|
220
-220
PFX
|
40
-60
20
------------------------------------------------------------------
16
17
$OFFTEXT
18
19
20
21
22
23
24
25
PARAMETERS
PE2
PM1
PE1
PM2
TM2
BOPDEF
Export price of good 2,
Import price of good 1,
Export price of good 1,
Import price of good 2,
Import tariff for good 2,
Balance of payments net deficit;
26
27
28
29
30
31
PE1
PM2
PE2
PM1
TM2
=
=
=
=
=
1;
1;
0.99;
1.01;
0;
32
33
$ONTEXT
34
35
$MODEL:M46
36
37
38
39
40
41
42
43
44
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export level of good 1
Export level of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
$CONSUMERS:
CONS
! Income level for representative agent
45
46
47
48
49
50
51
52
53
54
55
71
56
57
58
59
60
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:50
Q:20
Q:30
61
62
63
64
65
66
67
$PROD:E1
68
69
O:PFX
I:P1
Q:(40*PE1)
Q:40
O:P2
I:PFX
Q:60
Q:(60*PM2)
O:PFX
I:P2
Q:(60*PE2)
Q:60
O:P1
I:PFX
Q:40
Q:(40*PM1)
s:1
O:PW
I:P1
I:P2
Q:220
Q:110
Q:110
70
71
$PROD:M2
72
73
A:CONS
T:TM2
74
75
$PROD:E2
76
77
78
79
$PROD:M1
80
81
82
83
$PROD:W
84
85
86
87
88
89
90
91
92
$DEMAND:CONS
D:PW
E:PL
E:PK
E:PFX
Q:220
Q:120
Q: 80
Q:BOPDEF
93
94
95
$OFFTEXT
$SYSINCLUDE mpsgeset M46
96
97
98
99
100
101
102
E2.L =
M1.L =
E1.L =
M2.L =
BOPDEF
0;
0;
1;
1;
= 20;
103
104
105
106
107
M46.ITERLIM = 0;
$INCLUDE M46.GEN
SOLVE M46 USING MCP;
M46.ITERLIM = 2000;
108
109
*
Compute a counterfactual experiment setting the deficit to zero.
110
111
BOPDEF = 0;
112
113
114
$INCLUDE M46.GEN
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 classified 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 fine
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 flows 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 classification 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 define four distinct goods and a nesting structure for the
utility function. In our case we write this as:
$PROD:W
s:1 G1:ESUB
O:PW
Q:200
I:P1
Q: 50
I:PF1
Q: 50
I:P2
Q: 25
I:PF2
Q: 75
G2:ESUB
G1:
G1:
G2:
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 defined for
four distinct goods. There is no need now to worry about a domestic good being both imported and
exported. It cannot, by definition, be imported.
After the replication check, we run the same counterfactuals that we did for model M41, a tariff of
5% and then 10% on (foreign) good 2.
1
$TITLE
Model M47: SOE model with an Armington
formulation.
2
3
$ONTEXT
4
Production Sectors
5
Consumer
6
7
8
9
10
11
12
13
14
15
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
---------------------------------------------------------------
16
17
$OFFTEXT
18
19
20
21
22
23
24
25
PARAMETERS
PE2
PM1
PE1
PM2
TM2
ESUB
Export price of good 2,
Import price of good 1,
Export price of good 1,
Import price of good 2,
Import tariff for good 2,
Armington elasticity of substitution;
26
27
28
29
30
31
32
PE1 = 1;
PM2 = 1;
PE2 = 1;
PM1 = 1;
TM2 = 0;
ESUB = 4;
33
34
35
$ONTEXT
36
37
$MODEL:M47
38
39
40
41
42
43
44
45
46
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index
Production index
Export index for
Export index for
Import index for
Import index for
Welfare index
for good 1
good 2
good 1
good 2
good 1
good 2
47
48
$COMMODITIES:
74
P1
P2
PF1
PF2
PFX
PW
PL
PK
49
50
51
52
53
54
55
56
!
!
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Price index for imported good 1
Price index for imported good 2
Read exchange rate index
Welfare price index
Wage index
Capital rental index
57
58
59
$CONSUMERS:
CONS
! Income level for representative agent
60
61
*
Cobb-Douglas production in both sectors:
62
63
64
65
66
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:50
Q:20
Q:30
67
68
69
70
71
72
73
74
*
*
We scale the export price for good 1 and the import price
for good 2 to both be unity:
75
76
$PROD:E1
77
78
O:PFX
I:P1
Q:(PE1*100)
Q:100
O:PFX
I:P2
Q:(PE2*25)
Q:25
O:PF1
I:PFX
Q:50
Q:(PM1*50)
O:PF2
I:PFX
Q:75
Q:(PM2*75)
79
80
$PROD:E2
81
82
83
84
$PROD:M1
85
86
87
88
$PROD:M2
89
90
A:CONS
91
92
$PROD:W
93
94
95
96
97
s:1 G1:ESUB
O:PW
Q:200
I:P1
Q: 50
I:PF1
Q: 50
I:P2
Q: 25
I:PF2
Q: 75
G2:ESUB
G1:
G1:
G2:
G2:
98
99
100
101
102
$DEMAND:CONS
D:PW
E:PL
E:PK
Q:200
Q:120
Q: 80
103
104
105
$OFFTEXT
$SYSINCLUDE mpsgeset M47
106
107
PW.FX = 1;
108
109
110
111
112
M47.ITERLIM = 0;
$INCLUDE M47.GEN
SOLVE M47 USING MCP;
75
T:TM2
113
M47.ITERLIM = 2000;
114
115
116
TM2 = 0.05;
117
118
119
$INCLUDE M47.GEN
SOLVE M47 USING MCP;
120
121
TM2 = 0.10;
122
123
124
$INCLUDE M47.GEN
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 fixed 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 specified with constant returns to scale. Yet
having one fixed 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 specific factor trick to make the foreign exchange received for exports of X1 a strictly
concave function of export volume. We will create a ficticious 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 ficticious 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
ficticious 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 ficticious 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
I:PR
Q: 50
Q: 50
We have specified this as a Cobb-Douglas function, so we are assuming that it is of the form:
FX =
Hence:
p
X1
X1 R
FX
∂F X
= 0.5
∂‘X1
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:
dp1
∂F X
= p1 + X 1
∂X1
d‘X1
X1 dF X
X1
= 1 + 1/η
=1+
F X dX1
p1 (dp1 /dX1 )
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 infinite 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 tariff of 0.20. Note from the
listing file that this increases welfare in the domestic economy. This is the usual “optimal tariff”
argument for a large economy.
1
$TITLE
Model M48: Large open economy model: large open economy
2
3
$ONTEXT
4
Production Sectors
5
Consumer
6
7
8
9
10
11
12
13
14
15
16
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
----------------------------------------------------------------
17
18
$OFFTEXT
19
77
20
21
PARAMETER
TM2
Import tariff for good;
22
23
TM2 = 0;
24
25
$ONTEXT
26
27
$MODEL:M48
28
29
30
31
32
33
34
35
36
$SECTORS:
X1
X2
E1
E2
M1
M2
W
!
!
!
!
!
!
!
Production index for good 1
Production index good 2
Export index of good 1
Export index of good 2
Import level of good 1
Import level of good 2
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
PR
!
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
Rent which generates the export demand function
$CONSUMERS:
CONSH
CONSF
! Income level for representative home agent
! Income level for representative foreign agent
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:150
Q:100
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:50
Q:20
Q:30
$PROD:E1 s:1
O:PFX
I:P1
I:PR
Q:100
Q: 50
Q: 50
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$PROD:M2
67
68
O:P2
I:PFX
Q:50
Q:50
O:PFX
I:P2
Q:(50*0.99)
Q:50
O:P1
I:PFX
Q:50
Q:(100*1.01)
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
Q:100
A:CONSH
T:TM2
69
70
$PROD:E2
71
72
73
74
$PROD:M1
75
76
77
78
79
80
81
$PROD:W
82
83
$DEMAND:CONSH
78
D:PW
E:PL
E:PK
84
85
86
Q:200
Q:120
Q: 80
87
88
89
90
$DEMAND:CONSF
D:PFX
E:PR
Q:50
Q:50
91
92
93
$OFFTEXT
$SYSINCLUDE mpsgeset M48
94
95
96
E2.L = 0;
M1.L = 0;
97
98
99
100
101
M48.ITERLIM = 0;
$INCLUDE M48.GEN
SOLVE M48 USING MCP;
M48.ITERLIM = 2000;
102
103
104
*
*
Apply a tariff which improves the terms of trade and home
welfare:
105
106
TM2 = 0.05;
107
108
109
$INCLUDE M48.GEN
SOLVE M48 USING MCP;
Exercises:
(1) Compute the relationship between welfare and tariff rate for different 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 tariff 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 generalequilibrium 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
2
3
4
5
6
7
8
XHH
PXH 150
PYH
PXF
PYF
PWH
PWF
PLH -120
79
YHH
XHF
-50
YHF
XFF
YFF
50
50
XFH
YFH
WH
-100
50 -100
WF
-50
-100
-100
50
150
200
CONSH CONSF
-200
200
-10
-200
130
9
10
11
PKH
PLF
PKF
-30
-40
70
-40 -30
-10 -120
70
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 first allow country H to impose a tariff of 25% and then both
countries impose symmetric tariffs 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
10
11
12
13
14
15
16
17
18
PXH 150
PYH
PXF
PYF
PWH
PWF
PLH -120
PKH -30
PLF
PKF
-50
-100
50 -100
50
50
50
150
-100
-100
-50
200
-200
200
-10
-40
-200
130
70
-40 -30
-10 -120
70
130
19
20
$OFFTEXT
21
22
23
24
PARAMETERS
TARH
TARF;
25
26
27
TARH = 0;
TARF = 0;
28
29
$ONTEXT
30
31
$MODEL:M49
32
33
34
35
36
37
38
39
40
41
42
43
$SECTORS:
WH
WF
XHH
YHH
XHF
YHF
XFF
YFF
XFH
YFH
44
45
$COMMODITIES:
80
PWH
PWF
PXH
PXF
PYH
PYF
PLH
PLF
PKH
PKF
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$CONSUMERS:
CONSH
CONSF
60
61
62
63
64
$PROD:XHH s:1
O:PXH
I:PLH
I:PKH
Q:150
Q:120
Q: 30
$PROD:YHH s:1
O:PYH
I:PLH
I:PKH
Q:50
Q:10
Q:40
$PROD:XFF s:1
O:PXF
I:PLF
I:PKF
Q:50
Q:40
Q:10
$PROD:YFF s:1
O:PYF
I:PLF
I:PKF
Q:150
Q: 30
Q:120
$PROD:XHF
O:PXF
I:PXH
Q:50
Q:50
$PROD:YHF
O:PYF
I:PYH
Q:50
Q:50.1
$PROD:XFH
O:PXH
I:PXF
Q:50
Q:50.1
$PROD:YFH
O:PYH
I:PYF
Q:50
Q:50
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
A:CONSF
T:TARF
A:CONSH
T:TARH
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
$PROD:WH
s:1
O:PWH
I:PXH
I:PYH
Q:200
Q:100
Q:100
s:1
O:PWF
I:PXF
I:PYF
Q:200
Q:100
Q:100
$DEMAND:CONSH
D:PWH
Q:200
99
100
101
102
103
$PROD:WF
104
105
106
107
108
109
81
E:PLH
E:PKH
Q:130
Q: 70
$DEMAND:CONSF
D:PWF
E:PLF
E:PKF
Q:200
Q: 70
Q:130
110
111
112
113
114
115
116
117
118
119
120
$OFFTEXT
$SYSINCLUDE mpsgeset M49
121
YHF.L = 0.; XFH.L = 0.;
122
123
124
125
$INCLUDE M49.GEN
SOLVE M49 USING MCP;
126
127
*
TARIFFS
128
129
TARH = .25;
130
131
132
$INCLUDE M49.GEN
SOLVE M49 USING MCP;
133
134
135
TARH = .25;
TARF = .25;
136
137
138
$INCLUDE M49.GEN
SOLVE M49 USING MCP;
Exercise:
Verify the Stolper-Samuelson theorem by comparing factor prices in free trade versus when one or
both countries have tariffs.
3.3.18
International capital flows (M410)
Another important feature of economies and also an important policy issue is capital flows 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-perfectlyelastic supply of capital to the country. Once again, we create a fictitious factor R (price PR) which
is a fixed factor in a function (KM) transforming foreign exchange into capital and that fictitious
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
I:PFX
I:PR
Q:20
Q:10
Q:10
The counterfactual experiment is to impose a 5% tariff. 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 tariff
but fix 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
tariff protecting a capital intensive sector have a secondary, negative welfare effect. 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
Production Sectors
5
Consumer
6
7
8
9
10
11
12
13
14
15
16
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
PFX
|
70
-50
-10
-10
PR
|
-10
10
----------------------------------------------------------------
17
18
$OFFTEXT
19
20
21
PARAMETER
TM2
Import tariff for good X2;
22
23
TM2 = 0;
24
25
$ONTEXT
26
27
$MODEL:M410
28
29
30
31
32
33
$SECTORS:
X1
X2
E1
E2
83
!
!
!
!
Production index for good 1
Production index good 2
Export index of good 1
Export index of good 2
M1
M2
KM
W
!
!
!
!
Import level of good 1
Import level of good 2
Capital imports
Welfare index
$COMMODITIES:
P1
P2
PFX
PW
PL
PK
PR
!
!
!
!
!
!
!
Price index for good 1
Price index for good 1
Read exchange rate index
Welfare price index
Wage index
Capital rental index
Rent which generates concavity in capital supply
$CONSUMERS:
CONSH
CONSF
! Income level for representative home agent
! Income level for representative foreign agent
$PROD:X1 s:1
O:P1
I:PL
I:PK
Q:170
Q:120
Q: 50
$PROD:X2 s:1
O:P2
I:PL
I:PK
Q:50
Q:20
Q:30
$PROD:E1 s:1
O:PFX
I:P1
Q:70
Q:70
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$PROD:M2
67
68
O:P2
I:PFX
Q:50
Q:50
O:PFX
I:P2
Q:(50*0.99)
Q:50
O:P1
I:PFX
Q:50
Q:(100*1.01)
A:CONSH
T:TM2
69
70
$PROD:E2
71
72
73
74
$PROD:M1
75
76
77
78
79
80
81
$PROD:KM s:1
O:PK
I:PFX
I:PR
Q:20
Q:10
Q:10
82
83
$PROD:W
84
85
86
s:1
O:PW
I:P1
I:P2
Q:200
Q:100
Q:100
87
88
89
90
91
$DEMAND:CONSH
D:PW
E:PL
E:PK
Q:200
Q:140
Q:60
$DEMAND:CONSF
D:PFX
E:PR
Q:10
Q:10
92
93
94
95
96
97
$OFFTEXT
84
98
$SYSINCLUDE mpsgeset M410
99
100
101
E2.L = 0;
M1.L = 0;
102
103
PW.FX = 1;
104
105
106
107
108
M410.ITERLIM = 0;
$INCLUDE M410.GEN
SOLVE M410 USING MCP;
M410.ITERLIM = 2000;
109
110
111
TM2 = 0.05;
112
113
114
$INCLUDE M410.GEN
SOLVE M410 USING MCP;
115
116
KM.FX = 1;
117
118
119
$INCLUDE M410.GEN
SOLVE M410 USING MCP;
3.4
3.4.1
Modeling Consumer Demand with MPSGE
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 ”nonalgebraic” – so function specification depends on an intuitive understanding of the underlying economic structure.
Consider Figure 5 and focus on a single point, x=1, y=1. There is an indifference 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 specification 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 indifference curves. Benchmark prices fix the
slope of the indifference curve at that point, and the elasticity describes the curvature of the indifference 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 figure shows three indifference curves all of which share the same benchmark quantities and
benchmark prices. They differ only in the elasticities of substitution. The least convex (flattest)
curve has the highest elasticity, the most convex curve has the lowest elasticity. (When the elasticity
of substitution is 0, the indifference 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 consumer’s 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 file.
A MPSGE model specification is always listed between $ONTEXT and $OFFTEXT statements. The
first 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
6
7
8
*
*
*
*
The model specification begins by declaring variables for the model.
In a standard model, there are three types of variables: commodity
prices, sectoral activity levels, and consumer incomes. The end of
each line may include "! variable description ".
*
*
*
*
N.B. The variables associated with commodities are prices, not
quantities. (In this and subsequent models, I use P as the first
letter for each of the commodity variables to remind us that these
variables are prices.)
9
10
11
12
13
14
15
16
* N.B. The variable associated with a consumer is an income level, not
* a welfare index.
17
18
19
20
$SECTORS:
X
Y
! ACTIVITY LEVEL FOR X = DEMAND FOR GOOD X
! ACTIVITY LEVEL FOR Y = DEMAND FOR GOOD Y
$COMMODITIES:
PX
PY
PL
! PRICE OF X WHICH WILL EQUAL PL
! PRICE OF Y WHICH WILL EQUAL 2 PL
! PRICE OF THE ARTIFICIAL FACTOR L
$CONSUMERS:
RA
! REPRESENTATIVE AGENT INCOME
21
22
23
24
25
26
27
28
29
30
31
32
33
*
*
*
*
Function specifications follow the variable declarations. In this
model, our first declarations correspond to the two production
sectors. In this model, the production structures are particularly
simple. Each of the sectors has one input and one output. In the MPSGE
86
34
35
36
37
*
*
*
*
syntax, I: denotes an input and O: denotes an output. The output
quantity coefficients for both sectors are unity (Q:1). This means
that the level values for x and y correspond to the actual quantities
produced.
*
*
*
*
*
The final function specified in the model represents the utility
function and endowments for our single consumer. In this function, the
E: entries correspond to endowments and the D: entries are demands.
Reference demands, reference prices and the substitution elasticity
(s:1) characterize preferences.
38
39
40
41
42
43
44
45
46
47
* The demand entries shown here are consistent with a Cobb-Douglas
* utility function in which the budget share for y is twice the budget
* share for x (i.e. the MRS at (1,1) equals 1/2):
48
49
50
51
$PROD:X
O:PX
I:PL
Q:1
Q:1
$PROD:Y
O:PY
I:PL
Q:1
Q:2
$DEMAND:RA
E:PL
D:PX
D:PY
s:1
Q:120
Q:1
P:(1/2)
Q:1
P:1
52
53
54
55
56
57
58
59
60
61
62
$OFFTEXT
63
64
65
* The final three statements in this file invoke the MPSGE
* preprocessor, "generate" and solve the model:
66
67
$SYSINCLUDE mpsgeset DEMAND
68
69
70
$INCLUDE DEMAND.GEN
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 produced 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 file and execute the program
with GAMS/MPSGE.
This is possibly the first GAMS model which some readers have solved, so it is worth looking through
the listing file in some detail. After running the solver, we examine the listing file. I typically begin
my assessment of a model’s solution by searching for “STATUS”. For this model, we have the following:
S O L V E
MODEL
TYPE
SOLVER
DEMAND
MCP
PATH
**** SOLVER STATUS
**** MODEL STATUS
87
S U M M A R Y
FROM LINE
1 NORMAL COMPLETION
1 OPTIMAL
263
RESOURCE USAGE, LIMIT
ITERATION COUNT, LIMIT
EVALUATION ERRORS
1.432
5
0
Work space allocated
--
1000.000
1000
0
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
effect. (You can modify these values with the statements:
model.RESLIM =
model.ITERLIM =
number of cpu seconds ;
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 final message, “Default price normalization...”, is significant. 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 specification of a
numeraire commodity. You can do this for an MPSGE model by “fixing” a price, with a statement
like:
PX.FX = 1;
entered following the model declaration ($SYSINCLUDE mpsgeset) but prior to the solver invocation. When any price or income level is fixed, MPSGE recognizes that a numeraire has been specified
and does no automatic normalization.
Following some output from the solver (PATH in this case), the listing file provides a complete
report of equilibrium values. With MPSGE models, the equation listings are superfluous. The
variable listings provide all the relevant information.
For this model, the solution listing appears as follows:
88
-------------------
VAR
VAR
VAR
VAR
VAR
VAR
X
Y
PX
PY
PL
RA
X
Y
PX
PY
PL
RA
LOWER
.
.
.
.
.
.
LEVEL
40.000
40.000
1.000
2.000
1.000
120.000
UPPER
+INF
+INF
+INF
+INF
+INF
+INF
MARGINAL
.
.
.
.
.
.
SUPPLY AND DEMAND OF GOOD X
SUPPLY AND DEMAND OF GOOD Y
PRICE OF X WHICH WILL EQUAL CX * PL
PRICE OF Y WHICH WILL EQUAL CY * PL
PRICE OF THE ARTIFICIAL FACTOR L
REPRESENTATIVE AGENT INCOME
The LOWER and UPPER columns report variable bounds applied in the model. In these columns,
zero is represented by “.” and infinity 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 specification of labor inputs.
Exercises:
(a) The utility function calibration point is arbitrary. Here, we have selected x=y=1 as the reference quantity. Revise the program to use a different calibration point where x=2 and y=1, where
MRS(2,1) = 1/4. (Remember to modify both the Q: and P: fields.) 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: coefficient 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: field for sector X.
(c) Compute an equilibrium in which commodity y is defined 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, final 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 first two of these to unity. The MRS parameter is
assigned a value following the solution of the model.
SCALAR
X
Y
MRS
QUANTITY OF X FOR WHICH THE MRS IS TO BE EVALUATED /1/
QUANTITY OF Y FOR WHICH THE MRS IS TO BE EVALUATED /1/
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
7
8
$COMMODITIES:
PX
! PRICE INDEX FOR GOOD X
PY
! PRICE INDEX FOR GOOD Y
9
10
11
$CONSUMERS:
RA
! REPRESENTATIVE AGENT
12
13
14
15
16
17
18
19
$DEMAND:RA
D:PX
D:PY
E:PX
E:PY
$OFFTEXT
$SYSINCLUDE
s:1
Q:1
Q:1
Q:X
Q:Y
P:(1/4)
P:1
mpsgeset MRSCAL
20
21
22
$INCLUDE MRSCAL.GEN
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 file 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:
M RS = 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 = LP RODLS
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
CX
CY
3
4
5
AGGREGATE LABOR PRODUCTIVITY /1/,
COST OF X AT BASE YEAR PRODUCTIVITY /1/,
COST OF Y AT BASE YEAR PRODUCTIVITY /1/;
$ONTEXT
6
7
$MODEL:LSUPPLY
8
9
10
11
12
$SECTORS:
X
Y
LS
! SUPPLY=DEMAND FOR X
! SUPPLY=DEMAND FOR Y
! LABOR SUPPLY
$COMMODITIES:
PX
PY
PL
PLS
!
!
!
!
$CONSUMERS:
RA
! REPRESENTATIVE AGENT
13
14
15
16
17
18
MARKET PRICE OF GOOD X
MARKET PRICE OF GOOD Y
MARKET WAGE
CONSUMER VALUE OF LEISURE
19
20
21
22
23
$PROD:LS
24
25
O:PL
I:PLS
Q:LPROD
Q:1
O:PX
I:PL
Q:1
Q:CX
O:PY
I:PL
Q:1
Q:CY
26
27
$PROD:X
28
29
30
31
$PROD:Y
32
33
34
35
$DEMAND:RA
91
s:1
E:PLS
D:PLS
D:PX
D:PY
36
37
38
39
Q:120
Q:1
Q:1
Q:1
P:1
P:1
P:1
40
41
42
$OFFTEXT
$SYSINCLUDE mpsgeset LSUPPLY
43
44
45
$INCLUDE LSUPPLY.GEN
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
49
50
SCALAR
LS0
ELS
REFERENCE LEVEL OF LABOR SUPPLY
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
56
57
LPROD = 1.01;
$INCLUDE LSUPPLY.GEN
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
61
ELS = 100 * (LS.L - LS0) / LS0;
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 consumer’s 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 effect exactly balance out and the supply of labor is unchanged.
92
Exercises:
(a) One way in which the labor supply elasticity might differ from zero in a model with Cobb-Douglas
final 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 final demand. Modify the program to include SIGMA
as a scalar, and find 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 effects, through which changes in the market for one good may influence
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 indifference 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 beneficial. 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-efficient allocation, a state of affairs
in which further mutually-beneficial 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 significant welfare increase for one consumer while have
negligible impact on the other.
* There are multiple Pareto-efficient allocations, typically only one of which is a competitive equilibrium. We can use this model to demonstrate that the issues of efficiency 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
3
4
5
6
7
XA
YA
THETA_A
THETA_B
SIGMA_A
SIGMA_B
AGENT
AGENT
AGENT
AGENT
AGENT
AGENT
A
A
A
B
A
B
ENDOWMENT OF X ( 0 < XA < 1)
ENDOWMENT OF Y ( 0 < YA < 1)
DEMAND SHARE PARAMETER FOR X
DEMAND SHARE PARAMETER FOR X
ELASTICITY PARAMETER
ELASTICITY PARAMETER
/0.2/
/0.8/
/0.5/
/0.8/
/2.0/
/0.5/;
8
This model is actually simpler than the models presented above because we have no need for production. There are simply two commodities and two consumers. The consumers differ 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 coefficients. See, for example, Q:(1-THETA A)
in the $DEMAND:A block. Any numeric input field in an MPSGE model may be “computed”,
provided that the algebraic expression is enclosed within parentheses and legitimate GAMS code.
This model specification uses the default values for reference prices in the demand function blocks.
When P:value is not specified 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
7
8
$COMMODITIES:
PX
! EXCHANGE PRICE OF GOOD X
PY
! EXCHANGE PRICE OF GOOD Y
9
10
11
12
$CONSUMERS:
A
! CONSUMER A
B
! CONSUMER B
13
14
15
16
17
$DEMAND:A s:SIGMA_A
E:PX Q:XA
E:PY Q:YA
D:PX Q:THETA_A
94
D:PY
18
Q:(1-THETA_A)
19
20
21
22
23
24
$DEMAND:B s:SIGMA_B
E:PX Q:(1-XA)
E:PY Q:(1-YA)
D:PX Q:THETA_B
D:PY Q:(1-THETA_B)
25
26
27
$OFFTEXT
$SYSINCLUDE mpsgeset EXCHANGE
28
29
30
$INCLUDE EXCHANGE.GEN
SOLVE EXCHANGE USING MCP;
31
32
SCALAR
PRATIO
IRATIO
33
34
EQUILIBRIUM PRICE OF X IN TERMS OF Y,
EQUILIBRIUM RATIO OF CONSUMER A INCOME TO CONSUMER B INCOME;
35
36
37
PRATIO = PX.L / PY.L;
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 final step, we compute an alternative efficient 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 fixed, the equilibrium remains efficient, but the connection between market
prices and endowment income is eliminated.
In GAMS/MPSGE a variable may be fixed using the GAMS syntax
variable.fx= value;
as illustrated in this model:
1
2
3
4
5
A.FX = 1;
B.FX = 1;
$INCLUDE EXCHANGE.GEN
SOLVE EXCHANGE USING MCP;
6
7
SCALAR
TRANSFER
IMPLIED TRANSFER FROM A TO B AS A PERCENTAGE OF INCOME;
8
9
10
TRANSFER = 100 * ( A.L - PX.L * XA - PY.L * YA ); PRATIO = PX.L / PY.L;
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 efficiency locus. Draw the
Edgeworth box diagram which is consistent with these values.
3.4.5
Import Tariffs 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 technologies. 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 tariffs which apply on imports to each of the regions.
1
2
SCALAR
3
4
5
6
7
8
9
XA
YA
THETA_A
THETA_B
SIGMA_A
SIGMA_B
T_A
T_B
AGENT A ENDOWMENT OF X ( 0 le XA le 1)
AGENT A ENDOWMENT OF Y ( 0 le YA le 1)
AGENT A DEMAND SHARE PARAMETER FOR X
AGENT B DEMAND SHARE PARAMETER FOR X
AGENT A ELASTICITY PARAMETER
AGENT B ELASTICITY PARAMETER
AD-VALOREM TARIFF ON IMPORTS TO AGENT A
AD-VALOREM TARIFF ON IMPORTS TO AGENT B
/0.2/
/0.8/
/0.4/
/0.6/
/1.0/
/1.0/,
/0.10/
/0.10/;
10
The program differs from the previous example in several respects. First, we introduce a separate
commodity price for each agent. In the absence of tariffs, these prices are identical.
A second difference 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 flows 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
7
8
9
10
$SECTORS:
MXA
MXB
MYA
MYB
!
!
!
!
$COMMODITIES:
PXA
! PRICE OF GOOD X FOR AGENT A
TRADE
TRADE
TRADE
TRADE
IN
IN
IN
IN
X
X
Y
Y
FROM
FROM
FROM
FROM
B
A
B
A
TO
TO
TO
TO
A
B
A
B
11
12
13
14
96
PYA
PXB
PYB
15
16
17
! PRICE OF GOOD Y FOR AGENT A
! PRICE OF GOOD X FOR AGENT B
! PRICE OF GOOD Y FOR AGENT B
18
19
20
21
$CONSUMERS:
A
B
! CONSUMER A
! CONSUMER B
22
23
24
25
26
27
$DEMAND:A s:SIGMA_A
E:PXA
Q:XA
E:PYA
Q:YA
D:PXA
Q:THETA_A
D:PYA
Q:(1-THETA_A)
28
29
30
31
32
33
$DEMAND:B s:SIGMA_B
E:PXB
Q:(1-XA)
E:PYB
Q:(1-YA)
D:PXB
Q:THETA_B
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 specification of an ad-valorem tax.
Adding a tax requires two new fields. The first is “A:” which specifies the tax agent, a consumer
who collects the tax revenue as part of income. The second is “T:” which specifies the ad- valorem
tax rate.
MPSGE permits taxes to applied on production inputs and outputs but it does not permit taxes on
final 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
tariff rate.
1
2
3
4
$PROD:MXA
O:PXA Q:1
I:PXB Q:1
A:A
T:T_A
$PROD:MXB
O:PXB Q:1
I:PXA Q:1
A:B
T:T_B
$PROD:MYA
O:PYA Q:1
I:PYB Q:1
A:A
T:T_A
$PROD:MYB
O:PYB Q:1
I:PYA Q:1
A:B
T:T_B
5
6
7
8
9
10
11
12
13
14
15
16
17
The final portions of the file 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, tariff-ridden equilibrium in order to compute the benchmark welfare levels. We
then set all tariffs to zero and compute the free-trade equilibrium. Using the final welfare indices
and the saved values of the benchmark welfare levels, we are able to report the change in welfare
from removing tariff distortions.
1
2
3
4
$REPORT:
V:WA
V:WB
W:A
W:B
5
6
7
$OFFTEXT
$SYSINCLUDE mpsgeset TARIFFS
8
9
10
$INCLUDE TARIFFS.GEN
SOLVE TARIFFS USING MCP;
11
12
SCALAR
WA0
WB0
13
14
BENCHMARK WELFARE INDEX FOR AGENT A
BENCHMARK WELFARE INDEX FOR AGENT B;
15
16
17
18
19
WA0
WB0
T_A
T_B
=
=
=
=
WA.L;
WB.L;
0;
0;
20
21
22
$INCLUDE TARIFFS.GEN
SOLVE TARIFFS USING MCP;
23
24
25
26
SCALAR
EVA
EVB
HICKSIAN EQUIVALENT VARIATION FOR AGENT A
HICKSIAN EQUIVALENT VARIATION FOR AGENT B;
27
28
29
30
EVA = 100 * (WA.L-WA0)/WA0;
EVB = 100 * (WB.L-WB0)/WB0;
DISPLAY EVA, EVB;
31
Exercises:
(a) Find the “optimal tariff” in this model for agent A, assuming that agent B does not retaliate
and leaves her tariff rate at the benchmark level.
(b) Insert the endowment and preference parameters from the previous problem, retaining the same
“benchmark” tariff rates. Does free trade benefit both countries? If not, why not?
98
4.
4.1
MPSGE Syntax
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 defined at the head
of a program, but it is convenient to do so. A key advantage conferred by GAMS is that
the definitions of sets are separable from the definition 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 definitions. GAMS statements such as PARAMETER
or TABLE may be used to define numeric data structdures. Alternatively, data may be read from
external sources, such as Excel files. It is common that some model input may be computed
using GAMSálgebraic syntax.
3. MPSGE Model Definition The MPSGE model definition 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 field is the $model statement which defines 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 defines the MPSGE model. (When two or more models are defined in a single
program, each must have its own mpsgeset statement.)
5. Scenario definition and solution. This part of the program involves assignment of parameter 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 complementarity 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 figures.
4.2
MPSGE Basic Syntax Rules
The following rules apply the the statements which define 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 significant. Continuation lines are indicated by a “+” in column 1.
• Text is not case sensitive.
• Numeric fields may be specified as computed values using expressions involving GAMS parameters 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 identifier to the present model. This must be the first
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 identifier and a valid file name. This name
is used to form modelID.GEN. (This file name must be upper case when running under Linux
or UNIX).
$SECTORS:, $COMMODITIES:, $AUXILIARY:, $CONSUMERS: These four keywords define the variables which are used to define 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 define technology and
taxes for a particular activity.
$DEMAND:consumer This statement indicates the start of a set of records which define initial endowments 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 define GAMS variables through
which MPSGE returns producer inputs, producer outputs and/or consumer demand. The
variables defined in $REPORT blocks may not be used in model equations.
$CONSTRAINT:auxiliary This statement specifies the equilibrium condition which is to be associated with a particular auxiliary variable. Equilibrium conditions are written following the
conventional rules for expressing equations in GAMS. An auxiliary constraint may include variables 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
specific role in a model. The four MPSGE keywords $SECTORS:, $COMMODITIES:, $CONSUMERS: and
100
$AUXILIARY: therefore refer to the four different types of unknowns which may appear in a general
equilibrium model.
When variables are defined according to their classification 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)
K(T)
I0
! Output in region R in period T
! "Aggregate capital stock, period T"
! Base year investment
One difference between VARIABLE declarations in GAMS and variable declarations in MPSGE is that
in the MPSGE syntax trailing comments (signified 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)
K(T)
I0
Output in region R in period T
"Aggregate capital stock, period T"
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 largedimensional 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, multisectoral, 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 define 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)
RK(i,r,t)$IX(i,r,t)
...
! Output prices
! 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 analysis 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 specified, it must be the second field, immediately
following I: or O:.
P: Reference price. The default value of the reference price is 1.
A: Tax revenue agent. This field must be followed by a consumer name.
T: Tax rate field identifier. (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 identifiers 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 0 (x̄)(x − x̄) + (x − x̄)
∇f (x)|x=x̄
(x − x̄) + o(x − x̄)3
2
The intercept term, f (x̄), corresponds to the values which appear in the Q: fields – 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 0 (x̄), corresponds to values in the P: fields. 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 specific 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)
O:P(r)
I:W(f,r)
s:1
Q:y0(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 substitution between inputs is one, as indicated by “s:1” in the first line. The s: field in a $PROD
block relates the top level substitution.
The O: label indicates an output, and the I: label indicates an input. The Q: fields in both records
represent “reference quantities”. The P: field 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
defines 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
x
sum(f, w0(f,r) * x(f,r))
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 difficulty is that as the form or nesting structure of the production function change, so too
does the number of assigned values of the function coefficients.
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
I:PY(g)
I:PL
I:PK
Q:x0
Q:yx0(g)
Q:lx0
Q:kx0
id:
P:pl0
P:pk0
va:
va:
This production function can be portrayed graphically using a nesting diagram:
I:PX Q:x0
@
s:esub@
@
id:0
@ va:esub/5
@
@
@
@
@
@
@
I:PY(g) Q:yx0(g)
I:PL Q:lx0 P:pl0
I:PK Q:kx0 P:pk0
The first record in the $PROD block contains the nest identifier for top level inputs (a reserved name),
s:. The record introduces two new nest identifiers, a: and va:. These nest identifiers are arbitrary
names with up to four characters. The nest identifier 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 fixed 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:
1/ρ
ρ/γ
x = f (y, K, L) = φ α min(yg )ρ + (1 − α) (βLγ + (1 − β)K γ )
g
In this function ρ = 1-1/esub and γ =1-5/esub. The share parameters, in the function, α and β
could be defined on the basis of data in the $PROD block, but their values are messy and difficult 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
subject to
PL * L + PK * K + SUM(g, PY(g) * y(g))
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 find
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:
h
i1/ρ
yg
β 1−β ρ
1− ρ
+ (1 − α) yE yN
X = min min( ), δ α K L
ag
g ∈E
/
in which electric and nonelectric energy form the set E{E, N }.
The nesting tree is define 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 identifier, 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
O:PX
I:P(g)
I:PL
I:PK
s:esub id:0 e:sigma kl(e):1 en(e):1
Q:x0
Q:yx0(g) id:$(not en(g)) en:$en(g)
Q:lx0
P:pl0 kl:
Q:kx0
P:pk0 kl:
Here is a graphical representation of the MPSGE function as a nesting tree:
O:PX Q:x0
id:0
@
@
@
I:P(g) Q:yx0(g)
∀g ∈
/ {E, N }
4.5.5
@
s:0 @
@
@
@
@
e:sigma
@
@
@
@
@
kl:1@
en:1 @
@
@
I:PK Q:kx0
I:PL Q:lx0
I:P("N") Q:yx0("N")
I:P("E") Q:yx0("E")
$PROD Block – Joint Outputs
The following production function describes a production function which produces goods D and E
as joint products:
106
$PROD:E
O:PD
O:PE
I:PY
t:eta
Q:d0
Q:e0
Q:y0
P:pd0
P:pe0
The first record in this $PROD block specifies 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) = φ(αD1+η + (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:
φ = ȳ αD̄1+η + (1 − α)Ē 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 fields related to ad-valorem taxes:
A: Tax revenue agent. This field must reference a consumer name.
T: Tax rate field identifier. (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 specified prior to a T: or N: field. One important extremely
valuable sevice provided by MPSGE is that taxes may not be applied without consistent accounting 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 fields may be introduced on a single input with revenue accruing to different 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 fields, labelled N: and M:. The N: field identifies
the auxiliary variable which is proportional to the tax rate, and the M: field 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 fields relating to proportional taxes:
A: Tax revenue agent. Must be followed by a consumer name.
T: Tax rate field identifier. (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 specified prior to a T: or N: field.
• If revenue from a particular tax is to be paid to more than one consumer, then two (or more)
tax fields 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 fields, labelled N: and M:. The N: field identifies
the auxiliary variable which is proportional to the tax rate, and the M: field 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 define 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 fixed, 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 effect” which is commonly part of technical change. Car engines get more efficient
with the introduction of CAFE standards, so people drive more and gasoline demand is virtually
unaffected. Economic effects 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 consumers. These blocks effectively characterize final 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 final 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
flows 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 specifice, the Q: field must be the second
field in the record, follow immediately after the D: field.
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 field (T:) is
not recognized in a D: record :
$DEMAND:HH
D:P(g)
E:W(f)
Q:c0(g) P:pc0(g)
Q:e0(f)
A:GOVT T:tc(g)
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
I:P(g)
$DEMAND:HH
D:PU
E:W(f)
Q:u0
Q:c0(g) P:pc0(g)
A:GOVT T:tc(g)
Q:e0(f)
in which u0 = SUM(g, c0(g)*pc0(g)).
4.5.11
Classical Unemployment with Rationed Endoments
The R: field is only used in an endowment record. The R: field 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
E:PL
E:RK
Q:c0
Q:l0
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
E:PL
E:PL
E:RK
Q:c0
Q:l0
Q:(-l0) R:U
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 final consumption) remains fixed 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 associated 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 equilibrium 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 demands 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
V:variable
V:variable
V:variable
name
name
name
name
I:commodity
O:commodity
D:commodity
W:consumer
PROD:sector
PROD:sector
DEMAND:consumer
The first 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)
V:DK(S)
V:SX(G,S)$SX0(G,S)
V:D(G,H)
V:W(H)
I:PF("L")
I:PF("K")
O:PX(G)
D:P(G)
W:RA(H)
PROD:Y(S)
PROD:Y(S)
PROD:X(S)
DEMAND:RA(H)
Note that the “$” exception is only meaninful on the first 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 file. 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 specified within the vector-syntax model specification or using the PUT facility, they can be written directly to the MPS input file. Output switches
control the level of debug output written by the MPSGE subsystem to the solver status file. Reports
provided by $ECHOP, $FUNLOG and $DATECH can be returned to the listing file 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 file to the solver status file. In order to
have this output printed in the listing file, 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 Euler’s 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 Walras’s 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 coefficients. The information provide is sufficient 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 Coefficient ”type” with the following interpretation:
IA
Input aggregate
OA
Output aggregate
I
Input
O
Output
D
Demand
E
Endowment
N Name (either nest identifier or commodity name)
PBAR Benchmark price (the P: field value)
P Current price (gross of tax)
QBAR Benchmark quantitity (the Q: field value)
Q Current quantity
KP Identifier for parent entry in nesting structure.
ELAS Associated elasticity (input or output aggregates only)
When $FUNLOG:.TRUE is specified, a complete report of demand and supply coefficients 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 coefficients.
MPSGE generates an analytic full first-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-finding step of the Newton algorithm. Coefficients 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 file for large models. It is
not something which is very useful for the casual user.
115
116
5.
5.1
Three Small MPSGE Models
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 specification
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 differs in two respects from the ShovenWhalley 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.
PX
PY
PK
PL
TK
TRN
117
Sectors
Consumers
---------------------------------------------------X
Y
OWNERS
WORKERS
GOVT
---------------------------------------------------100
-20
-30
-50
-10
80
-40
-30
-20
-40
60
-50
-10
60*
----------------------------------------------------20
-10
30
10
20
-30
----------------------------------------------------
* 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 flexible.
All sorts of inter-account taxes, subsidies and transfers can be represented through an appropriate
definition 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 profits 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 emphasizes 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 reflected in the row and
column sums. Columns corresponding to sectors sum to zero reflecting zero excess profit (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 identified 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 difference between Figures 1 and
2. While Figure 1 concisely represents an equilibrium for a single two-sector model, Figure 2 represents 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)
Transfers:
5.4
GREV
TRN(H)
-GREV
Extracting Data from the Social Accounts
The GAMS specification 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 constructing 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
5
6
G
F
H
GOODS AND SECTORS /X, Y/,
PRIMARY FACTORS
/K, L/,
HOUSEHOLDS
/OWNER, WORKER/;
7
8
ALIAS (S,G);
9
10
TABLE SAM(*,*)
SOCIAL ACCOUNTING MATRIX
11
12
13
14
15
16
17
18
X
Y
K
L
TK
TRN
X
100
-10
-20
-50
-20
Y
-20
80
-40
-10
-10
OWNER
-30
-40
60
WORKER
-50
-30
GOVT
60
10
20
30
-30
19
20
21
22
23
24
25
PARAMETER
A(S)
B(G,S)
C(G,H)
FD(F,S)
119
BENCHMARK OUTPUT
USE MATRIX (GOODS INPUTS BY SECTOR)
HOUSEHOLD DEMAND
FACTOR DEMAND BY SECTOR
E(F,H)
D(F,H)
T(F,S)
TRN(H)
ELAS(S)
ESUB(H)
GREV
TF(F,S)
PF(F,S)
THETA(G)
WBAR(H)
26
27
28
29
30
31
32
33
34
35
36
FACTOR ENDOWMENTS
FACTOR DEMAND BY HOUSEHOLDS
TAX PAYMENT BY FACTOR BY SECTOR
TRANSFER REVENUE
ELASTICITY OF SUBSTITUTION IN PRODUCTION
ELASTICITY OF SUBSTITUTION IN DEMAND
BENCHMARK GOVERNMENT REVENUE
FACTOR TAX RATE
BENCHMARK FACTOR PRICES GROSS OF TAX
WEIGHTS IN NUMERAIRE PRICE INDEX
BENCHMARK WELFARE INDEX;
37
38
*
EXTRACT DATA FROM THE SOCIAL ACCOUNTING MATRIX:
39
40
41
42
43
A(S)
=
C(G,H) =
E(F,H) =
T("K",S)
SAM(S,S);
-SAM(G,H);
SAM(F,H);
= -SAM("TK",S);
B(G,S) = MAX(0, -SAM(G,S));
FD(F,S) = -SAM(F,S);
D(F,H) = 0;
TRN(H) = SAM("TRN",H);
44
45
*
INSTALL "FREE" ELASTICITY PARAMETERS:
46
47
48
E("L","WORKER") = 100;
ELAS(S) = 1;
D("L","WORKER") =
ESUB(H) = 0.5;
40;
49
50
*
INSTALL FUNCTIONS OF BENCHMARK VALUES:
51
52
53
54
55
56
57
GREV
= SUM(H, TRN(H));
TF(F,S) = T(F,S) / FD(F,S);
PF(F,S) = 1 + TF(F,S);
THETA(G) = SUM(H, C(G,H));
THETA(G) = THETA(G) / SUM(S, THETA(S));
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 first line of a $PROD:
block are elasticity values. The “s:0” field indicates that the top-level elasticity of substitution
between inputs is zero (Leontief). The entry “va:ELAS(S)” indicates that inputs identified as
belonging to the “va:” aggregate trade off 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
identified as entering in the va: aggregate.
The nesting assignments within an MPSGE model can be easily modified by the assignment of inputs
to aggregates, as has been done in this model using the va: nest. This flexibility is very helpful
when testing robustness with respect to changes in the elasticity structure of a model. (A note on
syntax: nesting identifiers are limited to four characters.)
1
2
*
SECTION (ii)
MPSGE MODEL DECLARATION
120
3
4
$ONTEXT
5
6
$MODEL:HARBERGER
7
8
9
$SECTORS:
AL(S)
10
11
12
$COMMODITIES:
P(G) W(F)
PT
13
14
15
$CONSUMERS:
RA(H) GOVT
16
17
18
19
20
$PROD:AL(S) s:0
O:P(S)
I:P(G)
I:W(F)
va:ELAS(S)
Q:A(S)
Q:B(G,S)
Q:FD(F,S)
$DEMAND:RA(H)
D:P(G)
D:W(F)
E:W(F)
E:PT
gds:ESUB(H)
Q:C(G,H)
gds:
Q:D(F,H)
Q:E(F,H)
Q:TRN(H)
P:PF(F,S)
A:GOVT
T:TF(F,S)
va:
21
22
23
24
25
26
s:1
27
28
29
$DEMAND:GOVT
D:PT
Q:GREV
30
31
$REPORT:
V:CD(G,H)
V:DF(F,H)
V:EMPLOY(S)
V:WLF(H)
32
33
34
35
D:P(G)
D:W(F)
I:W("L")
W:RA(H)
DEMAND:RA(H)
DEMAND:RA(H)
PROD:AL(S)
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
49
50
51
52
53
HARBERGER.ITERLIM = 0;
$INCLUDE HARBERGER.GEN
SOLVE HARBERGER USING MCP;
ABORT$(ABS(HARBERGER.OBJVAL) GT 1.E-4)
"*** HARBERGER benchmark does not calibrate.";
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 field” indicating a reference
input or output level of the named commodity. A “P:” signifies a reference price field. 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: field is missing).
121
The va: and T: fields in a $PROD: block indicate tax agent and ad-valorem tax rate, respectively.
The tax agent is specified before the tax rate. A single input or output coefficient 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: field but it will not change the P: field. Q: and P: characterize a reference equilibrium point,
and these are therefore unaffected 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 coefficient, O:P(S), refers only to set S. Sets referenced within
a commodity name in an I: or O: field 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 first line of a $DEMAND block also contains fields (e.g., s:, gds:, cl: etc.) which represent
elasticities of substitution. The subsequent records may begin with either an E: field or a D: field.
These, respectively, represent commodity endowments and demands. In the demand fields, the P:
and Q: entries are interpreted as reference price and reference quantity, analogous to the input fields
in a $PROD block. Ad-valorem taxes may not be applied on final demands, so that if consumption
taxes are to be applied in a model they must be levied on production activities upstream of the final
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: fields directly from the benchmark data. An
equivalent model could be specified in which the benchmark activity levels for AL(S) equal, for
example, A(S,S). This would then require rescaling the input and output coefficients for those
sectors, and it would not necessarily be helpful, because in a scaled model it is more difficult to
verify consistency of the benchmark accounts and MPSGE input file. 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 “artificial commodity”
(PT). The government is identified 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 artificial 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 file requests the solution system to return values for inputs, outputs,
final demands or welfare indices at the equilibrium. Only those items which are requested will be
written to the solution file. Each record in the report block begins with a V: (variable name) field.
These names must be distinct from all other names in the model. The second field 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 field’s 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 misunderstood 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 fields in the $PROD:
block alters the technology. If, for example, a tax rate changes as part of a counter-factual experiment, this has no effect on the reference price. The value in the P: field depends on the benchmark
value of the T: field if the model has been calibrated, but subsequent changes in T: do not change
the underlying technology.
(ii) Tax rates are interpreted differently for inputs and outputs. The tax rate on inputs is specified
on a net basis, while the tax rate on outputs is specified 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 artificial 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 specifies and solves three counterfactual equilibria. In these experiments, 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 effects). 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
5
6
7
SET SC COUNTERFACTUAL SCENARIOS TO BE COMPUTED /
UNIF_L
UNIFORM TAX ON LABOR,
UNIF_K
UNIFORM TAX ON CAPITAL,
UNIF_VA UNIFORM VALUE-ADDED TAX/
8
9
PARAMETER
10
11
TAXRATE(F,S,SC) COUNTERFACTUAL TAX RATES,
REPORT(*,*,*,SC) SOLUTION REPORT - % CHANGES,
PINDEX
PRICE DEFLATOR;
12
13
14
15
*
*
SPECIFY COUNTER-FACTUAL TAX RATES TO ACHIEVE CETERIS
PARIBUS BALANCED BUDGET:
16
17
18
19
TAXRATE("L",S,"UNIF_L") = GREV / SUM(G, FD("L",G));
TAXRATE("K",S,"UNIF_K") = GREV / SUM(G, FD("K",G));
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
TF(F,S) = TAXRATE(F,S,SC);
26
27
28
29
$INCLUDE HARBERGER.GEN
SOLVE HARBERGER USING MCP;
30
31
32
*
*
-----------------------------------------------------------------SECTION (v) REPORT WRITING:
*
REPORT SOME RESULTS:
33
34
35
PINDEX = SUM(G, P.L(G) * THETA(G));
36
37
REPORT("REVENUE","_",SC) = 100 * (PT.L/PINDEX - 1);
REPORT("TAXRATE","_",SC) =
100 * SMAX((F,S), TAXRATE(F,S,SC));
REPORT("WELFARE",H,SC)
= 100 * (WLF.L(H) - 1);
REPORT("EMPLOY",S,SC)
= 100 * (EMPLOY.L(S)/FD("L",S) - 1);
REPORT("PRICE",G,SC)
= 100 * (P.L(G)/PINDEX - 1);
REPORT("PRICE",F,SC)
= 100 * (W.L(F)/PINDEX - 1);
REPORT("OUTPUT",S,SC)
= 100 * (AL.L(S) - 1);
38
39
40
41
42
43
44
45
46
47
);
DISPLAY REPORT;
5.6
Alternative Models
The “standard” MPSGE model is based on fixed endowments and tax rates, but many empirical
models do not fit into this structure. For example, in the model HARBERGER, the level of each
replacement tax was specified to be consistent with “equal yield”, but as a result of the endogenous
response of prices and quantities, the resulting tax revenues differed significantly 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 find that tax revenue in fact declines
by 39%. In order to perform differential (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 definition 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 government revenue. The auxiliary variable first appears in the $PROD:AL(S) block, following the
declaration of a tax agent. There are two fields associated with an endogenous tax. The first field
(N:) gives the name of the auxiliary variable which will scale the tax rate. The second field (M:)
specifies the multiplier. If the M: field is omitted, the multiplier assumes a default value of unity. If
the value in the M: field is zero, the tax does not apply.
The auxiliary variable TAU also appears at the bottom of the file 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 defined 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 fixed, so when the value of PT is fixed, 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 endowments. 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
6
$SECTORS:
AL(S)
7
8
9
$COMMODITIES:
P(G) W(F)
PT
10
11
12
$CONSUMERS:
RA(H) GOVT
13
14
15
$AUXILIARY:
TAU
16
17
$REPORT:
V:CD(G,H)
V:DF(F,H)
V:EMPLOY(S)
V:WLF(H)
18
19
20
21
D:P(G)
D:W(F)
I:W("L")
W:RA(H)
DEMAND:RA(H)
DEMAND:RA(H)
PROD:AL(S)
22
23
24
25
26
27
$PROD:AL(S) s:0 va:ELAS(S)
O:P(G)
Q:A(G,S)
I:P(G)
Q:B(G,S)
I:W(F)
Q:FD(F,S)
P:PF(F,S)
+
A:GOVT N:TAU$TF(F,S) M:TF(F,S)$TF(F,S) va:
28
29
30
31
32
33
$DEMAND:RA(H) s:1
D:P(G)
D:W(F)
E:W(F)
E:PT
gds:ESUB(H)
Q:C(G,H)
gds:
Q:D(F,H)
Q:E(F,H)
Q:TRN(H)
$DEMAND:GOVT
D:PT
Q:GREV
34
35
36
37
38
39
$CONSTRAINT:TAU
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 final 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 benefit) 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 finance provision of a pure public good.
This representation of government has not been widely adopted in the CGE literature, perhaps
because of the difficulties involved in specifying preferences for public goods.
The relevant characteristic of a pure public good entering final demand is that each consumer
“owns” the same quantity. Agents’ attitudes toward public goods differ, and because there is no
market, agents’ valuations of the public good will also differ. 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 benefit) 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 first 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 differs from the TAU constraint in SHOVEN. Here the constraint represents the Samuelson condition, equating the marginal cost (PG*GREV) and the sum of
individuals’ marginal benefit ( 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: field only accepts auxiliary variables.)
1
$ONTEXT
2
3
$MODEL: SAMUELSON
4
5
6
$SECTORS:
AL(S)
GP
7
8
$COMMODITIES:
126
P(G)
9
W(F)
PG
VG(H)
10
11
12
$CONSUMERS:
RA(H) GOVT
13
14
15
$AUXILIARY:
TAU LGP
16
17
18
19
20
21
$REPORT:
V:CD(G,H)
V:DF(F,H)
V:EMPLOY(S)
V:WLF(H)
D:P(G)
D:W(F)
I:W("L")
W:RA(H)
DEMAND:RA(H)
DEMAND:RA(H)
PROD:AL(S)
22
23
24
25
26
27
$PROD:AL(S) s:0 va:ELAS(S)
O:P(G)
Q:A(G,S)
I:P(G)
Q:B(G,S)
I:W(F)
Q:FD(F,S)
P:PF(F,S)
+
A:GOVT N:TAU$TF(F,S) M:TF(F,S)$TF(F,S) va:
28
29
30
31
$PROD:GP s:0
O:PG
Q:GREV
I:P(G) Q:GD(G)
32
33
34
35
36
37
38
$DEMAND:RA(H)
D:P(G)
D:W(F)
D:VG(H)
E:VG(H)
E:W(F)
s:1 gds:ESUB(H)
Q:C(G,H)
gds:
Q:D(F,H)
Q:V(H)
Q:V(H)
R:LGP
Q:E(F,H)
39
40
41
$DEMAND:GOVT
D:PG
Q:GREV
42
43
44
$CONSTRAINT:TAU
GREV * PG =E= SUM(H, V(H) * VG(H));
45
46
47
$CONSTRAINT:LGP
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 EV’s), only the uniform capital tax
represents an improvement.
INDEX 1 = HARBERGER
REVENUE._
TAXRATE._
WELFARE.OWNER
WELFARE.WORKER
WELFARE.TOTAL
127
UNIF_K
3.9
50.0
1.9
-0.1
0.6
UNIF_L
UNIF_VA
-38.9
-0.8
50.0
25.0
42.4
18.5
-26.8
-10.9
-1.3 -3.48143E-2
EMPLOY
EMPLOY
PRICE
PRICE
PRICE
PRICE
OUTPUT
OUTPUT
.X
.Y
.X
.Y
.K
.L
.X
.Y
-5.3
20.5
-10.4
11.8
3.9
-4.7
3.6
-3.7
-6.9
34.4
-11.2
12.8
59.5
-38.9
-1.0
2.0
-8.4
22.1
-10.3
11.8
24.5
-23.5
0.4
-2.0
INDEX 1 = SHOVEN
UNIF_K
47.1
3.3
-1.0
0.6
-5.0
21.5
-10.4
11.9
6.2
-5.0
3.6
-3.4
TAXRATE._
WELFARE.OWNER
WELFARE.WORKER
WELFARE.TOTAL
EMPLOY .X
EMPLOY .Y
PRICE .X
PRICE .Y
PRICE .K
PRICE .L
OUTPUT .X
OUTPUT .Y
UNIF_L
UNIF_VA
134.2
25.3
40.2
18.3
-29.2
-10.8
-3.6 -3.51710E-2
-19.7
-8.5
12.1
21.9
-9.0
-10.3
10.2
11.8
49.8
24.2
-56.5
-23.6
-7.9
0.3
-2.0
-2.1
INDEX 1 = SAMUELSON
UNIF_K
-1.4
45.7
4.7
-2.0
0.5
-4.9
24.5
-10.7
12.2
7.8
-6.0
3.0
-2.3
-0.8
REVENUE ._
TAXRATE ._
WELFARE .OWNER
WELFARE .WORKER
WELFARE .TOTAL
EMPLOY
.X
EMPLOY
.Y
PRICE
.X
PRICE
.Y
PRICE
.K
PRICE
.L
OUTPUT
.X
OUTPUT
.Y
PROVISION._
5.7
5.7.1
UNIF_L
UNIF_VA
-14.5
-6.7
88.8
22.8
43.9
21.1
-31.4
-12.9
-3.7
-0.4
-7.5
-5.9
37.5
29.7
-11.3
-10.9
13.0
12.5
60.3
29.0
-51.8
-24.5
-2.2
0.9
3.3 -2.58148E-2
-13.9
-6.1
Algebraic Representations
Harberger
Zero Net Profit
The unit cost of production in sector A(h, s) is given by a nested Leontief-CES function defined 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:
1

 1−σ
s
X
X
− ps ≥ 0
∀s|σs 6= 1
αf s (wf (1 + tf s ))1−σs 
−Πs =
pg Bbs + φs 
g
f
and

−Πs =
X
g

Y
pg Bbs + φs  (wf (1 + tf s ))αf s  − ps ≥ 0
∀s|σs = 1
f
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 =
X
s
∂Πs
∂(wf (1 + tf s ))
ALs wf tf s
Income Balance for Households
Household income is determined by the net of tax return to primary factors plus the household share
of government revenue:
X
Mh =
wf Ef h + sh P T
f
Market Clearance for Goods
Producer output is equal to the sum of intermediate plus final demand:
X
X γh Mh eh (p) σh
ALg ≥
ALs Bgs +
eh (p)
pg
s
h
where gammah is the household budget share devoted to the consumption of goods, and eh is the
“unit expenditure function” which may be written:
1
! 1−σ
eh (p) ≡
X
h
βih pi1−σh
i
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 specified as Cobb-Douglas (constant
budget shares):
X µf h Mh
X
X
∂Πs
Ef h =
ALs
+
∂(wf (1 + tf s ))
wf
s
h
h
5.7.2
Shoven
Zero Net Profit
The unit cost of production in sector Ah s is given by a nested Leontief-CES function defined 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 =
X
g
129
1

 1−σ
s
X
1−σs 

pg Bbs + φs
αf s (wf (1 + τ tf s ))
− ps ≥ 0
f
∀s|σs 6= 1
and
−Πs =
X


Y
pg Bbs + φs  (wf (1 + τ tf s ))αf s  − ps ≥ 0
g
∀s|σs = 1
f
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 =
X
s
∂Πs
∂(wf (1 + τ tf s ))
ALs wf τ tf s
Equal Yield
In equilibrium, tax rates are multiplicatively adjusted to achieve a target level of government revenue:
X
PT =
θ g pg
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:
X
Mh =
wf Ef h + sh P T
f
Market Clearance for Goods
Producer output is equal to the sum of intermediate plus final demand:
X
X γh Mh eh (p) σh
ALg ≥
ALs Bgs +
eh (p)
pg
s
h
where γh is the household budget share devoted to the consumption of goods, and eh h is the “unit
expenditure function” which may be written:
1
! 1−σ
eh (p) ≡
X
h
βih pi1−σh
i
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 specified as Cobb-Douglas (constant
budget shares):
X
X
X µf h Mh
∂Πs
Ef h =
ALs
+
∂(wf (1 + τ tf s ))
wf
s
h
h
130
5.7.3
Samuelson
Zero Net Profit for Private Production
The unit cost of production in sector Ah s is given by a nested Leontief - Cobb-Douglas function
defined 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:


X
Y
−Πs =
pg Bbs + φs  (wf (1 + τ tf s ))αf s  − ps ≥ 0
∀s
g
f
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 defined by a vector of public sector input coefficients, ah g.
In equilibrium, the price paid by the government equals the cost of market inputs:
X
pg ag − pG ≥ 0
g
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 =
X
s
∂Πs
∂(wf (1 + τ tf s ))
ALs wf τ tf s = pG 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:
X
Mh =
wf Ef h + vh G
f
Market Clearance for Private Goods
Producer output is equal to the sum of intermediate plus final demand:
X
X γh Mh eh (p) σh
ALg ≥
ALs Bgs +
eh (p)
pg
s
h
where γh is the household budget share devoted to the consumption of goods, and eh h is the “unit
expenditure function” which may be written:
1
! 1−σ
h
X
1−σh
eh (p) ≡
βih pi
i
131
Personalized Markets for Public Goods
We assume a “pure” public good in this model, hence each household may attach a different 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 Mh
vh
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 specified as Cobb-Douglas (constant
budget shares):
X
X
X µf h Mh
∂Πs
Ef h =
ALs
+
∂(wf (1 + τ tf s ))
wf
s
h
h
Samuelson Rule for “Optimal” Provision of Public Goods
The tax rate multiplier is adjusted to balance the marginal cost of public provision with the summation 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 sufficient for optimal provision.
We apply the rule here merely to illustrate the programming methodology, even though the resulting
equilibrium may be “suboptimal”:
X
pG =
vh
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 flexible 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 Colombia 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 final 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 corruption1 . 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 different tax
sources in Section 6.4.
6.2
Social Accounting
Payments for goods and services can be represented concisely by using a social accounting framework. Different industries, consumers and government agents sell and purchase goods, then those
transactions are recorded and combined to form a Social Accounting Matrix (SAM). The information contained in a SAM is the starting-point for most general equilibrium models. See Pyatt and
Round (1985) or Ben King’s What is a SAM, (1981) for a more detailed introduction to SAM construction 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,
133
we do include an “informal” labor sector which does not pay labor taxes
The business of interpreting a particular country’s 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 different 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 specific 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 specific trade data) can be treated generically. Conversely, a
model to analyze international trade patterns would imply a different data aggregation routine
and a different 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 fictitious. The
financial (capital) accounts, for example, are often notoriously inaccurate. Local experts should
use their specific 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 different 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 firms, 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) SAM2 . The sub-matrix “A” shows industrial
production and use of commodities. This is the core portion of the SAM. Sub-matrix “B” contains
final consumption data. This portion of the SAM shows who ended up buying final 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 figures to represent inputs and positive
figures to represent outputs.
134
each commodity. Notice that export is considered to be a final consumer in this framework. Submatrices “C” and “D” list consumption of imports and sales of exports. These imports are either
consumed for intermediate use or final 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
by Production Sectors
1
2
...j...
n
Domestic
Production
by
sector
1
2
:
i
:
n
Trade
Value added:
-labor
-capital
Transfers
-taxes
-margins
6.2.2
Private
consum.
FINAL USE
Gov’t
consum.
Invest.
A
B
C
D
E
F
G
H
Export
Colombian 1996 SAM
The SAM for Colombia is shown in Table 6.2. This is a “square” SAM, because it has an equal number 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 firms and capital (public and private). These features are incorporated
into the model. The SAM does not offer household information by income class. This means that
the current model should focus upon efficiency 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)
Manufact.
Service
Gov Svcs
Formal L.
Informal L.
Capital
Other Ind.Tx.
VAT
Tariffs
Comm. Marg.
Trns. Marg.
Indir.Tax
Subsidies
Direct Tax
Households
Government
Pub firms
Priv firms
ROW
Acummulation
∆ Stocks
Public Inv
Private Inv
Manufacturing
15418.3
8007.9
11206.1
31629.5
6766.1
10723.7
6551.1
364.8
958.7
258.7
6133.8
930.7
2385.6
-81.9
19990.9
14183.3
20766.1
877.4
3227.2
842.6
-6133.8
-930.7
119.9
-47.5
5467.1
Servcs
Govnt
Services
1112.6
5102.3
Formal
Labor
Informal
Labor
Capital
37376.4
24906.3
6350.7
2742.9
5782.8
14468.5
Other
Ind.Tax
VAT
Commerc
Margin
Transprt
Margin
10610.1
2026.4
188.8
15525.7
1429.5
4186.9
1100.7
3.1
Original Square SAM for Colombia 1996 (continued...)
Indirect
Taxes
Manufact.
Service
Gov Svcs
Formal L.
Informal L.
Capital
Other Ind.Tx.
VAT
Tariffs
Comm. Marg.
Trns. Marg.
Indir.Tax
Subsidies
Direct Tax
Households
Government
Pub firms
Priv firms
ROW
Acummulation
∆ Stocks
Public Inv
Private Inv
Subsidies
Direct
Taxes
H.Holds
24108.5
40940.5
916.9
Govnt
Public
Firms
Private
Firms
ROW
Accumulation
10704.8
4602.1
∆ Stock
778.5
-219.8
Public
Invest
5.9
5025.9
18122.5
12.4
2505.5
-128.4
5737.1
1555.5
115.2
5593.1
442.5
7714.7
5727.7
4702.1
6647.1
2177.5
678.5
-3823.7
48.5
604.2
1061.1
109.2
950.6
163.4
4143.5
4133.1
8881.3
2453.8
713.3
11098.9
2489.6
7375.2
4178.8
203.9
33.6
736.1
3855.4
559.7
5030.7
16718.4
136
Private
Invest
550.3
16168.1
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 first 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 defined
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 Colombia’s international trade
activities have a minimal impact on world prices. We record trade using the pfx (price of foreign
exchange) commodity. pfx represents Colombia’s 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 final 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 private companies and other agents in the economy. These transfers are “financial” 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 fixed factor. The inclusion of this fixed factor reflects the fact that extraction industries
exhibit decreasing returns to scale, so that a developing country cannot simply extract natural
resources indefinitely. We included a resource payment, which is considered part of the return to
capital, and reflects a certain level of fixed inputs. Country experts should consider the best valueshare 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
Gov Serv
FOREX
Formal L
Informal L
Privat K
Public K
Resources
VAT
TM
TL
TK
IndTx
Trans Marg
Comerc Marg
Investment
Total:
6.2.5
Manufact
Industries
44976.4
-9120.6
Service
Industries
-10910.2
68626.7
4690.9
-7577.5
-11285.8
-3728.1
-10376.3
-18066.0
-13620.5
-16818.4
-2637.6
-1571.1
-349.6
-329.0
-1135.1
-2758.7
-945.2
-8229.1
-2615.2
-751.0
-784.5
-2998.9
-860.1
945.2
8229.1
0.0
0.0
Government
Services
-1436.7
-4778.0
19039.2
Government
Agent
Investment
-1918.7
-20389.9
-18122.5
6344.3
-10168.5
-2026.3
2026.3
-441.5
4186.3
1100.6
1555.1
4134.0
3806.9
Household
Agent
-30710.8
-34338.3
-916.6
-658.9
35812.0
24906.3
20546.4
2637.6
-188.1
0.0
-5030.8
0.0
22308.5
0.0
-17277.7
0.0
Total:
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
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, Aj , is used as an intermediate input or for final demand.
At a minimum, we check supply/demand balance using this commodity. On the left side, Aj is
a combination of domestic production, imports and (specific to Colombia) trade and transport
margins:
X
Aj = Dj + Mj PjM +
(M rgjD − M rgjS )
m
Now, we know that Aj is supplied for intermediate and final demand, so that the following equation
must hold:
X
Aj −
IDij − Cj − Ij − Gj = 0.
i
If a SAM is not balanced, the analyst figure out what went wrong, and then decide how to remedy
the situation. Another issue is the interpretation of certain taxes and subsidies. For example, value138
Table 6.4: Echo Print of Base Year Value Shares
COF
CRO
LVS
FFH
OIL
MIN
THR
FOD
NRI
NSI
HTC
CON
TRN
ELE
COM
SER
GOV
X/(X + D)%
90
0
2
62
70
37
35
5
11
18
16
0
8
0
10
0
0
L/V %
100
95
92
23
66
31
99
64
53
65
48
56
91
26
36
66
84
M/(M + D)%
0
1
6
0
10
0
21
5
22
24
57
0
6
0
4
2
0
LF /(LF + LI )%
30
19
19
100
38
68
28
45
84
67
91
61
65
100
98
51
100
GDP %
1
5
1
3
2
0
6
4
4
3
3
7
5
3
2
35
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. LF /(LF + LI )% 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 specific 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 first 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 (LF /(LF + LI )), and (in the final 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 tariff and import rows from the SAM to compute the benchmark
tariff rates. All of these tax rates are shown in Table 6.5.
139
Table 6.5: Percentage Tax Rates from 1996 SAM
V AT
COF
CRO
LVS
FFH
OIL
MIN
THR
FOD
NRI
6.3
TY
1
TM
2
6
6
2
1
2
24
1
14
4
19
3
6
5
NSI
HTC
CON
TRN
ELE
COM
SER
GOV
V AT
25
53
1
21
2
TY
1
1
1
1
-1
1
1
1
TM
5
6
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.
2.
3.
4.
5.
Value-added taxes, applied to primary factor inputs (vat)
Import tariffs (tM )
Direct taxes on capital (tK )
Direct taxes on formal labor (tF )
Indirect taxes and substitutions on production (ti )
• Armington differentiation of domestic and foreign goods, include a constant-elasticity of substitution 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 fixed supply.
6.3.1
General Overview of GE Modeling
The static model recreates an Arrow-Debreu (1954) general economic equilibrium model3 . 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
Walras’s 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 profits. The zero homogeneity of demand functions and the linear homogeneity of profits
in prices (i.e. doubling all prices double money profits) imply that only relative prices are of any
significance 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 profits, 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 define an equilibrium:
market clearance, zero profit, and income balance.
6.3.2
Economic Flows
The relationship between different 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 figure.
G
I
H
Y
HH
C
J
]
J
HH J
H J
HH
H
M
-
A
D
6
? ? ?
?
E
Y
R
L
RA, Gov
K
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 final 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 final 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 identifiers in the paper, but in the mcfmodel.gms model code, the set identifiers
are s and ss.
The model has the production sectors detailed in Table 6.7.
142
Table 6.6: Symbol Lookup Table
Set Label
i (or j)
l
k
m
Symbol
Yi
xij
Li
LIi
Ki
R̄i
Ai
Ei
Di
Mi
Ii
Gi
Ci
aij
Taxes
ti , t F , t K
vati
Prices
pi
wl
rk
pf x
143
Elements
Sectors (listed in Table 6.7)
Labor types {formal, informal}
Capital types {public, private}
Margin types {trade, commerce}
Description
Production of good i
Intermediate Input: level of Ai used in sector j production
Formal labor input into sector i
In-formal labor input into sector i
Capital input into sector i
Fixed-supply natural resource input into sector i
Armington aggregate good (Imports plus Domestic)
Export output of good i
Domestic output of good i
Imports of good i
Investment demand i
Government demand
Household final demand
Share parameter for factor inputs
Production, Formal-labor, and Capital taxes, respectively
Value-added tax
Output price of the Armington aggregate, Ai
Wage for formal or in-formal labor
Single-period (rental) price of capital
Aggregate exchange rate
Table 6.7: Sectors in the 1996 SAM
cof
cro
lvs
ffh
oil
min
thr
fod
nri
nsi
htc
con
trn
ele
com
ser
gov
6.3.4
Coffee
Other crops
Livestock
Forestry fishing and hunting
Oil
Other Minerals
Coffee Threshing
Foodstuffs
Natural Resources Intensive Industries
Non-skilled Labor Intensive Industries
Capital and High Technology Industries
Construction
Transport
Electricity Gas and Water
Communications
Private Services
Government Services
Functional Forms
The Constant Elasticity of Substitution (CES) function is adopted for the static model. CES functions are widely accepted by economists because they are globally regular, and can be defined by their
zeroth, first, 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 production 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 defined 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:
vi
xji
,
Yi = min min
j
aji
bi
Value-added represents a Cobb-Douglas aggregation of labor, capital and sector-specific resources:4
γ
β
αI
F
vi = Lα
F i LIi Ki Ri
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
Ai
C, G, I
σ=4
!a
!
aa
!
!
aa
!
Ei
Di
a
!
aa !
aa!!!
η=1
Yi
Mi
?
RA
!a σ = 0
!! aa
aa
!! σ=1
σ=0
@
@
L @
L@
@
L @
R
K
L
A1
...
Aj
6
6
6
6
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
Di and goods for export Ei . 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:
h
i1/(1+1/η)
1+1/η
1+1/η
Yi = g(Di , Ei ) = αiD Di
+ (1 − αiD )Ei
where αiD 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,
Ai , are produced by combining domestic goods with imports from the same sector. These goods are
treated as imperfect substitutes (e.g., Coffee from Colombia vs. Java). We use σ as the Armington
elasticity, which corresponds to esubdm in the computer code.
1/(1−1/σ)
1−1/σ
1−1/σ
Ai = αiM Mi
+ (1 − αiM )Di
Some confusion can arise trying to distinguish between production, Yi , output (Di ,Ei ) and the
consumption good (Ai ). The Armington aggregate good is the main commodity for use in production
and final demand. It combines domestic output, Di (which is produced via Yi ), with imports, Mi .
5 For
purposes of illustration we assume that sector-specific resource inputs are a given fraction of the base year
capital earnings: Coffee (25), Other crops (25), Livestock (25), Forestry fishing 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-specific 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.
X
X
pE
pM
i Ei + B =
i Mi
i
i
Holding all else equal, rising import demand will increase ρ, which reflects increased demand for
external currency. The fixed parameter B denotes the exogenously-specified current account balance.
M
Because this is a small-open economy, import and export prices (pE
i , pi ) are fixed exogenously.
Consumption, Investment and Government
Final Consumption A single representative agent (RA) is endowed with primary factors of production: 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:
Y
X
i
U (Ai ) =
Aα
αi = 1
i
i
i
The RA maximizes utility subject to a budget constraint:
maxAi U (Ai )
s.t. P
i pi Ai ≤ pK K + pL (LI + LF ) + pR R + trn − I
Investment In the static formulation, investment demand is held constant at base-year levels. Investments 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 vati , formal
labor is taxed at rate tF and capital earnings are taxed at rate tK . Resource inputs are sectorspecific, hence their inputs are fixed and the tax applied to resource inputs is lump-sum. Capital
and labor allocations are, however, price-responsive. Hence differences in VAT rates across sectors
lead to efficiency costs which are captured in the model. Tax-inclusive cost of production is then:
P
F
CostYi =
j pj xji + (1 + vati )[wF (1 + tF )Li
I
+wI Li + (1 + tK )(rkKi + ri Ri )]
Tax-inclusive output value for Y is:
X
V alueYi = (1 + tYi ) pD
i Di + ρpi Xi
146
In equilibrium, the tax-inclusive cost of production equals output value across all sectors, this represents the zero-profit market condition.
Import tariffs are included into the Armington commodity’s unit cost function:
"
pi =
αiM
M
pM
i (1 + ti )
M
p¯i
1−σ
+
pD
i
p¯i D
1−σ #1/(1−σ)
The benchmark tax rate applied on formal labor inputs (tF ) 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 (tK ) is based on the direct
tax payments by private firms 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.
vat, tF , tY , tM , tK
?
-
G
GOV
I
C
H
Y
H
HH
]
J
J
H
HH
H J
H J
tM -
Mi
Aji
Di
6
? ?
?
Ei
tY
Yi
tY
tK
tF
tK
Figure 6.3: Taxes in mcfmodel.gms
147
R
L
K
RA
6.3.5
Other Model Features
Steady-State
A major drawback of static analysis is the presence of a fixed 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:
(pinv = rk)
⊥ κ
The scale parameter, κ, is complimentary to the steady-state investment equation above, so when rk
rises relative to pinv , κ scales up government and private investment to reflect 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)
e:pinv
e:rk(k)
e:pfx
q:g0(s)
q:(-govtinv)
q:govtk(k)
q:govttrn
$demand:hh
d:pc
e:pinv
e:rk(k)
e:pfx
e:wage
e:pr(s)
q:(sum(s,c0(s)))
q:(-hhinv)
r:kstock
q:hhk(k)
r:kstock
q:hhtrn
q:(sum(l,ls0(l)))
q:rd0(s)
r:kstock
r:kstock
If kstock is fixed 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 fixed. However, this labor endowment can be allocated to
either formal labor supply (LF ) which is taxed, or informal labor (LI ) which is un-taxed. Agents
choose how much of each type to supply according to relative wages. The benchmark data reflects
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:
" 1+ηL
1+ηL #1/(1+ηL )
wI
wF
L
L
+ (1 − α )
w= α
w¯F
w¯I
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
LF
σ=1
@
@
@
LI
@ @
ηL
@
L̄
Y
RA
∂w
The first partial-derivative ( ∂w
) determines sector-specific labor supply:
l
LF = αL
w
wF
LI = (1 − αL )
η L
w
wI
η L
Labor is taxed as an input to production by the direct labor tax (tF ) 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 urban (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 relationship between the real wage rate and the rate of employment:
w
= g(ur)
(6.1)
P
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 efficiency 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 figure, 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, LS . 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 (LS )1 − L1 .
In htmodel.gms, we specify the wage equation, g(ur) using an elasticity parameter, θ:
w
= g(ur) = ur−1/θ
P
and
w
=1
P
if
if
θ<∞
(6.2)
θ=∞
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 differential, and unemployment. 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.
wI = (1 − ur) · wF
(6.3)
The expected wage in the formal sector is the wage, wF , times the employment rate (1 − ur). 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:
LF = LF
0 ·
1 − ur m
·
1 − ur0 m0
(6.4)
where m is the migration rate between the informal and formal labor sectors, ur0 is the initial
unemployment rate, and LF
0 is the benchmark formal labor supply. Then the informal labor supply
is equal to those workers who did not migrate:
LI = LI0 ·
1−m
.
1 − m0
(6.5)
150
The analyst is free to choose the elasticity of transformation between the formal and informal labor
3
.
sectors. In the Overview of the Harris-Todaro model for Colombia, this elasticity is estimated at 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 define an Arrow-Debreu equilibrium in mcfmodel.gms:
Zero Profits:
Market Clearance:
Income Balance:
Costi (p) ≥ Revi (p)
P
Di + Mi ≥ j Aij + Ei + RAi + GOVi
P
i pi Ai ≥ w L̄ + pK K̄ + pR R̄ + trn − I
⊥ Yi
⊥ pi
for (GOV,RA)
Zero Profit Thee first class of constraint requires that in equilibrium no producer earns an ”excess”
profit, 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 profit condition is output (Yi ). 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 activity 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 (pi or
pF , pK , PR , 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 agent’s 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
6.4.1
Conducting Economic Policy Analysis
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 five 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 tariff (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 Efficiency and Incidence of Base Year Taxes
VAT
TY
TM
TL
TK
Y IELD
70%
75%
66%
71%
62%
M CF
1.27
1.30
1.09
1.10
1.10
M CFF
-0.12
-0.02
0.11
-0.36
0.33
M CFI
-0.19
-0.52
-0.61
-0.18
-0.18
M CFK
-0.71
-0.38
-0.26
-0.15
-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 first 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 M CF 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 (T Y ) is the most costly source of tax revenue while the import tariff
(T M ) is the least costly revenue source, in which the economic cost of raising $1 of additional public
revenue costs roughly $1.10.
The final three columns in Table 6.8 indicate the marginal incidence of each tax instrument for formal
labor (M CFF ), informal labor (M CFI ) and capital (M CFK ). 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
financed 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 Efficiency in the Steady-State
VAT
TY
TM
TL
TK
Y IELD
67%
73%
64%
70%
57%
M CF
1.72
1.56
1.32
1.20
1.86
M CFF
-0.45
-0.20
-0.06
-0.43
-0.20
M CFI
-0.44
-0.71
-0.79
-0.24
-0.65
M CFK
-0.07
0.02
0.16
0.01
-0.07
∆K
-1.65%
-0.88%
-0.21%
-0.14%
-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 (M CF ) 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-efficient 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 find that
labor taxation is preferred from an efficiency standpoint because long-run labor supply is relatively
inelastic when compared to long-run capital supply. Import tariffs remain a relatively in-expensive
source of government revenues relative to capital or indirect taxation.
6.5
Data Processing
The first step in dealing with a SAM is to transfer the data into GAMS readable format. In order
to transfer an Excel file into GAMS format, we use the following:
sam1996.xls (Original data file)
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 file named sam1996.xls. The spreadsheet consists of row and
column headings, and a 37x37 data matrix. The data flows from the xls file 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 first 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 affair. Once the data
is converted, only the GAMS dataset (sam.dat) is required6 . Each step in this process is described
below.
6.5.1
The Excel input file
Each account is referenced in the xls file 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
dataset7 . sam.gms uses the spreadsheet import routine, xlimport8 , which must be installed before
data can be moved between GAMS and Excel. The basic syntax for xlimport is as follows:
$LIBINCLUDE xlimport parameter
file
range
where
parameter is a name of the GAMS parameter to which data will be retrieved;
file is a name of a file 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!
is useful to note that a GAMS dataset is simply a text file 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
7 It
154
Line 1 defines 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
defined 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 defined in the main GAMS model. Line 3
executes the xllink.exe utility and extracts the data from the Excel spreadsheet.
A new datafile is created using lines 5 and 6. First an output handle (kdat) is created. This handle
is an alias for the physical file, called sam.dat, the GAMS data file. The gams2prm utility is used
to export sam(r,c) into the file 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 file which can be inserted directly into any GAMS program. The gams2prm utility
defined 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 Coffee into the Natural Resource Intensive Industries sector.
We insert sam.dat into the main GAMS program, mcfmodel.gms, then define 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 file 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 define a set of production sectors, S, with each row of
the SAM as elements:
mcfmodel.gms (partial listing):
set
s
Sectors /
cof
cro
lvs
ffh
Coffee
Other crops
Livestock
Forestry fishing and hunting
Next, we make an association between the set S, and the rows/columns in the dataset. This can
be done efficiently by using a temporary set called map(*,r). Where the basis of this set can be
anything in the first 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 definition
of map simply connects each element of s to the corresponding row in the SAM. Coffee (cof) is
connected with row number 1, and so on:
set map(*,r)
cof.1
cro.2
lvs.3
ffh.4
oil.5
Mapping onto the SAM rows /
Coffee
Other crops
Livestock
Forestry fishing and hunting
Oil
Parameter Assignments The base-year economic flows are defined by picking elements from sam(r,c).
For example, intermediate inputs are inserted into the parameter id0(s,ss) by picking out the diagonal 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 defined 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 Foodstuffs, 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 million9 .
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;
*
6.5.4
Extract margin supply and demand:
md0("trade",s) = max(0, sam("25",c));
ms0("trade",s) = max(0, -sam("25",c));
... and so on ...
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:
X
a0s = d0s + m0s · pm0s +
md0m,s − ms0m,s
m
or via final demand, investment, and government:
X
a0s =
id0s,ss + c0s + i0s + gs0
ss
The equivalence is checked in mcfmodel.gms using parameter definitions:
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 file:
---723 PARAMETER MKTCHK
Cross check of consistency
cof 5.80092E-15,
cro 7.21645E-16,
lvs 8.64846E-15,
ffh
oil -7.5530E-15,
min 4.87175E-15,
thr 5.79536E-14,
fod
nri -7.1831E-14,
nsi 7.27196E-14,
htc 1.84741E-13,
con
trn 1.77636E-15,
ele -9.3259E-15,
com 2.84217E-14,
ser
gov 1.70530E-13
2.17465E-14,
3.98848E-13,
-3.7303E-14,
9.85656E-13,
The accounts are consistent because mktchk is a very small number10 .
9 The
values from the original IO table were scaled by 1000, making the unit of measurement, billions of US dollars.
we consider numbers less than 1e-6 to be fairly small, and 1e-10 small enough to be a result of computer
tolerances.
10 Typically,
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 simplifies 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 defined
as:
1/ρ
U (x, y) = (αxρ + (1 − α)y ρ )
It is a tedious but straight-forward application of Lagrangian calculus to demonstrate that the
associated demand functions are:
σ
α
M
x(px , py , M ) =
1−σ
σ
px
α px + (1 − α)σ p1−σ
y
and
y(px , py , M ) =
1−α
py
σ
M
.
+ (1 − α)σ p1−σ
ασ p1−σ
y
x
The corresponding indirect utility function has is:
V (px , py , M ) = M ασ p1−σ
+ (1 − α)σ p1−σ
x
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 (px , py , λM ) = λV (px , py , M )
159
and V is homogeneous of degree -1 in p.
V (λpx , λpy , M ) =
V (px , py , M )
.
λ
Furthermore, linear homogeneity permits us to form an exact price index corresponding to the cost
of a unit of utility:
1
1−σ
e(px , py ) = ασ p1−σ
+ (1 − α)σ p1−σ
x
y
The indirect utility function can then be written:
V (px , py , M ) =
M
e(px , py )
Conceptually, this equation states that the utility which can be realized with income M and prices
px and py 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:
1/ρ
y(K, L) = φ (βK ρ + (1 − β)Lρ )
the unit cost function then has the form:
c(pK , pL ) =
1
1−σ
1 σ 1−σ
β pK + (1 − β)σ p1−σ
L
φ
and associated demand functions are:
K(pK , pL , y) =
and
σ
y
βφc(pK , pL )
φ
pK
σ
y
(1 − β)φc(pK , pL )
L(pK , pL , y) =
.
φ
pL
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 coefficients by inverting the factor demand
functions:
σ−1
p̄K K̄
p̄K K̄ 1/σ
, ρ=
θ=
, β=
σ
p̄K K̄ + p̄L L̄
p̄K K̄ 1/σ + p̄L L̄1/σ
and
−1/ρ
φ = ȳ β K̄ ρ + (1 − β)L̄ρ
7.3
The Calibrated Share Form
Calibration formulae for CES functions are messy and difficult to remember. Consequently, the
specification of function coefficients is complicated and error-prone. For applied work using calibrated 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:
ρ
ρ 1/ρ
K
L
y = ȳ θ
+ (1 − θ)
K̄
L̄
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:
1
" 1−σ
1−σ # 1−σ
pK
pL
c(pK , pL ) = c̄ θ
+ (1 − θ)
p̄K
p̄L
where
c̄ = p̄L L̄ + p̄K K̄
161
and the compensated demand functions are:
y
ȳ
K(pK , pL , y) = K̄
y
ȳ
L(pK , pL , y) = L̄
p̄K c
pK c̄
and
c p̄L
c̄ pL
σ
σ
Normalizing the benchmark utility index to unity, the utility function in calibrated share form is
written:
ρ 1/ρ
y
x ρ
+ (1 − θ)
U (x, y) = θ
x̄
ȳ
The unit expenditure function can be written:
1
" # 1−σ
1−σ
px
py
,
e(px , py ) = θ
+ (1 − θ)
p̄x
p̄y
the indirect utility function is:
M
,
M̄ e(px , py )
V (px , py , M ) =
and the demand functions are:
x(px , py , M ) = x̄ V (px , py , M )
e(px , py )p̄x
px
and
y(px , py , M ) = ȳ V (px , py , M )
e(px , py )p̄y
py
σ
σ
.
The calibrated form extends directly to the n-factor case. An n-factor production function is written:
"
y = f (x) = ȳ
X
θi
i
xi
x̄i
ρ #1/ρ
and has unit cost function:
"
C(p) = C̄
X
θi
i
pi
p̄i
1
1−σ # 1−σ
and compensated factor demands:
xi = x̄i
y
ȳ
C p̄i
C̄ pi
σ
162
7.4
Exercises with CES Functions
1. Show that given a generic CES utility function:
1/ρ
U (x, y) = (αρ + (1 − α)y ρ )
can be represented in share form using:
x̄ = 1, ȳ = 1, p̄x = tα, p̄y = t(1 − α), M̄ = t.
for any value of t > 0.
2. Consider the utility function defined:
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:
1/ρ
U (x, L) = (αLρ + (1 − α)xρ )
which is maximized subject to the budget constraint:
px 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 nonwage 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 benchmark consumption bundle unaffordable, yet the consumer is indifferent. Graph the choice.
Find an equation which determines the elasticity of substitution as a function of the benchmark 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 preferences are instead given by:
1/ρ
U (x, y, z) = (β min(x, y)ρ + (1 − β)z ρ )
Determine β from the benchmark, and find 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:
c1−θ
c1−θ
U (c1 , c2 ) = 1
+β 2
1−θ
1−θ
subject to the budget constraint:
c1 +
c2
1
=1+
1+r
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 r0 to r is equal to:
EV = M/M̄ − 1 =
2+r
2 + r0
1 + r0
1+r
1 + β 1/θ (1 + r)1/θ−1
1 + β 1/θ (1 + r0 )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 Mikki’s utility function?
9. What fraction of Mikki’s income does she spend on rent in Georgetown?
10. How much larger would Mikki’s income need to be to compensate for the higher cost of skiing
such that she would be indifferent between living in Boulder or Georgetown.
7.5
Benchmarking Supply Functions
This section describes how calibrate the fixed factor input for constant returns to scale CES technology and in order to obtain a specified price elasticity of supply at a reference point. We first consider
the long-run model with one fixed 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 fixed. We then have a CES cost function which in
equilibrium defines the price of output:
p = c(r, w)
in which w is the exogenous wage rate and r is the residual return to the sector’s fixed factor.
Because this factor is fixed, by Shepard’s lemma we have the following relationship between output,
164
the supply of the fixed factor and the return to the fixed factor:
y
∂c(r, w)
= R̄
∂r
If we use the calibrated CES cost function of the form:
c(r, w) = θr1−σ + (1 − θ)w1−σ
1
1−σ
then the calibration problem consists of finding 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 specific factor such that its benchmark price is unity.
Hence, when we calibrate the share parameter, we are also determining the supply of the fixed factor:
R̄ = θȳ
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-specific can be inverted to obtain an explicit expression for the return:
1/σ
θy
r=p
R̄
where we have substituted the equilibrium price for the cost function. Substituting back into the
cost function, we have
1−σ
θy σ
1−σ
1−σ
+ (1 − θ)w1−σ
p
= θp
R̄
or
"
y = R̄θ
1
σ−1
σ
1−σ # 1−σ
w
1 − (1 − θ)
p
Differentiating 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 fixed factor θ to match the base year profits, and then assign the
elasticity according to:
θη
σ=
(1 − θ)
165
Alternatively, one choose to use a Cobb-Douglas function and set the specific 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-fixed production factor which is variable in the long run but fixed in the short run, and R is
a sector-specific resource which is fixed in both the short and long run.
We can write the long-run production function as:
ρ
1/ρ
ρ
L
K
y = ȳ θL
+ θK
+ (1 − θL − θK )
L̄
K̄
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:
ρ
1/ρ
L
y = ȳ θL
+ (1 − θL )
L̄
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 find 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 xi (π) 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. Define the reference cost, and
reference value share for ith input by C̄ and θi , where
X
C̄ ≡
π̄i x̄i
i
and
θi ≡
πi x̄i
C̄
The single-level constant elasticity of substitution cost function in calibrated form is written:
C(π) = C̄
X
θi
i
πi
π̄i
1
1−σ ! 1−σ
Compensated demands may be obtained from Shephard’s lemma:
σ
∂C
C(π) π̄i
xi (π) =
≡ Ci = x̄i
∂πi
C̄ πi
Cross-price Allen-Uzawa elasticities of substitution (AUES) are defined as:
σij ≡
where
Cij ≡
Cij C
Ci Cj
∂xi
∂xj
∂ 2 C(π)
=
=
∂πi ∂πj
∂πj
∂πi
For single-level CES functions:
σij = σ
∀i 6= j
The CES cost function exibits homogeneity of degree one, hence Euler’s condition applies to the
second derivatives of the cost function (the Slutsky matrix):
X
Cij (π) πj = 0
j
or, equivalently:
X
σij θj = 0
j
The Euler condition provides a simple formula for the diagonal AUES values:
P
− j6=i σij θj
σii =
θ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 off-diagonal element in each row of
the AUES or Slutsky matrices. When there are only two factors, then the off-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
sik 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
pk (π) denote the price index associated with aggregate k, normalized to equal unity in the benchmark,
i.e.:
"
# 1k
1−σ
X sik θi πi
k
pk (π) =
)1−σ
ωk π̄i
i
The two-level nested, nonseparable constant-elasticity-of-substitution (NNCES) cost function is then
defined as:
1
! 1−γ
X
1−γ
C(π) = C̄
ωk pk (π)
k
Demand indices for second-level aggregates are needed to express demand functions in a compact
form. Let zk (π) denote the demand index for aggregate k, normalized to unity in the benchmark;
i.e.
γ
C(π) 1
zk (π) =
C̄ pk (π)
Compensated demand functions are obtained by differentiating C(π). In this derivative, one term
arise for each nest in which the commodity enters, so:
xi (π) = x̄i
X
k
zk (π)
pk (π)π̄i
πi
σ k
= x̄i
X C(π)
C̄
k
1
pk (π)
γ pk (π)π̄i
πi
σ k
Simple differentiation shows that benchmark cross-elasticities of substitution have the form:
σij = γ +
X (σ k − γ)sik sjk
k
ωk
Given the benchmark value shares θi and the benchmark cross-price elasticities of substitution, σij ,
we can solve for values of sik , ω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 nonlinear programming algorithm, CONOPT, which is available through GAMS, the same programming
environment in which the equilibrium model is specified. Perroni and Rutherford prove that calibration of the NNCES form is possible for arbitrary dimensions whenever the given Slutsky matrix
is negative semi-definite. The two-level (N × N ) function is flexible for three inputs; and although
we have not proven that it is flexible for 4 inputs, the only difficulties we have encountered have
resulted from indefinite calibration data points.
7.7
1
Calibrating Three Factor Cost Functions
$TITLE
Two nonseparable CES calibrations for a 3-input cost function.
*
Model-specific data defined here:
SET
i
2
3
4
5
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/
aues(i,j)
Benchmark cross-elasticities (off-diagonals) /
A.B
2
A.C
-0.05
B.C
0.5 /;
10
11
12
13
14
15
16
17
*
*
Use an analytic calibration of the three-factor CES cost
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
38
39
40
169
n
k(n)
i1(i)
i2(i)
Potential nesting /N1*N3/
Nesting aggregates used in the model
Good fully assigned to first nest
Good fully assigned to second nest
i3(i)
41
Good split between nests;
42
43
SCALAR
assigned /0/;
44
45
46
47
48
49
50
PARAMETER
esub(*,*)
shr(*,i,n)
sigma(n)
s(i,n)
gamma
Alternative calibrated elasticities
Alternative calibrated shares
Second level elasticities
Nesting assignments (in model)
Top level elasticity (in model);
51
52
*
First the Leontief structure:
53
54
55
56
57
58
59
60
esub("LTF","GAMMA") = SMAX((i,j), aues(i,j));
esub("LTF",n) = 0;
LOOP((i,j)$((aues(i,j) = esub("LTF","GAMMA"))*(NOT assigned)),
i1(i) = YES;
i2(j) = YES;
assigned = 1;
);
61
62
63
64
65
66
67
68
69
70
71
72
73
i3(i) = YES$((NOT i1(i))*(NOT i2(i)));
DISPLAY i1,i2,i3;
LOOP((i1,i2,i3),
shr("LTF",i1,"N1") = 1;
shr("LTF",i2,"N2") = 1;
shr("LTF",i3,"N1") = theta(i1)*(1-aues(i1,i3)/aues(i1,i2)) /
( 1 - theta(i3) * (1-aues(i1,i3)/aues(i1,i2)) );
shr("LTF",i3,"N2") = theta(i2)*(1-aues(i2,i3)/aues(i1,i2)) /
( 1 - theta(i3) * (1-aues(i2,i3)/aues(i1,i2)) );
shr("LTF",i3,"N3") = 1 - shr("LTF",i3,"N1") - shr("LTF",i3,"N2");
);
ABORT$(SMIN((i,n), shr("LTF",i,n)) < 0) "Benchmark AUES is indefinite.";
74
75
*
Now specify the two-level CES function:
76
77
78
79
80
81
82
83
84
85
86
87
88
89
esub("CES","GAMMA") = SMAX((i,j), aues(i,j));
ESUB("CES","N1") = 0;
LOOP((i1,i2,i3),
shr("CES",i1,"N1") = 1;
shr("CES",i2,"N2") = 1;
esub("CES","N2") = (aues(i1,i2)*aues(i1,i3)-aues(i2,i3)*aues(i1,i1)) /
(aues(i1,i3)-aues(i1,i1));
shr("CES",i3,"N1") =
(aues(i1,i2)-aues(i1,i3)) / (aues(i1,i2)-aues(i1,i1));
shr("CES",i3,"N2") = 1 - shr("CES",i3,"N1");
);
ABORT$(SMIN(n, esub("CES",n)) < 0)
"Benchmark AUES is indefinite?";
ABORT$(SMIN((i,n), shr("CES",i,n)) < 0) "Benchmark AUES is indefinite?";
90
91
92
PARAMETER
price(i)
aueschk(*,i,j)
Price indices used to verify calibration,
Check of benchmark AUES values;
93
170
94
price(i) = 1;
95
96
$ontext
97
98
$MODEL:CHKCALIB
99
100
101
102
$SECTORS:
Y
D(i)
! PRODUCTION FUNCTION
103
104
105
106
107
$COMMODITIES:
PY
P(i)
PFX
! PRODUCTION FUNCTION OUTPUT
! FACTORS OF PRODUCTION
! AGGREGATE PRICE LEVEL
108
109
110
$CONSUMERS:
RA
111
112
$PROD:Y
113
114
s:gamma k.tl:sigma(k)
O:PY
Q:1
I:P(i)#(k)
Q:(theta(i)*s(i,k))
k.TL:
115
116
117
118
$PROD:D(i)
O:P(i)
I:PFX
Q:theta(i)
Q:(theta(i)*price(i))
119
120
121
122
123
124
125
$DEMAND:RA
D:PFX
E:PFX
Q:2
E:PY
Q:-1
$OFFTEXT
$SYSINCLUDE mpsgeset CHKCALIB
126
127
128
129
SCALAR delta /1.E-5/;
SET
function /ltf, ces/;
alias (i,ii);
130
131
132
133
134
135
136
137
138
139
140
141
142
143
LOOP(function,
k(n) = YES$SUM(i, shr(function,i,n));
gamma = esub(function,"GAMMA");
sigma(k) = esub(function,k);
s(i,k) = shr(function,i,k);
loop(ii,
price(j) = 1; price(ii) = 1 + delta;
$INCLUDE CHKCALIB.GEN
SOLVE CHKCALIB USING MCP;
aueschk(function,j,ii) = (D.L(j)-1) / (delta*theta(ii));
));
aueschk(function,i,j) = aueschk(function,i,j) - aues(i,j);
DISPLAY aueschk;
144
145
*
146
171
Evaluate the demand functions:
147
$LIBINCLUDE plot
148
149
SET pr Alternative price levels /pr0*pr10/;
150
151
152
153
PARAMETER
demand(function,i,pr)
dplot(pr,function)
Demand functions
Demand function comparison
154
155
loop(ii,
156
LOOP(function,
k(n) = YES$SUM(i, shr(function,i,n));
gamma = esub(function,"GAMMA");
sigma(k) = esub(function,k);
s(i,k) = shr(function,i,k);
LOOP(pr,
price(j) = 1;
price(ii) = 0.2 * ORD(pr);
$INCLUDE CHKCALIB.GEN
SOLVE CHKCALIB USING MCP;
demand(function,ii,pr) = D.L(ii);
dplot(pr,function) = D.L(ii);
);
);
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
*
Display the comparisons:
172
173
174
$LIBINCLUDE PLOT dplot
);
175
176
DISPLAY demand;
7.8
1
Calibrating Four Factor Cost Functions
$TITLE
Numerical calibration of Nested CES from KLEM elasticities
SET
Production input aggregates / K, L, E, M/;
2
3
i
ALIAS (i,j);
4
5
*
Model-specific data defined here:
6
7
8
PARAMETER
theta(i)
Benchmark value shares /K 0.2, L 0.4, E 0.05, M 0.35/
9
10
aues(i,j)
11
12
13
14
15
16
Benchmark cross-elasticities (off-diagonals) /
K.L
1
K.E
-0.1
K.M
0
L.E
0.3
L.M
0
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:
SET
n
k(n)
37
38
39
Nests within the two-level NNCES function /N1*N4/,
Nests which are in use;
40
41
42
43
44
45
46
VARIABLES
S(i,n)
SHARE(n)
SIGMA(n)
GAMMA
OBJ
Fraction of good I which enters through nest N,
Value share of nest N,
Elasticity of substitution within nest N,
Elasticity of substitution at the top level,
Objective function;
47
48
POSITIVE VARIABLES S, SHARE, SIGMA, GAMMA;
49
50
51
52
53
54
EQUATIONS
SDEF(i)
TDEF(n)
ELAST(i,j)
OBJDEF
Nest shares must sum to one,
Nest share in total cost,
Consistency with given AUES values,
Maximize concentration;
55
56
ELAST(i,j)$(ORD(i) > ORD(j))..
57
aues(i,j) =E=
58
GAMMA +
59
SUM(k, (SIGMA(k)-GAMMA)*S(i,k)*S(j,k)/SHARE(k));
60
61
62
TDEF(k)..
SHARE(k) =E= SUM(i, theta(i) * S(i,k));
SDEF(i)..
SUM(n, S(i,n)) =E= 1;
63
64
65
66
67
*
*
Maximize concentration at the same time keeping the elasticities
to be reasonable:
68
69
OBJDEF..
OBJ =E= SUM((i,k),S(i,k)*S(i,k))
70
- SQR(GAMMA) - SUM(k, SQR(sigma(k)));
71
72
173
73
MODEL
CESCALIB /ELAST, TDEF, SDEF, OBJDEF/;
*
Apply some bounds to avoid divide by zero:
74
75
76
77
SHARE.LO(n) = epsilon;
78
79
SCALAR
solved
minshr
Flag for having solved the calibration problem /0/
Minimum share in candidate calibration;
SET
tries
Counter on the number of attempted calibrations /T1*T10/;
80
81
82
83
84
OPTION SEED=0;
85
86
LOOP(tries$(NOT solved),
87
88
*
Initialize the set of active nests and the bounds:
89
k(n) = YES;
S.LO(i,n) = 0;
SHARE.LO(n) = epsilon;
SIGMA.LO(n) = 0;
90
91
92
93
S.UP(i,n) = 1;
SHARE.UP(n) = 1;
SIGMA.UP(n) = +INF;
94
95
*
Install a starting point:
96
97
98
99
100
101
SHARE.L(k)
S.L(i,k)
GAMMA.L
SIGMA.L(k)
SDEF.M(i)
=
=
=
=
MAX(UNIFORM(0,1), epsilon);
UNIFORM(0,1);
UNIFORM(0,1);
UNIFORM(0,1);
= 0; TDEF.M(k)
= 0; ELAST.M(i,j)
= 0;
102
103
SOLVE CESCALIB USING NLP MAXIMIZING OBJ;
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
solved = 1$(CESCALIB.MODELSTAT LE 2);
IF (solved,
minshr = SMIN(k, SHARE.L(k)) - epsilon;
IF (minshr EQ 0,
k(n)$(SHARE.L(n) = epsilon) = NO;
S.FX(i,n)$(not k(n)) = 0;
SHARE.FX(n)$(not k(n)) = 0;
SIGMA.FX(n)$(not k(n)) = 0;
DISPLAY "Recalibrating with the following nests:",k;
SOLVE CESCALIB USING NLP MAXIMIZING OBJ;
IF (cescalib.modelstat gt 2, solved = 0;);
minshr = SMIN(k, SHARE.L(k)) - epsilon;
IF (minshr=0, solved = 0;);
);
);
);
IF (solved,
ELSE
);
DISPLAY "Function calibrated:",GAMMA.L,SIGMA.L,SHARE.L,S.L;
DISPLAY "Function calibration fails!";
124
174
C0
r
@
@
@
C1 r
@
@
@prp C2
pp
pp
p
r
r
p
pp
rp
@
p
pp
p
pp
p
pp
p
pp
pp
p
pp
p
pp
pp
pp
pp
pp
pp
pp
p
pp
pp
pp
pp
pp
pp
pp
pr
p r Ck
@
@
@r
prp
p
@
@r
pj
pp
pp
pp
pp
pp
pp
pp
pp
p r CL
r
pi
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, pi and pj are arguments of C(p). Assume that the cost function C(p) is nested. In the
simplest two level case, we would have:
!1/1−σ0
X
C(p) =
θk ck (p)1−σ0
k
in which:
!1/1−σk
ck (p) =
X
k
αik p1−σ
i
i∈Ik
where Ik 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
figure 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 C0 (top level), C1 , . . . , CL .
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:
xi = x̄i
7.9.1
CL
pi
σL CL−1
CL
σL−1
...
C0
C1
σ0
= x̄i pi−σL C0σ0
L
Y
Cnσn −σn−1
n=1
The Own-Price Elasticity of Demand
By Shephard’s lemma the derivative of Cn with respect to pi 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
X̄n =
x̄j
j∈In
and
0
∂Cn =
x̄i
∂pi p=1
X̄
n
i∈
/ In
i ∈ In
We then can compute the compensated own-price elasticity of demand for good i:
!
L
X
∂xi σn − σn−1
ηi ≡
= −σL + x̄i σ0 +
∂pi p=1
X̄n
n=1
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 pi and pj . (See Figure 7.1).
The cross derivative can then be computed using the demand function for xi , taking into account
the impact of pj on Ck , Ck−1 , . . . , C0 :
"
#
k
∂xi ∂C0 X
∂Cn
= x̄i σ0
+
(σn − σn−1 )
∂pj p=1
∂pj
∂pj
n=1
One means of representing the dependence of xi on pj is with the Allen-Uzawa elasticity-of-substitution
which:
k
X
∂xi C0
σn − σn−1
= σ0 +
σij ≡
∂pj xi xj
Xn
n=1
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
Download