Building and Running General Equilibrium Models in EViews
B. Essama-Nssah
Poverty Reduction Group (PRMPR)
The World Bank
Washington. D.C.
Abstract
A crucial step in policy analysis involves computing consequences of policy
actions. This paper shows how to implement numerically a general equilibrium model in
EViews. Computable general equilibrium models are now commonly used in both
developed and developing countries to assess the impact of external shocks or economic
policies on the structure of the economy or the distribution of welfare. The current
version of EViews offers a set of tools for building and solving simulation models in
general. The same tools make it possible to conduct policy analysis within a general
equilibrium framework. Based on the generalized Salter-Swan framework and
macroeconomic data for Indonesia, the paper demonstrates how to process a social
accounting matrix (SAM), specify and calibrate the model, and run simulations. The
results replicate welfare and structural effects of shocks and policies consistent with the
underlying conceptual framework. They also reveal the key role played by structural
parameters, such as the elasticity of export transformation and that of import substitution,
in determining the extent of structural adjustment to shocks, and the relevance of the
policy response.
JEL Classification: C63, C68
World Bank Policy Research Working Paper 3197, January 2004
The Policy Research Working Paper Series disseminates the findings of work in progress to encourage the
exchange of ideas about development issues. An objective of the series is to get the findings out quickly,
even if the presentations are less than fully polished. The papers carry the names of the authors and should
be cited accordingly. The findings, interpretations, and conclusions expressed in this paper are entirely
those of the authors. They do not necessarily represent the view of the World Bank, its Executive Directors,
or the countries they represent. Policy Research Working Papers are available online at
http://econ.worldbank.org.
1. Introduction
This paper explains how to set up and run a general equilibrium model for policy
analysis using EViews1 as a computing platform. A public policy is a collective choice
made either by the whole society for itself (using a voting mechanism) or for society by
its elected representatives (Quade 1982:3). The quality of such a choice hinges critically
on the nature of the underlying process. In a broader sense, the process involves four
phases: (i) understanding the relevant issues; (ii) searching for feasible courses of action;
(iii) adopting and implementing the most desirable ones; and (iv) monitoring and
evaluating the consequences to determine whether intended outcomes are being attained
in a desirable manner.
The search for feasible actions and the identification of the most desirable among
the feasible are necessarily constrained by the analytical input. The reliability of such
input is in turn determined by the reliability of the underlying view of the world or
organizing framework, and the information set to which this framework applies. There
are at least two approaches in policy-making. The normative approach involves
essentially: (i) the specification of the workings of society and instruments of policy
intervention; (ii) the selection of an evaluation criterion; and (iii) the computation of
values of the instruments that will either maximize the criterion or lead to some
improvement of performance as measured by the chosen criterion. The standard way to
proceed under this approach is to maximize a social welfare function subject to the
economy's resource and technology constraints as if the government could set activities
and make all decisions for all economic agents. The outcome of such a process is
supposed to be implemented by a set of competitive and complete markets subject to the
prevailing ownership of resources (Dixit 1996: 4-5).
The positive approach, as expressed in the public choice or the contractarian
framework is based on the distinction between the policy regime (or constitution) that
governs the whole policy-making process and individual policy acts (Dixit 1996:13).
This approach, which emphasizes the political economy of policy-making, generally
1EViews stands for Econometric Views, a Windows version of a software designed by Quantitative Micro
Software (QMS) primarily for time-series analysis and for the conduct of general econometric analysis.
This paper is based on version 4.1 (November 4, 2003). The language is based on the fundamental concept
of object, a collection of related information and operations.
1
relies on a game theoretic approach to predict how various actors would behave in
response to perceived policy-induced payoffs.
Whether one adopts the positive or the normative approach to policy-making, the
ability to compute the consequences of policies is of crucial importance. In this context,
simulation models can help a great deal. In particular, computable general equilibrium
(CGE) models are now commonly used both in developed and developing countries as a
means for evaluating the impact of external shocks or of economic policy on the structure
of the economy or the distribution of welfare. Devarajan and Robinson (2002) review the
use of CGE models to influence public policy. They note that such models have
contributed to policy debates on structural adjustment, international trade2, public
finance, agriculture, energy and environment. This widespread use is due not only to
rapid development in computing technology3, but also to the fact that general equilibrium
models offer the possibility to study differential impacts across sectors of production and
across socioeconomic groups, and the opportunity to account for interaction among
different sectors and economic agents. In addition, the approach provides a consistent
framework for the assessment of tradeoffs associated with different policies.
A model is a logical picture of a phenomenon. Analytically, it is represented by a
set of one or more equations that jointly describe the relationship between a group of
variables. Typically, equations that enter an EViews model may be simple identities or
derived from various estimation procedures. The model object combines these equations
into a single entity which may be used to create deterministic or stochastic joint forecasts
or simulations of all the variables in the model.
The variables of the model are divided into two basic categories. The first
category, known as exogenous variables, consists of those variables that are determined
2In particular, the two authors provide an account of the use of CGE models in the North American Free
Trade Agreement (NAFTA) debate to study issues such as: (1) the distribution of costs and benefits among
the three partners (Canada, Mexico and the U.S.A.); (2) the impact of the agreement on employment and
wages in the U.S.; (3) the impact of NAFTA on the migration between Mexico and the U.S.; (4) impact of
NAFTA on agriculture, automobile industry and textiles in the three countries; and (5) impact of NAFTA
on the bilateral trade balance between Mexico and the U.S.
3 Robinson, Yunez-Naude, Hinojosa-Ojeda, Lewis and Devarajan (1999) describe how to implement
multisectoral CGE models in GAMS (General Algebraic Modeling System), a high-level modeling system
for mathematical programming problems. The system was developed by a team led by Alex Meeraus.
Simple general equilibrium modeling in Excel is presented by Devarajan, Go, Lewis, Robinson and Sinko
(1997).
2
outside the model. Variables that are determined inside the model are known as
endogenous variables. They constitute the second category. EViews can handle only
square systems to the extent that each equation in the model must have a unique
endogenous variable assigned to it. Thus, any variable that is not assigned as an
endogenous variable is considered exogenous to the model. This is a crucial fact that
must be borne in mind. Thus, for a model to have a unique solution, it is desirable that
the number of independent equations be equal to the number of endogenous variables.
Model specification uses either inline or linked equations. An inline equation
shows the specification of the equation as text within the model. A linked equation
imports its specification from an external EViews object such as an estimation object.
Equations may also be distinguished according to whether they are stochastic or
identities. Stochastic equations are expected to hold only up to random error. Typically,
they result from statistical estimation procedures. There exists a special category of
exogenous variables associated with stochastic equations. These are known as add
factors because they are used to shift the results of a stochastic equation to provide a
better fit to historical data or to fine-tune the forecasting results of the model. Identities
are expected to hold exactly. They usually represent accounting relationships among
variables.
The solution of a model provides a set of values for endogenous variables that are
consistent with a given set of exogenous variables. Here, consistency means that the
equations of the model are satisfied within some numerical tolerance. The solution
process requires that we first associate data with each variable in the model by binding
each of the model variables to a series in the workfile. This will often entail a
modification of the name of the variable to generate the name of the series that will
contain the values associated with a particular solution. For instance, for an endogenous
variable called y in the model, EViews may assign solution values to a series in the
workfile called y_0, depending on the aliasing rule. Aliasing is a name mapping
procedure that allows the variables in the model to be mapped into different sets of
workfile series without having to alter the equations of the model.
When applied to endogenous variables, aliasing protects historical data from
being overwritten. For models that contain lagged endogenous variables, aliasing allows
3
one to bind the lagged variables either to the actual historical data (in the case of a static
forecast), or to the values solved for in the previous periods (in the case of a dynamic
forecast). In the case of exogenous variables, aliasing is applied when using model
scenarios. A scenario represents a set of assumptions concerning variables that are
determined outside the model (i.e. exogenous variables). In a scenario, one can change
the path of an exogenous variable by overriding the variable. When a variable is
overridden, the values for that variable will be fetched from a workfile series specific to
that scenario. The name of the series is formed by adding a suffix associated with the
scenario to the variable name. The same suffix will be used when storing the solutions of
the model for the scenario.
The outline of the paper is as follows. Section 2 is an introduction to simple
general equilibrium modeling using the generalized Salter-Swan model (also known as
the 1-2-3 model4) of an open economy. We consider two variants of this framework.
The first is a stripped down version with three representative agents: a producer, a
consumer and the rest of the world. Following a description of the basic structure of this
variant, we demonstrate its numerical implementation using a simple example from de
Melo and Robinson (1989). In particular, we show how to analyze welfare and structural
implications of external shocks such as foreign capital inflow and the deterioration of the
terms of trade. The second variant, presented in Section 3 of the paper, introduces
government, savings and investment in the basic framework. The empirical
implementation is based on a macroeconomic social accounting matrix (SAM) for
Indonesia in 2002. Concluding remarks are made in Section 4.
2. A Basic Model of a Small Open Economy
In this section we consider the simplest model of a small open economy. We rely
on the Salter-Swan framework, which provides a foundation for the study of the impact
of macroeconomic imbalances and adjustment policies on the real sector of a small open
economy. We then present an analytical expression of the model before proceeding to
numerical implementation.
4Because it refers to one country with two sectors of production and three goods (Devarajan, Lewis and
Robinson 1990:627).
4
2.1. The Salter-Swan Framework
This single-country model (as opposed to multi-country trade model) represents a
significant improvement on the standard neoclassical trade model which often leads to
implausible empirical results. Such results are due to two basic assumptions. The first
assumption states that all goods are tradable while the second implies perfect
substitutability between foreign and domestic goods. These two assumptions imply the
law of one price according to which domestic prices of tradable goods and services are
determined by the world market.
Crucial within the Salter-Swan framework is the distinction between tradable and
non-tradable goods and services. Non-tradable are goods and services whose prices are
determined by supply and demand conditions within domestic markets. Prices for
tradable goods are determined by the world market. The fact that a good is non-tradable
may be due to its nature (i.e. public services or construction) or to prohibitive transport
costs that keep it off the world market. Thus, some policy changes can cause some goods
to switch categories.
The standard Salter-Swan model is a two-sector, general equilibrium model
involving three types of goods: a non-tradable; an exportable and an importable good.
The country is assumed small vis-à-vis international trade, and therefore faces a perfectly
elastic excess supply from the rest of the world. In other words, it cannot affect the terms
at which it is trading with the rest of the world. Exportable and importable goods can
therefore be aggregated in a single class of good, tradable, using world prices as weights.
The institutional framework replicates a perfectly competitive economy with three
representative agents: (1) a producer who maximizes revenue subject to technical
feasibility and primary factor endowment; (2) a consumer who maximizes utility subject
to an overall budget constraint; and (3) the rest of the world. The equilibrium is assumed
to be a full employment equilibrium. Factor and commodity prices are sufficiently
flexible to maintain this status. Therefore, there is no need to explicitly model factor
markets.
The standard Salter-Swan model focuses on the effects of external shocks on the
real exchange rate which ultimately directs resource allocation within the economy. The
5
underlying assumptions describe the best of all worlds: perfect competition at home and
free trade abroad. Because the country is assumed small, all tradable goods can be
aggregated into a single good. The trade balance is exogenous. Factor homogeneity
combined with price flexibility ensures that all markets clear. Finally, domestic and
foreign goods are perfect substitutes in consumption.
Some of the assumptions underlying the standard Salter-Swan model limit its
applicability to the study of trade policy in developing countries. Disaggregating the
tradable sector into exportable and importable and distinguishing these from non-tradable
commodities lead to two relative prices that change independently from each other even
if world prices are given. Furthermore, the real exchange rate upon which the analysis
focuses is not a policy instrument directly accessible to the government. The model
therefore does not include policy instruments such as taxes nor does it permit
consideration of macroeconomic effects (Devarajan, Lewis and Robinson 1990: 638).
The basic model could therefore be extended either by relaxing some of the assumptions
deemed too restrictive or by adding actors and or markets depending on the issues at
hand. For now, we focus on relaxing the assumption of perfect substitution between
domestic and foreign goods as formulated in de Melo and Robinson (1989). In Section 3,
we consider an additional actor (government) and a modification of spending behavior of
domestic actors to allow for saving and investment.
2.2. Analytical Expression
Both the standard Salter-Swan model described above and the core extension
under consideration are structured by the two most fundamental principles of economics:
optimization and equilibrium. We thus present the structure of the model in three blocks:
(1) the production possibilities that determine the optimal allocation of resources between
the production of home goods and exports, (2) the consumption possibilities, and (3)
equilibrium conditions.
6
Production Possibilities
It is assumed that the output Xs, which is fixed in the short run, is either consumed
locally or exported. The variables Xd and Xe stand respectively for the amount of output
supplied to the domestic market and the amount exported. Assuming aggregate output is
fixed in the short run is equivalent to assuming full employment of all primary factors of
production. Thus factor markets are not modeled explicitly. The production possibility
frontier is described by equation (2.1) as a constant elasticity transformation (CET)
function where the elasticity is given by = 1
-1.
2.1 X s = Ax Xe + (1-)X d
[ ]1
Since the producer is assumed to maximize profit subject to the above technical
transformability constraint and marketing opportunities available at home and abroad, the
optimal ratio of exports to domestic sales is given by the following equation5.
1
2.2 Xe -1
=
X d 1- Pe
Pd
where the domestic price of exports is defined by equation (2.3) as the exchange rate, R,
times the world price of exports, e.
2.3 Pe = R e
The nominal value of aggregate output is given by equation (2.4) where Px may
be interpreted as a gross domestic product (GDP) deflator6.
2.4 Px X s = (Pe Xe + Pd X d )
5For a derivation of this result see Essama-Nssah (1991a: 48).
6 The optimal value of GDP can be defined by the following envelope function:
GDP = maxPe Xe + Pd X d s.t. X s = Ax Xe + (1-)X d
[ ]
1
This implies the following
expression for the deflator: Px = Ax Pe
-1[ - (+1) + (1-)- Pd (+1)]1
+1 .
7
Consumption Possibilities
The analysis of the consumption possibilities is analogous to that of production
possibilities. The consumer is supposed to minimize the cost of a composite consumption
good which is defined as a constant elasticity of substitution (CES) aggregate of imports
and domestic goods. The aggregation function is given by equation 2.5. The elasticity of
substitution is defined as: = 1
.
1+
1
2.5 Qs = Bq Qm + (1- )Dx
[ - - ]-
The optimal ratio of imports to domestic goods (in consumption) is determined by
the relative price of domestic goods with respect to imports as shown in the following
equation.
1
1 +
=
2.6 Qm
Dx 1- Pd
Pm
The domestic price of imports is defined in a manner analogous to the definition
of the domestic price of exports (equation 2.7). It is equal to the exchange rate times the
world price of imports.
2.7 Pm = R m
Equation 2.8 defines the nominal value of the composite consumption good.
2.8 PqQs = (PmQm + Pd X d )
According to equation 2.9, total income of the household is equal to GDP plus the
local currency equivalent of the balance of trade (Sf).
2.9 Yh = Px X s + RS f
Assuming that the household does not save any part of its income, equation (2.10)
states that household demand for the composite consumption good is equal to total
household income divided by the price of the composite good7.
7In a manner analogous to the case of the GDP deflator, it can be shown that this consumer price index can
be written as (Essama-Nssah 1991a:51): Pq = Bq Pm
-1[ (1- ) + (1- ) Pd (1- )] 1
1- .
8
2.10 Qd = Yh
Pq
Equilibrium
There are three equilibrium conditions that must hold in addition to the fact that
the household budget constraint is satisfied as implied by equation (2.10). These
conditions are stated in equations (2.11)-(2.13): The supply of home good is equal to its
demand, similarly for the composite consumption good. Foreign saving is equal to the
world market value of imports minus that of exports.
2.11 X d = Dx
2.12 Qs = Qd
2.13 mQm -eXe = Sf
2.3. Numerical Implementation
Data Framework and Closure
Numerical implementation entails fitting the above described analytical structure
to a data set representing the state of the economy for the period under consideration.
Usually, it is believed that the data set represents base year equilibrium. The resulting
empirical model may then be used to conduct counterfactual simulations in order to
examine the likely change in equilibrium values of endogenous variables induced by
changes in some exogenous variables. One may also conduct sensitivity analysis to study
the implications of changing the values of some structural parameters underlying the base
line results.
The necessary data for an empirical economy-wide model must be organized in a
frame that reflects the circular flow of economic activity for the chosen year. The social
accounting matrix (SAM) offers such a framework. It provides an analytically integrated
data set which reflects various aspects of the economy such as production, consumption,
trade, accumulation and income distribution. A SAM is a square matrix , the dimension
of which is determined by the institutional setting underlying the economy under
consideration. Each account is represented by a combination of one row and one column
9
with the same label. Each entry represents a payment to a row-account by a column-
account. Thus, all receipts into an account are read along the corresponding row while
payments by the same account are recorded in the corresponding column. In accordance
to the principles of double-entry bookkeeping, the whole construct is subject to a
consistency restriction which make the column sums equal to the corresponding row
sums. This restriction also means that the SAM obeys Walras' Law in the sense that, for
a n-dimensional matrix, if the (n-1) accounts balance, so must the last one. Table 2.1
shows the structure of the SAM underlying the core model.
Table 2.1. Structure of the SAM Underlying the Core Model
Activity Commodity Household Rest of World Total
Activity Domestic Sales Exports Total Sales
Commodity Household Total
Consumption Absorption
Household Payments to Balance of Total
Factors of Trade Household
Production Income
Rest of World Imports Total Earnings
of Rest of the
World
Total Total Factor Total Supply of Total Total
Payments Consumption Household Expenditure by
Goods Expenditure Rest of World
Given the base year values, the first step in numerical implementation entails
model validation whereby structural parameters are suitably chosen such that the base run
replicates base year values of endogenous variables as closely as possible (given base
year values of exogenous variables). As stated earlier, it is desirable that such a solution
be unique, which generally requires that the number of independent equations be equal to
the number of endogenous variables. EViews syntax enforces this idea by requiring a
10
one-to-one mapping between equations and endogenous variables8. Such a map is a
function of model closure, which in turn depends on assumptions made about the
functioning of the economy.
Table 2.2. Baseline Data
Activity Commodity Household Rest of World Total
Activity 75 25 100
Commodity 100 100
Household 100 0 100
Rest of World 25 25
Total 100 100 100 25
Data Source: de Melo and Robinson (1989: 59)
The following assumptions will help determine some exogenous variables. The
small country assumption implies that both the world price of exports (e) and imports
(m) are exogenous. If we choose the aggregate consumption good as numéraire, then its
price (Pq) can be set exogenously equal to unity. Full employment of primary factors of
production means that real output is fixed. Therefore Xs is taken to be exogenous.
Furthermore, we assume that nominal exchange rate adjusts to bring the trade account
into balance. This assumption makes the balance of trade (Sf) an exogenous variable.
Box 2.1 shows the core model in EViews. The model consists of 10 equations and 10
endogenous variables. The two equilibrium conditions 2.11 and 2.12 are handled
implicitly by letting a single variable stand for both supply and demand. Finally, it can
be shown that the three equilibrium conditions are not linearly independent by Walras'
Law. Therefore any one of those can be left out of the system of equation describing the
model.
We now present the entire program designed to set up the model, produce the
baseline solution and simulate structural adjustment to external shocks, namely an
increase in foreign transfers and a deterioration in the terms of trade. The data base is
presented in Table 2.2. The program includes four basic components. The first sets up
8A model is termed square when the number of endogenous variables is equal to the number of
independent equations.
11
the social accounting matrix. The second specifies the CGE model. The third component
initializes the variables and calibrates the model under five different cases depending on
the assumed values of the transformation and substitution elasticities. The final
component produces the base solution and performs the desired simulations.
Box 2.1 The Core Model in EViews
XE = XD*( (PE/PD) * (1 - alpha)/alpha )^(1/phi)
PE = EXR*PWE
PX = (PE*XE + PD*XD)/XS
XD = XS - XE
QQ = bq*( beta * QM^(-rho) + (1 - beta) * XD^(-rho) )^(-1 / rho)
QM = XD*( (PD/PM) * beta/(1 - beta) )^(1/(1 + rho))
PM = EXR * PWM
PD = (PQ*QQ - PM*QM)/XD
YH = PX*XS + EXR*BOT
EXR * BOT = (PM*QM - PE*XE )
To begin with, we use the following command to create a workfile called
DMR89. The option U for "undated" is selected since we are not dealing with time
series. The range of the workfile is set to 5 because we will solve and simulate the model
under five different values of the key elasticities.
WORKFILE DMR89 U 5
Baseline Data Processing
In setting up the SAM, we rely on the syntax governing the matrix object in
EViews. Since there are four accounts in the SAM we create a 5x5 matrix where the fifth
element stands for the total. The following labels are used: (1) ACT Activity; (2). COM
Commodity; (3). HHD Household; (4). ROW World; (5). TOT Total. The following two
commands declare the matrix and the associated column vectors:
MATRIX(5,5) MSAM
FOR %AC ACT COM HHD ROW TOT
VECTOR(5) V{%AC}
NEXT
The following 9 commands fill in the column vectors with relevant base year data.
The total of each column is computed as the sum of the previous entries in the account.
12
VACT(3)=100
VACT(5)=@SUM(VACT)
VCOM(1)=75
VCOM(4)=25
VCOM(5)=@SUM(VCOM)
VHHD(2)=100
VHHD(5)=@SUM(VHHD)
VROW(1)=25
VROW(5)=@SUM(VROW)
The following loop loads the vectors in the SAM. To avoid cluttering the workfile,
each vector is deleted after its placement in the SAM.
!COL=1
FOR %AC ACT COM HHD ROW
COLPLACE(MSAM,V{%AC},!COL)
DELETE V{%AC}
!COL=!COL+1
NEXT
The following loop computes the row total separately and places the results in a
column vector VTOT. The vector is also deleted once it has been placed in the SAM.
!NRWS=@ROWS(MSAM)
FOR !R=1 TO (!NRWS-1)
ROWVECTOR RV{!R}=@ROWEXTRACT(MSAM, !R)
VTOT(!R)=@SUM(RV{!R})
DELETE RV{!R}
NEXT
COLPLACE(MSAM,VTOT, !NRWS)
DELETE VTOT
One has the option of turning the matrix into a table using the FREEZE command
and labeling both rows and columns within a single loop. This is done by the next chunk
of program.
FREEZE(TABSAM) MSAM
SETLINE(TABSAM,3)
SETCOLWIDTH(TABSAM,1,12)
!COL=2
!RW=4
FOR %LB ACTIVITY COMMODITY HOUSEHOLD WORLD TOTAL
SETCELL(TABSAM,1,!COL,%LB,"C")
SETCELL(TABSAM,!RW,1,%LB,"L")
!COL=!COL+1
13
!RW=!RW+1
NEXT
Model Specification
The first step in model specification is to declare the model object by letting the
model name follow the keyword "MODEL" as in the following statement: MODEL DMR.
Once the model has been declared, the APPEND command is used to enter the relevant
equations based on the selected closure. We organize the model specification in three
blocks: (1) production possibilities; (2) consumption possibilities; and (3) system
constraints. The three blocks are presented in Box 2.2 below.
Box 2.2. Model Specification in EViews
Production Possibilities
DMR.APPEND PX=(PE*XE + PD*XD)/XS 'Producer price
DMR.APPEND PD=(PQ*QQ - PM*QM)/XD `Price of domestic sales
DMR.APPEND PE=EXR*PWE 'Domestic price of exports
DMR.APPEND XE = XD * ( (PE/PD) * (1 - alpha) / alpha )^(1 / phi) 'Export Supply
DMR.APPEND XD=XS XE 'Domestic Sales
Consumption Possibilties
DMR.APPEND PM=EXR*PWM 'Domestic price of imports
DMR.APPEND QM = XD * ( (PD / PM)*beta / (1 - beta) )^(1 / (1 + rho)) 'Import Demand
DMR.APPEND QQ=bq*( beta*QM^(-rho) + (1-beta)*XD^(-rho) )^(-1/rho) 'Composite Good
DMR.APPEND YH=PX*XS + EXR*BOT 'National income
System Constraints
DMR.APPEND EXR*BOT=(PM*QM -PE*XE )'Solve for the exchange rate
'Compute two Versions of Real Exchange Rate
DMR.APPEND RPD=EXR/PD
DMR.APPEND RPX=EXR/PX
We have appended to the model two more equations which do not appear in Box
2.1. The two equations allow us to consider two versions of the real exchange rate
defined as the nominal exchange rate deflated by a domestic price index. We consider
two indices, the price of domestic sales and the GDP deflator.
The treatment of system constraints deserves further explanation. In general this
is where one specifies market equilibrium and other conditions governing
macroeconomic balance. As explained earlier, factor market equilibrium is handled
14
implicitly by making the output variable (XS) exogenous. Domestic market equilibrium
is also treated implicitly by letting the variable XD stand for both supply and demand. A
similar treatment is reserved to the material balance for the composite consumption good.
Here the variable QQ stand for both supply and demand. The only condition we state
explicitly relates to the balance of trade. As written, it implies that the nominal exchange
rate is an endogenous variable. This is due the syntactical rule according to which the
variable appearing first in the specification of an equation is considered by EViews as
the endogenous variable defined by the given equation.
Calibration, Initialization and Baseline Solution
The mathematical structure presented above hinges on a few parameters (shift,
share and elasticity) that must be specified in order to make the model numerically
compatible with the base year observations contained in the SAM. This entails a process
known as calibration whereby the values of the structural parameters are expressed as
functions of the relevant model variables. When base year values of variable are used in
these expressions and the model is solved using the resulting parameter values, we obtain
the baseline solution.
The following block of statements does two things. It declares all variables using
a loop controlled by a string variable the values of which correspond to the names of the
variables. The remaining statements assign initial values to the declared variables.
FOR %VR BOT EXR PD PE PM PQ PWE PWM PX QQ QM RPD RPX XD XE XS YH omega
sigma
SERIES %VR
NEXT
BOT=0
PD=1
PWE=1
PWM=1
XD=MSAM(1,2)
EXR=1
PE=1
PM=1
PQ=1
PX=1
RPD=EXR/PD
RPX=EXR/PX
QQ=MSAM(2,5)
QM=MSAM(4,2)
15
XD=MSAM(1,2)
XE=MSAM(1,4)
XS=MSAM(1,5)
YH=MSAM(3,5)
For the purpose of calibration, it seems convenient to create a satellite model to do the
job. We call this model CALIBER. Since we would like to calibrate the model for five
different sets of values for the transformation elasticity (omega) and the elasticity of
substitution (sigma) we use the FILL command to create the two series. We will see that
these parameters are key determinants of the way the economy responds to shocks and
policies. The first command in the next block declares the calibration model. The next
two create 5 different structural cases. The APPEND statements specify the calibration
model. Finally, setting the scenario to ACTUALS and invoking the SOLVE statement assigns
solution values to the parameters.
MODEL CALIBER
omega.fill 0.2, 0.5, 2, 5, 5000000 '
sigma.fill 0.2, 0.5, 2, 5, 5
CALIBER.APPEND rho=(1/sigma) - 1
CALIBER.APPEND phi=(1/omega) +1
CALIBER.APPEND alpha=1/(1 + (PD/PE)*(XE/XD)^(phi ) )'Share for the CET function
CALIBER.APPEND ax = XS/(alpha*XE^phi + (1-alpha)*XD^phi )^(1/phi) 'Scale factor for the CET
function
CALIBER.APPEND beta=( (PM/PD)*(QM/XD)^(1+rho) )/(1 + (PM/PD)*(QM/XD)^(rho+1) ) 'Share
for the CES function
CALIBER.APPEND bq = QQ/(beta*QM^(-rho) + (1-beta)*XD^(-rho) )^(-1/rho) 'Scale factor for
the CES function
CALIBER.SCENARIO ACTUALS
CALIBER.SOLVE(s=d, d=s,o=n)
The baseline solution of the model DMR is obtained from the first three statements in
the next block of commands. The very first command set the solution options as follows:
(1) s=d (deterministic solution); (2) d=s (static solution); (3) c=1e-15 (convergence
criterion); and (4) o=n (Newton solution algorithm). The last two statements in that same
block create a table, called BASELINE, which contains both actual and baseline solution
values of all the endogenous variables.
DMR.SOLVEOPT(s=d, d=s,c=1e-15, o=n)
DMR.SCENARIO(c) BASELINE 'Option "c" makes the baseline scenario the comparison scenario
SOLVE DMR
DMR.MAKEGROUP(a) BASEGRP @ENDOG
FREEZE(BASELINE) BASEGRP
16
Table 2.3. Baseline Solution
Omega Sigma EXR PD PX RPD RPX XD XE QM QQ
0.2 0.2 1.00 1.00 1.00 1.00 1.00 75.00 25.00 25.00 100.00
0.5 0.5 1.00 1.00 1.00 1.00 1.00 75.00 25.00 25.00 100.00
2 2 1.00 1.00 1.00 1.00 1.00 75.00 25.00 25.00 100.00
5 5 1.00 1.00 1.00 1.00 1.00 75.00 25.00 25.00 100.00
5000000 5 1.00 1.00 1.00 1.00 1.00 75.00 25.00 25.00 100.00
Source : Computed (Variable definition: Exchange rate, EXR; Price of Domestic sales, PD; GDP
deflator, PX; Real exchange rate based on price of domestic sales, RPD; Real Exchange Rate based on
GDP deflator; Domestic sales, XD; Exports, XE; Imports, QM; Absorption, QQ).
Table 2.3 above confirms that model calibration was successful since the baseline
solution reproduces the values observed in the SAM.
Structural Adjustment to External Shocks
When an economy undergoes a shock (be it an exogenous or a policy shock), its
structure may change significantly and such a change is likely to have significant welfare
implications. We consider first the implications of an increase in foreign transfers as
represented by an increase in the exogenous variable BOT from 0 to 10. The
implementation of this situation in EViews is handled by the following six lines of code.
SERIES BOT_ftr=10
DMR.SCENARIO(n, a=ftr) Foreign Transfer Increase
DMR.OVERRIDE BOT
DMR.SOLVE
DMR.MAKEGROUP(c) FTGRP @ENDOG
FREEZE(DUTCH) FTGRP
The impact of an increase in foreign transfer is assessed by comparing the
baseline solution (with BOT=0) and the solution when BOT=10. The model scenario9
9The distinction between data associated with different scenarios is based on the aliasing rule. This rule
entails a modification of the names of model variables by adding an underline followed by an alphanumeric
suffix. This rule is specified by the "a" option in the scenario statement. In our case the option is stated as
a=ftr (for foreign transfers). This suffix is used by EViews to modify the name of endogenous variables
under this scenario. It is important to note that overridden exogenous variables must be created with the
proper suffix prior to invoking the override command. Otherwise, EViews issues an error message. There
17
allows us to do this without overwriting previous data. Essentially, what the above code
does is to: (1) specify a scenario called "Foreign Transfer Increase"; (2) create an
override variable BOT_ftr to hold the new values of the exogenous variable; (3) specify
BOT as an override series for the scenario; (4) solve the model again; (5) store the results
in a group called FTGRP (option "c" causes EViews to include values from the
comparison scenario) ; and (6) turn the group into a table called DUTCH10.
Table 2.4. Welfare and Structural Implications of an Increase in Foreign Transfers
Omega Sigma EXR PD PX RPD RPX XD XE QM QQ
0.2 0.2 0.43 1.21 1.04 0.36 0.42 78.06 21.94 31.94 108.08
0.5 0.5 0.71 1.11 1.02 0.64 0.70 77.67 22.33 32.33 108.99
2 2 0.91 1.04 1.01 0.87 0.90 76.63 23.37 33.37 109.61
5 5 0.96 1.02 1.00 0.94 0.96 75.92 24.08 34.08 109.80
5000000 5 0.96 1.02 1.00 0.94 0.96 76.08 23.92 33.92 109.81
Source : Computed
Table 2.4 contains the welfare and structural implications of an increase in foreign
transfer equivalent to 10 percent of base year GDP under five different structures of the
economy depending on the assumed values of the elasticities of the export transformation
(omega) and import substitution (sigma). Based on the chosen indicator QQ, it is clear
that welfare is uniformly higher in this case than in the baseline scenario. Also, the
higher the elasticities of transformation and substitution, the higher the increase in
welfare11.
are two special scenarios known as actuals and baseline. These scenarios cannot contain overrides or
excluded variables. The actuals scenario writes the solution for the endogenous variables back into series
with the same names as model variables. This creates a risk of losing original (or historical data). The
baseline scenario modifies names according to the prevailing aliasing rule. By default, the baseline
scenario adds an underline and a zero to the names of the endogenous variables.
10In reference to the "Dutch disease" phenomenon representing the deterioration of the Netherlands' export
competitiveness associated with the exploitation of natural gas fields in the 1970s (Benjamin and Devarajan
1985).
11 De Melo and Robinson (1989:59) present similar results based on a solution obtained with GAMS
(General Algebraic Modeling System). They note that, in the limit, when the elasticity of export
transformation is infinite, the increase in welfare is equal to the transfer itself.
18
The structural adjustment of the economy to this shock hinges crucially on the size of
the elasticity of import substitution. Devarajan and Lewis (1990: 633-638) present a
qualitative analysis which clarifies the role of the elasticity of import substitution in this
adjustment process. Given that the foreign transfer goes entirely to the consumer, there
will be an increase in total consumption (and hence welfare) as noted above. The
structure of the new equilibrium in terms of the combination of domestic goods and
imports depends on the aggregation function defining the composite consumption good.
When the elasticity of import substitution is close to infinity the domestic good and
imports are almost perfect substitutes. Thus all extra foreign exchange will finance
imports and there will be no change in the amount of domestic good consumed. If the
elasticity of substitution were zero, the domestic good and imports would be perfect
complements and more of both would be consumed in the new equilibrium. The increase
in the demand for the domestic good requires an increase in its price (relative to that of
exports). This leads to real appreciation of the exchange rate. On the production side,
resources will shift out of the export sector to meet the increase in the demand for the
domestic good. This adjustment is known as the Dutch disease. It is clear that the results
presented in Table 2.4 fall within the two limits described here. Real appreciation is
more significant for lower values of the elasticity of substitution. In short, an increase in
foreign transfers will cause real appreciation or not depending on the value of the
elasticity of substitution (sigma). In the case of real appreciation, both the production and
consumption of the domestic good increase along with imports while the supply of
exports declines. If there is no appreciation the entire shock is absorbed by an increase in
imports.
The analysis of a deterioration of the terms of trade is entirely analogous to that of an
inflow of foreign exchange. The next chunk of code implements a 10 percent increase in
the world price of imports. The corresponding simulation results are presented in Table
2.5 below.
SERIES PWM_tot=1.10
DMR.SCENARIO(n, a=tot) Terms of Trade Schock
DMR.OVERRIDE PWM
DMR.SOLVE
DMR.MAKEGROUP(c) TOTGRP @ENDOG
19
FREEZE(DETOT) TOTGRP
Table 2.5. Welfare and Structural Implications of a Deterioration of the Terms of Trade
Omega Sigma EXR PD PX RPD RPX XD XE QM QQ
0.2 0.2 1.13 .92 .97 1.23 1.16 74.34 25.66 23.32 97.49
0.5 0.5 1.02 .96 .98 1.06 1.04 74.64 25.36 23.05 97.59
2 2 0.95 .99 .98 .96 .97 75.44 24.56 22.32 97.70
5 5 0.93 .99 .98 .94 .95 76.01 23.99 21.81 97.78
5000000 5 0.93 .99 98 .94 .95 76.17 23.83 21.66 97.79
Source : Computed
As a result of this adverse terms of trade shock, the same amount of exports
would now buy fewer imports. In order to increase exports to pay for more expensive
imports there has to be real depreciation of the exchange rate (a decrease in the price of
the domestic good relative to the price of the export good). This will induce a resource
movement away from the domestic to the export sector. Whether or not there is real
depreciation depends on the relative importance of the income and substitution effects
associated with the terms of trade shock. Devarajan, Lewis and Robinson (1990:636)
explain that the income effect would dominate the substitution effect when the elasticity
of import substitution is less than one. As shown in table 2.5, the domestic sector would
contract while the export sector would expand. There would be no structural change in
the economy when the elasticity of substitution is equal to one. When this elasticity is
greater than one, the substitution effect dominates the income effect and the export sector
contracts while the domestic sector expands. These results are also confirmed by table
2.5.
The above discussion reveals that the relevance of the policy response to external
shocks depends on the structure of the economy. When the elasticity of import
substitution is less than one, the policy advice is to depreciate the real exchange rate to
mitigate the effects of an adverse terms of trade shock. Otherwise, real exchange
appreciation is advocated for the substitution of domestic goods for more expensive
20
imports. This would lead to a contraction of the aggregate volume of trade (Devarajan,
Lewis and Robinson 1990: 637).
3. Including Government, Savings and Investment
As stated earlier, the simple model described above can be further extended in
several dimensions. One may add new economic agents, modify the institutional
framework or the behavior of previously included agents depending on the issue at hand.
We now consider adding a government and modifying the behavior of three agents (the
consumer, the government and the rest of the world) by assuming that they save part of
their income. The institutional framework now includes a reduced-form capital market
that transforms savings into investment. The inclusion of the government allows the
consideration of fiscal issues linked to available tax instruments, and to government
expenditure. All these extensions necessarily entail a modification of the model
structure. These modifications are translated through new SAM accounts, and new
equations (Table 3.1 and Box 3.1).
3.1. Structure
Table 3.1. Structure of the SAM Underlying the Extended Model
Activity Commodity Household Government Investment World Total
Activity Domestic Export Exports Total Sales
Sales Subsidies
Commodity Household Government Investment Total
Consumption Consumption Absorption
Household GDP at Transfers Foreign Household
Factor Remittances Income
Cost
Government Indirect Tariffs Income Tax Government
Taxes Revenue
Savings Household Government Foreign Total
Savings Savings Savings Savings
World Imports Total
Imports
Total GDP Total Total Government Total Total
Market Supply Household Expenditure Investment Foreign
Prices Expenditure Exchange
21
Box 3.1. A Static Model with Government, Savings and Investment
Production Possibilities
(1) X s = Ax Xe + (1-)X d
[ ]1
1
-1
(2) Xe =
X d 1- Pe
Pt
(3) Pe = R(1+ te ) e
(4) Px X s = (Pe Xe + Pt X d )
Consumption Possibilities
1
(5) Qs = Bq Qm + (1- )Dx
[ - - ]-
1
1 +
=
(6) Qm
Dx 1- Pt
Pm
(7) Pm = R(1+ tm) m
(8) PqQs = (PmQm + Pt Dx )
(9) Yh = (Px X s - 1td
+td Pt X d ) + PqThg + RThf
(10) Qh = (1- sh )(1- th )Yh
Pq
(11) Qd = Qh + Qg + Qi
Government Revenue
(12) Yg = tmR mQm + 1 td
+td Pt X d + thYh
Aggregate Saving
(13) S = shYh + Sg + RS f
Equilibrium Conditions
(14) X d = Dx
(15) Qs = Qd
(16) mQm -eXe -Thf = Sf
(17) Sg = Yg - PqQg - PqThg - teR e Xe
(18) PqQi = S
Compared to the SAM underlying the basic model the extended SAM includes
two new accounts. The government account collects indirect production taxes from the
activity account, tariffs from the commodity account and income tax from the household
22
account. Total government revenue is spent on export subsidies, government
consumption of goods and services, and on transfers to the household. The residual
represents government savings which go into the savings account. This account also
collects savings from the household and the rest of the world. As noted earlier, total
savings are spent on investment.
The inclusion of savings and investment introduces an inter-temporal dimension
to resource allocation which is revealed by the distinction between current and capital
account. The savings-investment account is the only capital account while the rest of the
accounts are current accounts. Furthermore, the intersection of the capital account and
the current account reveals the dual nature of the items included in the capital account.
Thus, savings represent both a current use of resources and a source of funds in the
corresponding capital account. Similarly, investment in physical assets bought from the
capital goods market during the current period is a source of current revenue for the
commodity account and a capital expenditure for the agent who invests12.
The analytical expression of the model is presented in Box 3.1. Given the
analogy between the extended and the basic model, we highlight only the new features.
The introduction of various taxes changes the incentive system. All prices now include
applicable taxes. The price of domestic sales Pt includes indirect taxes. The domestic
price of exports (equation 3) includes subsidies at a rate te, while the domestic price of
imports (equation 7) includes tariffs, tm. Income tax is paid by the consumer at a rate th.
Part of disposable income is saved at a rate of sh. This leads to the specification of the
consumption function presented in equation 10.
The variable Xs is now interpreted as GDP at market prices. Since indirect taxes
are paid to the government, they must be subtracted from total GDP to get GDP at factor
cost which is given to the consumer (assumed owner of the factors of production). In
12 In reality, the six accounts in the SAM framework presented here may be viewed as representative
accounts in the sense that all can be disaggregated in accordance with the available information and the
issues to be analyzed. The intersection of the saving row with the investment column represents pure
capital transactions. This block is left empty here because we are not dealing with the functioning of the
financial market. In principle, the block shows financing flows for each agent. Equality between a row
total and the corresponding column total means that total financing from all sources (savings and
borrowing) must equal total use of funds (i.e. investment in both physical and financial assets). For each
agent therefore, the excess of investment over saving is accounted for by net borrowing from all sources
(domestic and foreign).
23
addition, the household may receive transfer payments from the government (Thg in real
terms) and from the rest of the world (Thf in foreign currency). Total income of the
household is defined in equation 9. According to equation 11, total absorption now has
three components: private consumption (Qh), government consumption (Qg) and
investment (Qi).
Aggregate saving is defined by equation 13 as the sum of three components:
household savings, government savings and foreign savings. There are now two
additional system constraints or equilibrium conditions that must be satisfied.
Government saving is the difference between government revenue and government
expenditures inclusive of transfers and subsidies (equation 17). The value of total
investment equals total available savings (equation 18).
3.2. Numerical Implementation13
To illustrate the implementation of the extended model, we fit the above
analytical structure to a macroeconomic SAM for Indonesia (Table 3.2). In order to close
the model we keep the marginal propensity to save and all tax instruments exogenous.
Transfers from the rest of the world to the household are also exogenous. In general, the
macroeconomic properties of a model such as this one depend on the macro closure rule
chosen. Such a rule refers to the equilibrating mechanisms governing product and factor
markets as well as the following three basic macro balances: balance of trade,
government budget balance and savings investment balance14.
13The full computer program is presented in the annex.
14 Robinson (2003) discusses four possible macro closures for this class of models, two of which assume
full employment of factors of production while the other two do not. Assuming that output is a function of
two factors of production capital and labor, there are 10 potential macro closure variables: the GDP
deflator, the age rate, the exchange rate, investment demand, the trade balance, labor supply, government
consumption of goods and services, capital, the saving rate and the income tax rate. Macro closure rules
differ on the basis of which three (the number of macro balances in the model) of these 10 variables are
made endogenous, while all the rest are exogenous. The first full employment closure, also known as
neoclassical considers the wage rate, the exchange rate and investment demand as endogenous variables.
In the second full employment closure, the wage rate, the exchange rate and the balance of trade are
endogenous. Closure rules that assume unemployment are known as Keynesian. The first rule makes the
GDP deflator, the exchange rate and labor supply endogenous. For the second rule, the endogenous
variables are: the GDP deflator, the trade balance and labor supply. It is worth noting that the GDP deflator
is a numéraire price in the full employment case while the wage rate plays that role in the Keynesian case.
24
Our simulations are based on the following equilibrating mechanisms: (1) The
aggregate consumer good is the numéraire (thus the consumer price index is exogenously
fixed to unity); (2) the domestic good market is brought to equilibrium through
adjustment in the price of domestic sales; (3) factor markets are assumed to clear in the
background through factor price adjustment, hence Xs is fixed exogenously; (4) the
balance of trade is exogenous so that the market for foreign exchange is brought to
equilibrium by adjustment in the exchange rate; (5) for the government account, revenues
are determined by the tax system, spending is exogenous while savings are determined
residually (they are the equilibrating variable); (6) investment is savings-driven.
Base Data
Table 3.2. A Macroeconomic SAM for Indonesia (in 2002 Billion Rupiahs)
Activity Commodity Household Government Investment World Total
Activity 1040070 569942 1610012
Commodity 1042148 132219 325334 1499701
Household 1538826 19246 1558072
Government 71186 12005 110845 194036
Savings 405079 61817 -141562 325334
World 447626 447626
Total 1610012 1499701 1558072 194036 325334 447626
Data Source: LDB on Line (World Bank)
Implications of an Export Boom
What might happen if the world price of exports increased by, say, 20 percent?
Ceteris paribus, this would correspond to an improvement in the terms of trade. There is
an income and a substitution effect associated with this change and the final outcome
depends on the dominant effect. As discussed above in the case of an increase in the
world price of imports, the outcome hinges on the value of the elasticity of substitution
between imports and domestic goods. The increase in income induced by the
25
improvement of the terms of trade would lead to an increased demand for both the home
good and imports. The income effect dominates the substitution effect when the
elasticity of substitution is less than one. Thus the economy would settle at a new
equilibrium with higher levels of consumption of both the home good and imports.
Exports would be lower due to real appreciation of the exchange rate. The opposite
occurs when the elasticity of substitution is greater than one as shown in Table 3.3.
Overall, there is an increase in welfare as indicated by the higher level of private
consumption (QH) in all cases.
Table 3.3. Some Implications of an Export Boom
Omega Sigma EXR PD XD XE QM QH
0.2 0.2 5850.00 1.09 1072266.00 537746.20 537005.30 1063891.00
0.5 0.5 7478.86 1.02 1063131.00 546880.50 548260.50 1087493.00
0.75 1.26 8220.28 .99 1039696.00 570316.30 577137.70 1100896.00
2.0 2.0 8411.19 .98 1016099.00 593913.50 606213.80 1106800.00
5.0 5.0 8634.83 .97 916265.00 693747.00 729226.90 1123897.00
Source: Computed (QH: Household consumption)
An Increase in the Tariff Rate
The impact of an increase in the tariff rate is revealed by the results presented in
Table 3.4. This policy change makes imports more expensive relative to the home good.
The demand for imports would decrease as a result. There is also an appreciation of the
exchange rate that leads to a decline in exports. This confirms the observation by
Devarajan, Lewis and Robinson (1990:644) that an import tariff acts as a tax on exports.
26
Table 3.4. Effects of an Increase in the Tariff Rate
Omega Sigma EXR PD XD XE QM QH
0.2 0.2 9235.75 0.93 1040509.00 569503.10 459180.30 1037550.00
0.5 0.5 9235.77 0.93 1041167.00 568845.20 458504.80 1037525.00
0.75 1.26 9225.12 0.93 1042175.00 567837.00 457469.50 1037367.00
2.0 2.0 9235.85 0.93 1044449.00 565562.50 455134.10 1037396.00
5.0 5.0 9236.03 0.93 1050980.00 559032.00 448428.40 1037140.00
Source: Computed
Finally, we note from Table 3.4 that private consumption is uniformly lower than
in the base case. This may be due to the fact that none of the tariff revenue is transferred
to the consumer who is now facing a higher domestic price for imports with lower
income.
4. Conclusion
This paper illustrates how to implement numerically a general equilibrium model
in EViews. For concreteness and simplicity, we focus on two versions of the generalized
Salter-Swan model of a small open economy. The current version of EViews offers a set
of tools for building and solving simulation models in general. The same tools make it
possible to conduct policy analysis within a general equilibrium framework.
The implementation is presented in four steps. The first shows how to use the
matrix and table objects to set up the SAM containing baseline data. The set up is made
easier by the possibility of using the "FOR LOOP" controlled by a string variable in order
to define and place both column-accounts in the matrix, and corresponding labels in the
associated table. The second step concerns model specification, which involves a
declaration statement and a series of statements based on the APPEND command. The
number of equations entering the model depends on the number of endogenous variables
as determined by closure. Unlike a software such as GAMS, EViews can solve only
square systems where the number of independent equations is equal to the number of
27
endogenous variables. It is important to remember that EViews will treat the first
variable encountered in the specification of an equation as the endogenous variable for
that equation.
The third step involves calibration and initialization of model variables. All
variables can be declared at once using the FOR LOOP controlled by a string variable.
Most variables are initialized on the basis of values contained in the SAM. We find it
more convenient to set up the calibration process as a separate model whereby structural
values of the parameters are computed as a function of observed values of relevant
variables. The fact that EViews solves the model for each observation in the workfile
means that sensitivity analysis can be built in and performed with a single SOLVE
statement. The final step performs simulations starting with the baseline solution. The
SCENARIO procedure is a very useful tool in this context as it allows one to keep in the
same workfile solution values associated with different assumptions about some
exogenous variables. The empirical examples studied in this paper, based on artificial
data and a macroeconomic SAM for Indonesia in 2002, replicate the welfare and
structural effects of shocks and policies as predicted by the underlying conceptual
framework. They also reveal the key role played by structural parameters such as the
elasticity of transformation and that of substitution in determining the extent of structural
adjustment to shocks and the relevance of the policy response.
28
Annex : Computer Code for the Extended Model
'INDOGSS02.PRG Illustrates how to set up a CGE model based on an aggregate social
accounting matrix for Indonesia in billions of 2002 rupiahs (Data Source: LDB on Line World
Bank). The analytical structure of the model originates from Devarajan Shantayanan, Lewis
Jeffrey D. and Robinson Sherman. 1990. Policy Lessons from Trade-Focused, Two-Sector
Models. Journal of Policy Modeling 12(4):625-657.
'B. Essama-Nssah, PRMPR, The World Bank Group, September 14, 2003
WORKFILE INDOGSS02 U 5
'==========Set Up the Social Accounting Matrix====================================
'Accounts: 1. ACT Activity; 2. COM Commodity; 3. HHD Household; 4.GOV Government; 5.SVI
Capital Account; 6. ROW World; 7. TOT Total
MATRIX(7,7) IDMACSAM 'ID is country Code for Indonesia
'Define the Columns of IDMACSAM
FOR %AC ACT COM HHD GOV SVI ROW TOT
VECTOR(7) V{%AC}
NEXT
'Fill in IDMACSAM's Columns with Base Year Data
VACT(3)=1538826
VACT(4)=71186
VACT(7)=@SUM(VACT)
VCOM(1)=1040070
VCOM(4)=12005
VCOM(6)=447626
VCOM(7)=@SUM(VCOM)
VHHD(2)=1042148
VHHD(4)=110845
VHHD(5)=405079
VHHD(7)=@SUM(VHHD)
VGOV(2)=132219
VGOV(5)=61817
VGOV(7)=@SUM(VGOV)
VSVI(2)=325334
VSVI(7)=@SUM(VSVI)
VROW(1)=569942
VROW(3)=19246
VROW(5)=-141562
VROW(7)=@SUM(VROW)
'Load Vectors in IDMACSAM
!COL=1
FOR %AC ACT COM HHD GOV SVI ROW
COLPLACE(IDMACSAM,V{%AC},!COL)
DELETE V{%AC}
29
!COL=!COL+1
NEXT
'Check Row Totals
!NRWS=@ROWS(IDMACSAM)
FOR !R=1 TO (!NRWS-1)
ROWVECTOR RV{!R}=@ROWEXTRACT(IDMACSAM, !R)
VTOT(!R)=@SUM(RV{!R})
DELETE RV{!R}
NEXT
COLPLACE(IDMACSAM,VTOT, !NRWS)
DELETE VTOT
'Turn the Matrix into a Table
FREEZE(IDTABSAM) IDMACSAM
SETLINE(IDTABSAM,3)
SETCOLWIDTH(IDTABSAM,1,12)
!COL=2
!RW=4
FOR %LB ACTIVITY COMMODITY HOUSEHOLD GOVERNMENT SAVING WORLD TOTAL
SETCELL(IDTABSAM,1,!COL,%LB,"C")
SETCELL(IDTABSAM,!RW,1,%LB,"L")
!COL=!COL+1
!RW=!RW+1
NEXT
'==========Specify the CGE Model=============================================
MODEL IDGSS 'Generalized Salter-Swan Model for Indonesia
'*****Production Side*****
'Exports are Derived from the CET Function
IDGSS.APPEND XE = XD*( (PE / PDT) * (1 - alpha_x) / alpha_x )^(1 /(phi_x - 1))
'Domestic Sales as a Residual
IDGSS.APPEND XD=XS - XE
'Domestic price of exports
IDGSS.APPEND PE=EXR*PWE*(1+ te)
'Producer Price of Composite Output (GDP Deflator)
IDGSS.APPEND PX=(PE*XE + PDT*XD)/XS
'Price of Domestic Good
IDGSS.APPEND PDT*XD=(PQ*QQ - PM*QM)'Tax inclusive
IDGSS.APPEND PD=PDT/(1 + td)' Before tax
'*****Consumption Side*****
'Domestic Price of Imports
IDGSS.APPEND PM=EXR*PWM*(1+ tm) 'Domestic price of imports
'Supply of and Demand for Composite Consumption Good defined from Armington Aggregation
of Imports and Demand for Domestically Supplied Good
IDGSS.APPEND QQ=b_q*( beta_q*QM^(-rho_q) + (1-beta_q)*XD^(-rho_q) )^(-1/rho_q)
'Imports are derived from Armington Aggregation
IDGSS.APPEND QM = XD * ( (PDT / PM)*beta_q / (1 - beta_q) )^(1 / (1 + rho_q))
'Price of Composite Consumption Good
'IDGSS.APPEND PQ= (CONS_hh + CONS_gov+ INV)/QQ Numeraire
'*****Government Account*****
IDGSS.APPEND TARIFF=(tm*PWM*EXR*QM)
IDGSS.APPEND INDTAX=(td*PDT/(1 + td)*XD)
IDGSS.APPEND HHTAX=ytx_hh*Y_hh
IDGSS.APPEND Y_gov = TARIFF + INDTAX + HHTAX - (te*PWE*EXR*XE)
30
'*****Household Income and Savings*****
IDGSS.APPEND Y_hh=PX*XS -INDTAX +(EXR*TR_hh_row)'Indirect production taxes are paid
to the government
IDGSS.APPEND SAV_hh=mps_hh*(1-ytx_hh)*Y_hh
IDGSS.APPEND CONS_hh=(1-mps_hh)*(1 -ytx_hh)*Y_HH/PQ
'*****Aggregate Savings*****
IDGSS.APPEND SAVTOT= SAV_hh + (EXR*FSAV) + SAV_gov
'*****System Constraints and Closure*****
'Full capacity is assumed so that XS is made exogenous
'Domestic Demand Constraint Implicitly defined through XD
'Material Balance for Composite Consumption Good Implicitly defined through QQ
'Fiscal Balance
IDGSS.APPEND SAV_gov=(Y_gov - PQ*CONS_gov)
'Balance of Payments in Local Currency
IDGSS.APPEND EXR*FSAV=(PM*QM/(1 + tm) - PE*XE -(EXR*TR_hh_row))
'Investment-Savings Balance
IDGSS.APPEND INV=SAVTOT/PQ
'Further Constraints
'Private and Government Consumptions Remain Fixed
'==========Calibration and Initialization==========================================
'Declare Variables
FOR %VR CONS_gov CONS_hh XD EXR FSAV HHTAX INDTAX INV mps_hh omega_x PD
PDT PE PM PQ PWE PWM PX QQ QM SAV_gov SAV_hh SAVTOT sigma_q TARIFF TD TE
TM TR_hh_row XE XS Y_gov Y_hh ytx_hh MT 'MT stands for imports inclusive of tariffs to use
in calibration
SERIES %VR
NEXT
EXR=9311 'LCU (Rupiah) per US$, period average (from LDB on line)
FSAV=IDMACSAM(5,6)/EXR
te=0
PM=1
XD=IDMACSAM(1,2)
SERIES ITX=IDMACSAM(4,1)
td=ITX/(XD-ITX)
PD=1/(1+td)
PDT=PD*(1+ td)
INDTAX=td*PD*XD
QM=IDMACSAM(6,2) + IDMACSAM(4,2)'Imports inclusive of tariff
TARIFF=IDMACSAM(4,2)
tm=TARIFF/(PM*QM - TARIFF)
PE=1
PWE=PE/((1+te)*EXR)
PWM=PM/((1+ tm)*EXR)
PQ=1
PX=1
XS=IDMACSAM(1,7)
TR_hh_row=IDMACSAM(3,6)/EXR
Y_hh=(PX*XS -INDTAX+(EXR*TR_hh_row))
HHTAX=IDMACSAM(4,3)
XE=IDMACSAM(1,6)
ytx_hh=HHTAX/Y_HH
QQ=IDMACSAM(2,7)
INV=IDMACSAM(2,5)
Y_gov=TARIFF +INDTAX + HHTAX -(te*PWE*EXR*XE)
CONS_gov=IDMACSAM(2,4)
31
SAV_gov=IDMACSAM(5,4)
SAV_hh=IDMACSAM(5,3)
mps_hh=SAV_hh/((1-ytx_hh)*Y_hh)
CONS_hh=(1 - mps_hh)*(1 -ytx_hh)*Y_hh/PQ
SAVTOT=SAV_hh + SAV_gov + (EXR*FSAV)
MODEL CALIBER
omega_x.fill 0.2, 0.5, 0.75, 2, 5 'Different values of export transformation elasticity for sensitivity
analyis
sigma_q.fill 0.2, 0.5, 1.26, 2, 5 'Different values of trade substitution elasticity;
CALIBER.APPEND rho_q=(1/sigma_q) - 1
CALIBER.APPEND phi_x=(1/omega_x) +1
CALIBER.APPEND alpha_x = 1/((PDT/PE)*(XE/XD)^(1/omega_x) + 1) 'Share for the CET
function
CALIBER.APPEND a_x = XS/(alpha_x*XE^phi_x + (1-alpha_x)*XD^phi_x )^(1/phi_x) 'Scale
factor for the CET function
CALIBER.APPEND beta_q=( (PM/PDT)*(QM/XD)^(1+rho_q) )/(1+
(PM/PDT)*(QM/XD)^(1/sigma_q) ) 'Share factor for the CES function
CALIBER.APPEND b_q = QQ/(beta_q*QM^(-rho_q) + (1-beta_q)*XD^(-rho_q) )^(-1/rho_q)
'Scale factor for the CES function
CALIBER.SCENARIO ACTUALS
CALIBER.SOLVE(s=d, d=s,o=n)
CALIBER.MAKEGROUP CALGRP @ENDOG
FREEZE(CALTAB) CALGRP
'================Simulations================================================
IDGSS.SOLVEOPT(s=d, d=s, c=1e-15, o=n)
'*****Baseline Solution*****
IDGSS.SCENARIO(c) BASELINE
SOLVE IDGSS
IDGSS.MAKEGROUP(a) BASEGRP @ENDOG
FREEZE(BASELINE) BASEGRP
'*****An Increase in the World Price of Export*****
SERIES PWE_tot=1.20*PWE
IDGSS.SCENARIO(n, a=tot) BOOM
IDGSS.OVERRIDE PWE
SOLVE IDGSS
IDGSS.MAKEGROUP(c) BOOMGRP @ENDOG
FREEZE(BOOMTAB) BOOMGRP
'*****An Increase in the Tariff Rate*****
SERIES tm_tar=1.50*tm
IDGSS.SCENARIO(n, a=tar) TARIFFUP
IDGSS.OVERRIDE tm
SOLVE IDGSS
IDGSS.MAKEGROUP(c) TARGRP @ENDOG
FREEZE(TARITAB) TARGRP
'END OF PROGRAM
32
References
Agénor, Pierre-Richard. 2000. The Economics of Adjustment and Growth. San Diego
(California): Academic Press.
Armington, Paul S. 1969. A Theory of Demand for Products Distinguished by Place of
Production. IMF Staff Papers Vol. 16, pp. 159 - 176. Washington, D.C.: The
international Monetary Fund.
Bandara, Jayatilleke S. 1991. Computable Gneral Equilibrium Models for Development
Policy Analysis. Journal of Economic Surveys, Vol. 5, No.1 : 3-69.
Benjamin, Nancy C. and Devarajan Shantayanan. 1985. Oil Revenues and Economic
Policy in Cameroon: Results from a Computable General Equilibrium Model.
World Bank Staff Working Papers No. 745. Washington, D.C.: The World Bank.
__________________. and Shantayanan Devarajan and Robert J. Weiner. 1989. The
"Dutch" Disease in a Developing Country : Oil reserves in Cameroon. Journal of
Development Economics. Vol. 30: 71 - 92.
Decaluwé Bernard, Martens André and Savard Luc. 2001. La politique économique du
développement et les modèles d'équilibre général calculable. Montréal : Les Presses
de l'Université de Montréal.
de Melo, Jaime. 1988a. SAM-Based Models : An Introduction. Journal of Policy Modeling
vo. 10, No.3: 321- 325
de Melo, Jaime. 1988b. Computable General Equilibrium Models for Trade Policy Analysis
in Developing Countries : A Survey. Journal of Policy Modeling vol. 10, No.4 : 469
- 503.
de Melo, Jaime and Sherman Robinson. 1989. Product Differentiation and the Treatment
of Foreign Trade in Computable General Equilibrium Models of Small Economies.
Journal of International Economics vol. 27 : 47 -67.
Dervis, Kemal, Jaime de Melo and Sherman Robinson. 1982. General Equilibrium Models
for Development Policy. Washington, D.C.: The World Bank.
Devarajan Shantayanan and Robinson Sherman. 2002. The Influence of Computable
General Equilibrium Models on Policy. Washington, DC.: International Food
Policy Research Institute, Trade and Macroeconomics Division Discussion Paper
No. 98 (August).
33
Devarajan, Shantayanan, Go Delfin S. and Li Hongyi. 1999. Quantifying the Fiscal Effects
of Trade Reform: A General Equilibrium Model Estimated for 60 Countries. World
Bank Policy Research Working Paper No. 2162. Washington, D.C.: The World
Bank.
Devarajan Shantayanan, Go Delfin S., Lewis Jeffrey D., Robinson Sherman and Sinko
Pekka. 1997. Simple General Equilibrium Modeling. In Joseph François and
Kenneth Reinert (eds), "Applied Methods for Trade Policy Analysis: A Handbook".
Cambridge: Cambridge University Press.
Devarajan, Shantayanan, Jeffrey D. Lewis, and Sherman Robinson. 1993. External Shocks,
Purchasing Parity Power and The Equilibrium Real Exchange Rate. World Bank
Economic Review 7:45-63.
Devarajan, Shantayanan, Jeffrey D. Lewis, and Sherman Robinson. 1990. Policy Lessons
From Two-sector Models. Journal of Policy Modeling 12 (4): 625-657.
Devarajan, Shantayanan and Jeffrey D. Lewis. 1989. Structural Adjustment and Economic
Reform in Indonesia : Model-based Policies vs Rules-Of-Thumb. Cambridge, M.A.:
Harvard University.
Devarajan, Shantayanan and Jaime de Melo. 1987. Adjustment with a Fixed Exchange
Rate: Cameroon, Côte-d'Ivoire, and Sénégal. The World Bank Economic Review,
vol. No.3 : 447 -487. Washington, D.C.: The World Bank.
Dinwiddy, C.L. and F.J. Teal. 1988. The Two-Sector General Equilibrium Model: A new
Approach. Oxford: Philip Allan.
Dixit A. K. 1996. The Making of Economic Policy : A Transation-Cost Politics
Perspective. Cambridge (Massachusetts): MIT Press.
Dorosh, Paul A. and B. Essama-Nssah, and Samaba-Mamadou, O. 1996. Terms of Trade
and the Real Exchange Rate in the CFA Zone: Implications for Income Distribution
in Niger. In David E. Sahn (ed.) Economic Reform in Africa. Oxford: Oxford-
Clarendon.
Dorosh, Paul A. and B. Essama-Nssah. 1993. External Shocks, Policy Reform and Income
Distribution in Niger. Washington, D.C.: Cornell University Food and Nutrition
Policy Program. Working Paper No.40.
34
Dorosh, Paul A. and B. Essama Nssah. 1991. A Social Accounting Matrix for Niger:
Methodology and Results. Washington, D.C.: Cornell University Food and
Nutrition Policy Program, Working paper No.18.
Essama-Nssah, B. 1991a. Destabilization and Adjustment in a Small Open Developing
Economy: A Framework for Analysis Washington, D.C.: Cornell University Food
and Nutrition Policy Program (December).
_______________, 1991b. Introduction au Système de Modélisation GAMS. Washington,
D.C.: Cornell University Food and Nutrition Policy Program.
King, Benjamin B. 1985. What is a SAM ? in Graham Pyatt and Jeffrey I. Round, eds.
Social Accounting Matrices : a Basis for Planning. Washington, D.C.: The World
Bank.
Löfgren Hans, Harris Rebecca Lee, and Robinson Sherman with assistance from Thomas
Marcelle and El-Said Moataz. 2002. A Standard Computable General Equilibrium
(CGE) Model in GAMS. Washington, D.C. : International Food Policy Research
Institute (IFPRI).
Quantitative Micro Software (QMS). 2000. Eviews 4.0 User's Guide. Irvine, CA:
QMS.
Quantitative Micro Software (QMS). 2000. Eviews 4.0 Command and Programming
Reference. Irvine, CA: QMS.
Quantitative Micro Software (QMS). 2002. Eviews 4.1 Help. Irvine, CA: QMS.
Quade, E.S. 1982. Analysis for Public Decisions. New York: North-Holland.
Rattso, John. 1982. Different Macroclosures of the Original Johansen Model and their
Impact on Policy Evaluation. Journal of Policy Modeling vol. 4, No.1 : 85-97.
Roberts Barbara M. 1994. Calibration Procedure and the Robustness of CGE Models :
Simulations with a Model for Poland. Economics of Planning, 27 : 189-210.
Robinson, Sherman. 2003. Macro Models and Multipliers: Leontief, Stone and CGE
Models. Washington, D.C.: International Food Policy Research Institute (IFPRI).
________________ 1989. Multisectoral Models, in Hollis Chenery and T.N. Srimivasan,
eds., Handbook of Development Economics Vol. 2. Amsterdam: North-Holland.
_______________, Yunez_Naude Antonio, Hinojosa-Ojeda Raul, Lewis Jeffrey D. And
Devarajan Shantayanan. 1999. From Stylized to Applied Models: Building
35
Multisector CGE Models for Policy Analysis. Journal of Economics and Finance 10:
5-38.
Round, Jeffrey I. 2003. Constructing SAMs for Development policy Analysis. Lessons
Learned and Challenges Ahead. Economic Systems Research, Vol. 15, No.2: 161-
183 (June).
Sadoulet Elisabeth and de Janvry Alain. 1995. Quantitative Development Policy Analysis.
Baltimore: The Johns Hopkins University Press.
Salter, W.E.G. 1959. Internal and External Balance : The Role of Price and Expenditure
Effects. The Economic Record vol. XXXV. No. 71 : 226 - 238.
Swan, T. 1960. Economic Control in a Dependent Economy. Economic Record XXXVI:
51-66.
36