tutorialGAMS.pdf

(824 KB) Pobierz
1
Chapter 1
General-Equilibrium Modeling using GAMS and MPS/GE: Some Basics
This chapter begins a tutorial on applied general-equilibrium modeling using the specific
software of GAMS and MPS/GE. Before plunging into things, I want to let you know what I will
not cover and what you need to know before continuing.
First, I will not provide a detailed tutorial on GAMS notation and syntax. For these you
can consult the GAMS web site: www.gams.com . Click on documentation, and then on GAMS -
A User’s Guide. This will give you a lot of the basics you need to know. Unfortunately, this
guide is badly out of date and focuses entirely on optimization problems, whereas applied GE
modeling generally involves solving square systems of equations and inequalities. But the user’s
guide will give you the syntax and notation as I indicated. Try going through chapters 2 and 3
before continuing with this tutorial. Hopefully, sometime soon we will try to rewrite the user’s
guide.
Second, you will need to consult the GAMS web site for a copy of the software. I believe
that a demonstration copy is currently provided for free, but this can change of course. Older
versions of the software require the use of an external editor. You best bet for starting is to just
use the DOS editor used under the DOS prompt. You could of could use a word processor and
save your program each time as an ascii text file, but this is clumsy, awkward, and time
consuming.
Again, consult the user’s guide for how to actually run a program and find and view the
output. This set of notes is limited, I am afraid, to actually formulating applied problems into
code and it is beyond the scope of my time and patience to describe and teach that which
logically comes first. The latter needs improvement over what is currently on the web site, but I
will have to leave that to others.
James R. Markusen
Boulder, February 2002
924640899.001.png
2
1. Introduction to applied general-equilibrium modeling
This is a set of notes to introduce you to applied general-equilibrium modeling and
software used to analyze applied GE problems. First some general comments about general-
equilibrium modeling.
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 are mediated by markets and prices
(4)
Equilibrium occurs when endogenous variables (e.g., prices) adjust such that
(i)
agents, subject to the constraints they face, cannot do better by altering their
behavior
(ii)
markets (generally, not always) clear so, for example, supply equals demand in
each market.
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
3
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 is an applied GE model? It begins by 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 tend 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.
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
4
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 equilibrium, the weak inequality may hold as a
strict equality, in which case there is positive output. If it holds as a strict inequality, (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. This is referred to as a
complementarity problem in mathematics, and the associated variables are referred to as
complementary variables.
Software other than that used here (GAMS and MPS/GE) 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.
5
2. Steps in Applied General-Equilibrium Modeling
Here are the “normal” steps in applied general-equilibrium modeling.
(1)
Specify dimensions of the model.
Numbers of goods and factors
Numbers of consumers
Numbers of countries
Numbers of active markets
(2)
Chose functional forms for production, transformation, and utility functions; specification
of side constraints.
Includes choice of outputs and inputs for each activity
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.
By “consistent” we mean 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.
Zgłoś jeśli naruszono regulamin