Uncontrolled

Download Report

Transcript Uncontrolled

cy evaluation
options
escription of the
reality
rategic planning
Complex observed
economic process
Included details
Apply theoretical framework and
mathematical methods to point out
only essential details
Conceptual model
(stylized facts)
Focus on important assumptions
and casual mechanisms
Analytical model
Attach the numbers to variables
Stylized model
Exogenous variables
Endogenous
variable
D     * P   *Y
Parameter: price
coefficient of demand
Parameter: income
coefficient of demand
Endogenous
variable (criteria
for policy
evaluation)
Uncontrolled
exogenous variables
D     * P   *Y
Uncontrolled
parameter
Uncontrolled
parameter
Policy variable
The two parts of GAMS
First part
Second part
Designing
Solving
THE CORE OF GAMS
It is a language for defining the
variables and equations in the model
It describes equations in an ordinary
text file (ASCII format)
Create the model
It is a set of solvers
Each of them is a complex program
for finding the solution to a specific
type of problem.
Run the model
Menu headings
Buttons
For cutting and
pasting text and for
undoing mistake
For arranging the
windows in different
ways on the screen
For opening libraries that is
models that are already
implemented in GAMS
For searching and
replacing text within For making macros ,
GAMS files
importing and exporting
spreadsheets, and other
tasks
For opening and saving files,
For getting assistance in
running programs, printing
how to use GAMS
and setting operations
DISKETTE: for
saving files
A: For checking to make sure
parenthesis are balanced
RED ARROW: for running
a GAMS program
FLESHING BUTTONS:
for different types of
searches
OPEN FOLDER: for
opening files
PRINTER: for
printing a file
Working Files
Project
Folder
Select the folder created (clicking on it)
MARIAGAMS is the name of previously
created folder to be selected
Type the name of
the project and
click on open
Working Files (model and output)
1.
FILE
Folder
2. NEW
Project
Write the model
and save it
3. Write
the
model
4. Save as
Declaration
Definition
Declaration
Definition
Declaration
VARIABLES
D(i) Quantity demanded
S(i) Quantity supplied;
POSITIVE VARIABLES
P(i)
Equilibrium prices;
Definition:
specification of
the variable type
Declaration
Definition
Name given by the
user to the model
List of equations
that are part of
the model
Example
SOLVE <name of model> USING <method> ;
Syntax
First alternative
a(i)
b(i)
f(i)
z(i)
Intercept demand function
/meat
1.07
fish
1.012/
Price coefficient of demand
/meat
-0.804
fish
-3.09/
Intercept supply function
/meat
1.03
fish
0.47/
price coefficient of supply
/meat
1.08
fish
4.87/;
Second alternative
a(i)
b(i)
f(i)
z(i)
Intercept demand function
/meat 1.07, fish 1.012/
Price coefficient of demand
/meat -0.804, fish -3.09/
Intercept supply function
/meat 1.03, fish 0.47/
price coefficient of supply
/meat 1.08, fish 4.87/;
By mistake FIS has been
written instead of FISH
Error message
General Algebraic Modeling System
Error Messages
170 Domain violation for element
GAMS Rev 239 WIN-VS8 23.9.1 x86/MS Windows
General Algebraic Modeling System
Compilation
10/14/12 11:03:54 Page 1
1 *GAMS model market equilibrium in a closed economy
2 SETS
3 i
Commodity trade
4
/Meat
5
Fish/;
6 PARAMETERS
7 a(i)
Intercept demand function
8 b(i)
Price coefficient of demand
9 f(i)
Intercept supply function
……………………………………………..
Declaration in line 11
Definition (two times)
in line 15
Referenced in line 28
SETS
i
Commodities
PARAMETERS
a
b
f
z
Intercept demand function
Price coefficient of demand
Intercept supply function
Price coefficient of supply
VARIABLES
D
P
S
Quantity demanded
Equilibrium price
Quantity supplied
EQUATIONS
DEMAND
Demand equation
EQUIL
Equilibrium equation
SUPPLY
Supply equation
MODELS
CLMKEQ
Model Statistics SOLVE CLMKEQ Using MCP From line 36
MODEL STATISTICS
BLOCKS OF EQUATIONS
BLOCKS OF VARIABLES
NON ZERO ELEMENTS
DERIVATIVE POOL
CODE LENGTH
3
3
12
10
0
GENERATION TIME
0.047 SECONDS
EXECUTION TIME
=
=
SINGLE EQUATIONS
SINGLE VARIABLES
NON LINEAR N-Z
CONSTANT POOL
0.047 SECONDS
6
6
0
16
4 Mb WIN239-239 Jul 8, 2012
4 Mb WIN239-239 Jul 8, 2012
To see
equations
click on the
elements in
solEQU
To see
solution
values click
on the
elements in
solVAR
Display
Imports after quota
Export supply
Price
S
Price
Pmd
pw
D
0
Imports before quota
Home market
Import demand
Quantity
0
QT Q
World market
Quantity
P
S
A
B
Pe
D
C
0
Qe
Q
Lost and captured by consumers
Price
S
Lost and captured by
government
Pw
B
C
DPS =A
DB = C+E
PHimport
A
DCS=-A-B-C-D
D
E
PFexport
NSG = E-B-D
D
0
QS
Producer loss
QD
Quantity
Terms of trade
gain
Consumer loss