Major enhancements of @2030 modeling system

advertisement
Major enhancements of @2030 modelling system
Wolfgang Britz, May 29, 2003
@2030 in a nutshell
@2030 is a non-spatial, recursive-dynamic multi-commodity model for agricultural products. It is
solved on a yearly basis. Its parameterization is primarily based on existing FAO models, notably
the World Food Model (WFM, version 1995) and the Food Demand model (FDM). Where these
models fail to provide parameters, external sources and/or “guestimates”1 have been used to close
the remaining gaps. Behavioural parameters have been calibrated to comply with microeconomic conditions and are adjusted dynamically over time to reflect appropriately the longterm dynamics in food and agriculture.
The model consists of identically structured regional modules describing supply and demand
(food, feed and industrial use) for agricultural products where differences are expressed by
regionally specific parameterization of equations. The systems of behavioural equations for
supply and feed are based on normalized quadratic profit functions, are globally well-behaved
and linked consistently with balances and endogenous prices for energy and protein requirements.
Food consumption is determined through a Generalised Leontief expenditure system. The system
allows to calculate changes in profits of farmers and welfare of consumers, whereas public
budget effect are derived through and from changes in Producer Subsidy Equivalents (PSEs)2.
Regional and world markets are cleared by adjusting uniform world market prices so that net
trade is minimised3. Markets are treated as points, transport costs are excluded, all commodities
are assumed to be homogenous.
1
Such “guestimates” are typically based on cross-country comparisons and the specificities of agricultural
production systems.
2
The model covers PSEs for all countries monitored by the OECD, i.e. all OECD countries plus Russia, Estonia,
Lithuania, Latvia, Slovenia, Bulgaria, and Romania.
3
Global net trade is not set to zero but reverts to the discrepancy of the base year.
@2030 modelling system – major enhancements
Other important features include:

A focus on long-term developments, reflected in a number of features, most importantly
in the fact that all elasticities are dynamic. Income elasticities for instance are a function
of the income levels and decline as income levels rise.

The framework captures all food commodities, which allows to monitor changes in food
consumption patterns, food consumption (calorie intake) levels and thus draw inferences
on changes in food security.

A distinction is made between consumer and producer markets. Consumer prices for food
and fibre are for instance distinguished from producer prices for the agricultural
commodities. Processing and distribution margins represent a wedge between the two,
depending primarily on the level of economic development [not yet fully implemented].

Agricultural policies of OECD countries and selected transition economies are
represented by PSEs. Total PSEs are split into an element of market price support and a
non-price related support element. This provides a possibility to gauge the impacts of a
comprehensive liberalisation scenario that could be envisaged over the long run.

Agricultural policies for non-PSE countries are not yet comprehensively covered. The
domestic-to-international price-wedge for developing countries distinguishes policyrelated protection and “natural” protection4.
Technically, the model is realized in GAMS, a widely used tool in quantitative economic
analysis, and directly linked to HTML table and a Java based mapping tool.
4
This is often due to a lack of physical or market infrastructure and can cause significant (short-term) frictions in
international-to-domestic price transmission. Natural protection is largely is a function of the level of development
and is assumed to decrease as income and investments in infrastructure rise.
2
@2030 modelling system – major enhancements
Content
1.
Background ........................................................................................................................................... 7
2.
Country and commodity coverage......................................................................................................... 8
3.
Price system......................................................................................................................................... 12
4.
3.1.
Overview .................................................................................................................................... 12
3.2.
Consumer prices......................................................................................................................... 14
3.3.
Endogenous prices for energy and protein in feed ..................................................................... 17
3.4.
Equations in the price framework .............................................................................................. 19
The quantity framework in @2030 ..................................................................................................... 21
4.1.
Overview .................................................................................................................................... 21
4.2.
Food use ..................................................................................................................................... 23
4.2.1.
Demand system...................................................................................................................... 23
4.2.2.
Income dependent demand elasticities .................................................................................. 25
4.2.3.
Calibration of demand elasticities ......................................................................................... 27
4.3.
Partial adjustment process on the supply side ............................................................................ 29
4.3.1.
The supply system ................................................................................................................. 29
4.3.2.
Calibration of supply elasticities ........................................................................................... 32
4.4.
Feed use ..................................................................................................................................... 33
4.4.1.
Feed demand system.............................................................................................................. 33
4.4.2.
Feed conversion factors for meat and animal products ......................................................... 34
4.5.
Industrial processing .................................................................................................................. 36
3
@2030 modelling system – major enhancements
4.6.
5.
Welfare analysis ......................................................................................................................... 36
Technical documentation..................................................................................................................... 38
5.1.
Data update ................................................................................................................................ 38
5.2.
Integration of new raw data (both expost and exante) ............................................................... 39
5.2.1.
World price trends ................................................................................................................. 40
5.2.2.
Data aggregation to regions ................................................................................................... 40
5.2.3.
Feed conversion factors ......................................................................................................... 41
5.2.4.
Hodrick-Prescott filer ............................................................................................................ 41
5.3.
Calibrating behavioural functions to a new data set .................................................................. 42
5.3.1.
Regional aggregation of parameters from WFM ................................................................... 42
5.3.2.
Parameter calibration ............................................................................................................. 42
5.4.
Scenario steering of the system .................................................................................................. 44
5.5.
The base line .............................................................................................................................. 45
5.6.
Defining counterfactual scenarios .............................................................................................. 45
5.6.1.
Using the equation/variable listing for debugging ................................................................. 50
5.6.2.
A direct look at the result array with a text editor ................................................................. 50
5.6.3.
Using GAMSVIEW ............................................................................................................... 50
5.6.4.
The HTML tables .................................................................................................................. 55
5.6.5.
The mapping tool ................................................................................................................... 57
6.
Technical solution ............................................................................................................................... 58
7.
References ........................................................................................................................................... 59
4
@2030 modelling system – major enhancements
5
@2030 modelling system – major enhancements
The @2030 modelling system
The following description is thought both as technical guide to the model, and as document for a
reader interested in the system. A basic understanding of common quantitative modelling
approaches and micro-economic theory is assumed. Especially the last chapter is very technical
and can be skipped if the main interest is on the structural and methodological part of the system.
6
@2030 modelling system – major enhancements
1. Background
The FAO has recently prepared its fourth long-term outlook for world agriculture, called “World
Agriculture: Towards 2015/30” (AT2030). The predecessors were the AT2000 study of 1979, the
AT2000 study of 1987, and the AT2010 study of 1995. These studies are based on a variety of
different techniques, ranging from formal modelling approaches to soliciting, quantifying and
embedding expert knowledge. The results of these approaches are brought together into a large
accounting scheme that aims to ensure consistency between the various inputs. While the process
helps ensure consistency in the end results, it fails to retain the formal links that existed within
the various models and across the different approaches. This makes it difficult to reproduce the
baseline projections and impossible to gauge how a change in the underlying assumptions would
alter the projected baseline outcome. In short, the lack of a fully formalized system makes it
difficult to undertake and analyze alternative scenarios.
These drawbacks have been the starting point for the development of a new modelling system.
The main purpose of this effort is to provide a provisional model-based complement to the
current AT2030 exercise that allows for simple scenario analysis around the existing baseline.
The experience gathered in creating and using this system should help build-up a more
comprehensive modelling framework for long-term projections and scenario analyses5. After a
first prototype version was developed and applied for first scenario analysis in 2001, this paper
discusses the next step in the creation of such a system, one of which is meant to be a steppingstone towards the final product. With the second step now being completed, the basic structure of
the @2030 modelling system is outlined below, and the documentation is expanded to cover the
first elements of a user guide.
5
These problems were recognized by the second meeting of the ES high-level panel of experts in January 1998,
which recommended, inter alia, that thought should be given to “developing simple analytical tools for quick
evaluations of the impact of changes in major exogenous variables” (scenario analyses), and to also “drawing up
alternative scenarios for achieving WFS objectives” (planning analyses).
7
@2030 modelling system – major enhancements
2. Country and commodity coverage
The new version of the model distinguishes 36 countries or country groups, compared to the 17
found the first version. Table 1 summarizes the new regional groupings. It should be noted,
however, that parameters and base data are maintained at the individual country level which
provides for alternative aggregations. Both more aggregated and more disaggregated commodity
or country groupings can readily be derived from the existing set of data and parameters.
The resulting expansion of the system certainly offers improved impact analysis at regional level.
On the other hand, the higher level of disaggregation makes data problems more visible and the
calibration process for behavioural equations more difficult. The growing disaggregation also
increases maintenance costs and renders the process of error detection and handling more
complicated and thus more resource-intensive. Finally, the enlarged model (with now more than
10.000 equations) raises demands on software and hardware alike.
8
@2030 modelling system – major enhancements
Table 1
Country grouping in @2030
Code
Far East
CHIN
INDI
JAPA
PHIL
THAI
VIET
MYAN
SASI
EASI
Northern Africa and Near East
ALGE
MORO
TURK
EGYP
NENA1
IRAN
NENA2
The Americas
USA
CANA
MEXI
COLO
BRAZ
ARGE
LATI
Europe and FSU
EU
EUPM
OTHE
FSU
Africa
NIGA
KENY
CODR
TANZ
SUDA
SSAF
Rest
ODEV
Description
China
India
Japan
Philippines
Thailand
Vietnam
Myanmar
South Asia (Bangladesh, Sri Lanka,
Maldives)
East Asia (remaining Asian countries)
Nepal,
Algeria
Morocco
Turkey
Egypt
Mediterranean countries 1 (Tunisia, Libya,
Lebanon)
Iran
Near East remaining, without Israel
United States
Canada
Mexico
Colombia
Brazil
Argentina
Rest of South America
European Union
Central Europe
Other Europe
Former Soviet Union
Nigeria
Kenya
Zaire
Tanzania
Sudan
Sub-Saharan Africa
South Africa and Israel
9
@2030 modelling system – major enhancements
AUNZ
Table 2
Australia and New Zealand
Commodity coverage:
Crops
Cereals
Wheat, milled rice, maize, barley, millet, sorghum and other
cereals
Oilseeds
Vegetable oils, oil meals are not yet included
Roots and tubers
Cassava, potatoes, sweet potatoes, yams, and other root crops.
Tropical beverages
Cocoa, coffee, and tea
Other crops
Plantains, sugar (in raw equivalents), pulses, vegetables,
bananas, citrus, and other fruits
Animal Products
Meats, livestock, and livestock
Beef, pig meat, poultry meat, milk and milk products, eggs,
products
camel-sheep-goat meat
Other food products
Product category for commodities not accounted for in any of
the above categories. In many countries, the single most
important item of this category is fish and fish products
Non-food commodities
Tobacco, cotton lint, other fibre plants, and rubber
All commodity data are expressed in primary product equivalent unless stated otherwise.
Historical commodity balances (Supply Utilization Accounts - SUAs) are available for about 160
primary and 170 processed crop and livestock commodities. To reduce this amount of
10
@2030 modelling system – major enhancements
information to manageable proportions, all the SUA data have been converted to the commodity
specification given above in the list of commodities, applying appropriate conversion factors (and
ignoring joint products to avoid double counting: e.g. wheat flour is converted back into wheat
while wheat bran is ignored). In this way, one Supply Utilization Account in homogeneous units
is derived for each commodity in the model. Meat production refers to indigenous meat
production, i.e. production from slaughtered animals plus the meat equivalent of live animal
exports minus the meat equivalent of all live animal imports. Cereal demand and trade data
include the grain equivalent of beer consumption and trade.
11
@2030 modelling system – major enhancements
3. Price system
3.1.
Overview
The model is based on the assumption of homogenous goods. Price differences between regions
reflect hence costs - transport and transaction costs, import tariffs and export tariffs etc. – and not
differences in quality or consumer preferences. Accordingly, goods produced or consumed in any
one regions are perfect substitutes for goods produced and consumed in any other one6.
Regarding the link between regional and world markets, the @2030 modelling system
differentiates between two “types” of regions:
1. Regions where price transmission to world market depends on policy induced price
wedges according to OECD’s PSE/CSE concept. PSE/CSE data are mostly available for
developed countries, where efficient transport and marketing system link internal market
prices for standard qualities almost perfectly to border prices if policies do not interfere.
Accordingly, the only dampening factor in the model regarding transmission of world
policy changes into these regions are policy interventions by tariffs and domestic support.
2. Regions, where the price transmission is modelled based on iso-elastic price-transmission
equations. In most cases, these regions – where PSE/CSE data are missing – represent
groups of or individual developing countries. The price transmission elasticities are a
broad measure how deficits in transport and marketing infrastructure as well as policy
6
The assumption of homogenous goods is not uncommon even in system especially designed for trade policy
analysis. The AgLink system of the OECD, as an example, uses that assumption for most goods in the model, and
simply fragments some other commodities markets as in the case of beef. Computable General Equilibrium models
as GTAP and some other global trade models – as WATSIM or the market part of the CAPRI system both at the
university Bonn – are however based on the assumption of imperfect substitution between goods of different origin
and model bi-lateral trade flows. The assumption is typically represented by CES utility functions as proposed by
Armington. Given the focus @2030 – long-term orientation, food security, and agriculture in developing countries –
explicit modelling of bilateral trade flows and commodity qualities was not deemed necessary.
12
@2030 modelling system – major enhancements
interventions insulate domestic markets from international ones. A paragraph below
discusses how the price transmission elasticities are generated.
The prices and price elements in the system are shown in the following table, all measured in
constant US $.
Table 3
Price system
Price/Price
Code
Explanation
WorldPrice
Central price anchor in the system which
Endogenous
element
Uniform world
market price
Price wedge
Yes
drives all other prices
PWedge
Difference between uniform world market and
No
border prices, only present for regions with
PSE data, lines up PSE reference price with
uniform world market price in data base
Border price
BordPrice
Linked to uniform world market price via
Yes
fixed price wedge (transport and transaction
costs)
PSE market
PSEm
Market price support according to OECD
NO
definition, linear additive element
Farm gate price
FGatPrice
Raw product price at farm gate, either linked
Yes
via price transmission elasticity or PSEm to
border price
Prices for energy
FgatPrice,Ener Shadow prices for energy and protein
and protein
FgatPrice,Prot balances for feed requirements and deliveries
Producer incentive PIncPrice
Raw product price driving production
prices
allocation, farm gate price plus non-market
YES
YES
13
@2030 modelling system – major enhancements
Price/Price
Code
Explanation
Endogenous
element
PSE minus energy/protein requirements
valued with energy/protein price
Feed use incentive FeedPrice
Farm gate price of raw product minus
prices
energy/protein content of feedstuff valued
YES
with energy/protein price
Consumer price
ConsPMarg
margin
Fixed margin representing processing and
NO
marketing costs to convert raw to final
products
Consumer prices
ConsPrice
Consumer price per ton of raw product
YES
equivalent, equal to farm gate prices plus
consumer price margin
3.2.
Consumer prices
Unlike many other partial equilibrium models, @2030 clearly distinguishes producer and
consumer prices. This distinction was deemed necessary to capture the growing dichotomy
between prices at the producer and consumer level, largely caused by a growing importance of
services at the processing and marketing level. In the course of economic development, services
and production processes link to providing food are moved from the household and the village in
highly developed production and marketing chains. Whereas a villager in Sub-Saharan Africa
may crop, harvest, store, mill by hand, make dough from the resulting flour, collect fire wood and
heat his own oven to produce bread, a New Yorker orders a Sandwich to be delivered to the work
place. Accordingly, the reaction of both consumers to changes in the price of the raw product
may be quite different. We may doubt that the New Yorker will ever notice that market prices for
grains fluctuate if he uses the price of his Sandwich as the indicator. For the African villager,
14
@2030 modelling system – major enhancements
differences between raw product prices and consumer pries are however almost non-existent and
his consumption and farming decisions are very closely linked.
Whereas data on food expenditure for at least groups of goods, as well as prices for food items as
bread and pasta are provided by official statistics in developed countries, data for developing
countries are scarce. The ILO collects consumer prices in order to construct price indices, and
that source was checked for suitability to derive consumer prices for the @2030 framework.
Results were not really inviting. Prices even for neighbouring countries in Africa often fluctuated
by more than the factor of ten when converted to US $. Clearly, converting price notations from
local currencies in developing countries requires in depth knowledge regarding the economic
system, so the result was not really astonishing. Given the limited scope of the study, the
approach had to be abandoned7.
Instead, a heuristic process was chosen, making use of available statistical data for European
countries. Margins relative to farm gate prices for developed countries were derived from that
sources and set as shown in the table below. They were used for the region with the highest per
capita income. The last line shows the relative margin used for a region with a per capita income
of $500 US. Consumer price margins for any country are constructed by interpolation of between
these two points.
Table 4
Relative consumer price margins at minimum at maximum income per capita
Rice
Cereals
Sugar
Other crops
Milk &
Other
milk
animal
products
products
CMr,max
1
10
5.0
5.0
2.0
1.0
CMr,min
0.3
0.5
0.8
0.2
0.4
0.2
7
The code is however still embedded in the first lines of „cmp_data.gms“, including the necessary sets to link the
ILO codes to the one used in the @2030 modeling system.
15
@2030 modelling system – major enhancements
The following graph shows the development of farm prices and consumer price for wheat in
China in relation to the projected growth in GDP per caput.
Figure 1
Margins between producer and consumer prices
700
6000
600
5000
500
4000
400
3000
300
2000
200
1000
100
0
GD P in U S/P C
P rices in U SD /t
GDP and consumer/producer prices for wheat in China
0
1991
2000
Farm gate price
2009
2018
C onsumer price
2027
GD P p.c.
For developed countries, high processing and marketing margins for food products largely
insulate food demand from changes in agricultural raw product prices, both through low budget
shares of food expenditure in total demand and small value shares of raw products in the final
(retail) value of food. The resulting large difference between the primary agricultural product and
the final retail good functions as a buffer for swings in prices of primary products and makes
demand for the final products inelastic with respect to changes in primary products. The
difference between primary and final products typically rises with the stage of development and
makes therefore food demand in developed countries very price inelastic. Given the time
16
@2030 modelling system – major enhancements
horizons of 15, 30, 50 years, it was deemed necessary to capture and endogenize this difference
as a function of overall economic development (GDP)8.
Revision of price transmission elasticities
As already explained, price transmission elasticities are applied only for countries where
PSE/CSE calculation are missing. A check of the price transmission elasticities borrowed from
WFM revealed certain inconsistencies when reviewed in the light of the @2030 quantity
framework. In many cases, the transmission elasticities were low for regions where considerable
percentages of production or demand where exported or imported. Equally, in some cases, price
transmission elasticities were low where the country possessed significant shares on total world
trade. In order to overcome the resulting “stickiness” of the quantity framework, and
consequently, high price fluctuations of world market prices, a heuristic rule was applied: price
transmission elasticities had to exceed the maximum of (1) five times the share of trade on total
demand, (2) five times the share of trade on total supply, and (3) five times the share of trade of
that region on total world trade, and (4) 25%.
3.3.
Endogenous prices for energy and protein in feed
In many developed and a growing number of developing countries, feed use of cereals accounts
for a major share in total demand, and constitutes the major part of costs in animal production.
“Classical” behavioural functions for feed demand describe the technological relation between
animal production and feed use as functions of prices for animal products and are hence not
suitable to measure directly changes in herd sizes or conversion factors. An estimation of a dual
cost function for feed would, however, normally use animal outputs as an explanatory variable on
the right hand side, together with the prices for the feedstuff.
Explicit modelling of feeding technology can be found in programming models typically based
on a Leontief technology matrix with minimization of feed costs at given feed component prices
8
For the calibration process embedded in the current framework, it was assumed that elasticities taken from
WFM/FDM reflect consumer, and not farm gate prices.
17
@2030 modelling system – major enhancements
and constraints describing requirement needs of animals. To construct a module which reacts
plausibly to price changes, produces valid compositions of feed ratios and assigns economically
sound shadow prices to the requirement constraints. Such an (N)LP approaches are typically used
by compound feed operations to define profit maximal composition of feed ingredients. Given
the aggregation problem in linear programming, it is questionable that the approach could be
successfully applied to larger regional aggregates, let alone for a global framework such as
@2030.
Instead, an intermediate approach between the dual cost function one and the fully explicit
technology description was chosen. Of the many requirements important to determine correct
ratios, only energy and protein were selected. Using Linear Programming is hence not longer
feasible, as not more than two components could be determined given the two constraints.
Instead, all aspects which determine the optimal feed mix not related to energy and protein –
including use of man power, capital goods, energy, other requirements as vitamins or specific
proteins, availability of roughages, meadows and pastures, feedstuff not covered by the current
product list - are mapped into a dual cost function and combined with the energy and protein
balances. The resulting cost function is then driven by the difference between the farm gate price
of the feed components and the value of their energy and protein content. The latter represents the
total content of energy and protein multiplied with fixed unit price for energy and protein.
Following the same reasoning, the prices driving animal production are similar to “value added
prices” in a CGE using fixed I/O coefficients for intermediate inputs. In here, the profit function
is written as a function of net prices equal to the difference between farm gate price plus nonmarket policy support minus the value of the energy and protein requirement. The latter is
expressed as the product of fixed conversion factors for energy and protein multiplied with their
(shadow prices).
During the simulations, explicit energy and protein balances are driving indirectly the (shadow)
prices for energy and protein, which in turn - determine together with country or region-specific
output prices - feed use and production decisions. Accordingly, the model is now able to simulate
explicitly changes in the energy or protein conversion factors of animal outputs. Moreover, the
use of explicit balances ensures that a plausible relation between feed costs and returns from
animal production.
18
@2030 modelling system – major enhancements
3.4.
Equations in the price framework
Regional border prices are linked to world market prices according to the following equation 9:
FGatPricei
Equ (1)
CaliShift iFGatPric  PWi  PWedgei  PSEmi

FGatPric
PWi  PWedgei PrcTrsEli
 CaliShift i
for PSE regions
[PrcTrans_]
otherwise
Accordingly, for regions with PSE parameters, the price transmission elasticity is given by
PWi  CaliShift
PWi
, and with a PSEm of 50% and zero for the remaining
 PWedgei  PSEmi
FGatPric
i
elements would lead to a transmission elasticity of 66%. For regions without PSE data, an isoelastic price transmission elasticity is applied.
Consumer prices are derived from farm gate prices by adding a fixed margin, depending on
region, product and time. The definition of the margins is discussed below.
Equ (2)
ConsPricei  FGatPricei  ConsPMarg i
[ConsPrice_]
Farm gate prices together with prices for energy and protein and indirect PSEs define the
producer incentive prices:
Equ (3)
PIncPrice1i  FGatPricei  PSEri
 Energyi PFGatEnergy  Proti PFGatPr ot
[PincPrice1_]
In order to ensure that the incentive price stay positive even with strongly increasing shadow
prices for requirements, a smoothing function has been introduced that describes the maxima as
follows:
9
All symbols (variables, parameters, equations) shown as labeled in the GAMS code. Indices for region and year are
left out to ease readability. The codes in square brackets following the equations are the equation names used in the
modeling system.
19
@2030 modelling system – major enhancements
Equ (4)
PIncPricei 
1
2
 PIncPrice1i  Floori



2 

  PIncPrice1i  Floori    
[PincPrice]
where Floor represents one percent of the producer incentive price for an individual country
(region), production and year in the base line, and delta is equal to 5 US $. Feed use prices are
defined as the producer incentive price net of requirement values:
Equ (5)
20
FeedPricei  FGatPricei
i
i
ContentEnergy
PFGatEnergy  ContentPr
ot PFGatPr ot
[FeedPrice_]
@2030 modelling system – major enhancements
4. The quantity framework in @2030
Figure 2
Relation between quantity and price variables in @2030
Requirement
balancet
Requirement
pricest
Prodt
Levlt
Yieldt
PIncPricet
Feedt
Feed pricest
Part_adj
Indut
Prodl
Prodt-1
Foodt
Farm gate pricest
PIncPricet-1
4.1.
Consumer pricest
Market balancet
Border pricest
Tradt
World pricest
Overview
The supply side of the model distinguishes activity levels (hectares, herd sizes) and yields, the
demand side feed use, industrial processing and food consumption. According to FAO’s concept
of Supply Utilisation Accounts (SUAs), all quantities are measured in primary product
equivalents. That means especially for human consumption that each and every product
containing components of the primary product is – via appropriate conversion factors - converted
back into the equivalents of the primary product. Food, trade, stocks, etc of cookies, bread, pasta,
flour etc. are thus expressed and aggregated as their primary cereal equivalents. In some cases,
final products are “distributed” to several primary products. The levels of food consumption,
imports or exports etc. as described in the model should therefore not be confounded with actual
levels consumed or trade in terms of primary products.
21
@2030 modelling system – major enhancements
Prices in the current year determine the various demand components (food, feed, other uses) as
well as yields (crop yields and slaughter weights), whereas activity levels depend on past prices
and lagged dependent variables and describe a typical partial adjustment process towards their
desired long-term levels. Supply of animal products and feed demand are directly linked by
balances for energy and protein in feedstuff. The balances determine the (shadow) prices for
energy and protein, which in turn are deducted from the producer incentive prices of animal
produce and farm gate prices for feedstuff. The remaining “margins” drive animal supply and
feed demand.
Regional market balances are defined as follows;
Equ (6)

Prod i 1.  ShareiW ast  ShareiSeed

[RegM_]
 Feed i  Food i  Indu i  NStci  Trad i
where stock changes NStc are zero in the projection period in the current model version. As seen
in the equation above, waste and seed are coupled with fixed shares to production. The relations
had been derived from the @2030 quantity framework. The net trade position Trad links the
regional and the world market balances:
Equ (7)
 Trad
t
i ,r
 0 10
[WorldM_]
r
Production, feed, human consumption and industrial processing are driven by price-dependent
behavioural functions as discussed below. Normalized quadratic functions determine production
and use of feedstuffs, whereby “net prices” (incentive prices minus prices for energy and protein)
function as the key drivers. Food use is based on a Generalised Leontief expenditure system.
Parameters of these systems are consistent with micro-economic theory. Specifically, elasticities
are homogeneous of the degree zero, Slutzky symmetric and ensure the right curvature.
10
In the model, any imbalance found after adding resources minus sinks of all regions are introduced as a constant
on the RHS of the world market balance.
22
@2030 modelling system – major enhancements
4.2.
Food use
4.2.1. Demand system
The demand is based on the following family of indirect utility functions depending on consumer
prices ConsPrice and per capita income GdpExpe11 where G and F are function of degree zero in
prices (RYAN & WALES 1996):
Equ (8)
U (ConsPrice, GdpExpe) 
G
(GdpExpe  F )
Using Roy’s identity, the following per capita Marshallian demands PerCap are derived:
Equ (9)
PerCapi  Fi 
Gii
GdpExpe  F
G

[PerCap_]
where the Fi and Gi are the first derivatives of F and G versus own prices. The function . F is
defined as follows:
Equ (10)
F   PDtGli ConsPricei
[FGl_]
i
where PDtGl represent the constant terms of the Marshallian demand functions and can be
interpreted as “minimum commitment levels” or consumption quantities independent of prices
and income. The term in brackets in the per capita demands above hence captures the expenditure
remaining after the value of price and income independent commitments F had been subtracted
from available income GdpExpe. The function G, based on the Generalised Leontief formulation:
Equ (11)
G   Pbdij ConsPricei ConsPrice j
i
[GGl_]
j
whereby the derivative of G with respect to the product price is labelled Gi and defined as:
11
Per capita income and total expenditure are used as synonyms in the following as the demand is cover all goods
and thus exhaust available income.
23
@2030 modelling system – major enhancements
Gi j   Pbd ij
Equ (12)
[GiGl_]
ConsPricei ConsPrice j
i
Symmetry is guaranteed by a symmetric Pbd matrix describing the price-dependent terms, correct
curvature by non-negative off-diagonal elements of Pbd, adding up is automatically given, as

a( x) 
Euler’s Law for a homogenous function of degree one  a( x)  
xi  , leads to:
xi
i


 PerCap ConsPrice
i

 G ConsPrice
i
i
i
i
G
GdpExpe  F    PdtGliConsPricei
i
,
G
 (GdpExpe  F )  F
G
and homogeneity is guaranteed by the functional forms as well. The expenditure function can be
derived from the indirect utility functions and gives:
Equ (13)
GdpExpe  e(U , ConsPrice )  F 
G
U ( p, GdpExpe)
The expenditure function allows to calculate easily the equivalent variation as a money-metric
measure of changes in consumer welfare compared to a reference situation labelled with ref:
EquVal  e(U sim , ConsPriceref )  GdpExperef
Equ (14)
Gref
 Fref 
U  psim , GdpExpesim 
 Fref 
Gref
 GdpExperef
 Gsim
(GdpExpesim  Fsim )
 Fref 
Gref
Gsim
 GdpExperef
(GdpExpesim  Fsim )  GdpExperef
It should be noted that the per capita income in simulations is endogenous, as changes in
agricultural profits and the state budgets in the current year are added to the per capita income of
24
@2030 modelling system – major enhancements
the following year. The equivalent variation therefore measures the complete welfare effect in the
modelling system and not just the effect of changes in consumer prices.
Human consumption is defined as per capita consumption multiplied with population
Equ (15)
Foodi  PerCapi PopTotl
[Food_]
4.2.2. Income dependent demand elasticities
Given the long-term nature of the outlook, the constant elasticity assumption applied in other
short and medium-term models was dropped. Instead, all income elasticities were assumed to
change with rising incomes, which, according to the Slutsky equation, also typically reduces the
Marshallian elasticities for food products even if the underlying utility structure remains intact.
The relationship of income and income elasticities was derived from a cross-sectional analysis
(over the 36 countries or regions), exploiting changes in income responsiveness at different
income levels. The following equations were estimated:
 GDPr
( 1 )  i ,i ,r  a i ,1  bi ,1 ln 
 POPr
Equ (16)

  ei ,i ,r

 GDPr
( 2 )  i , j ,r  a i ,2  bi ,2 ln 
 POPr

  ei , j ,r

 GDPr
( 3 )  i ,Y ,r  a i ,3  bi ,3 ln 
 POPr

  ei ,Y ,r

where bi,1 in (1) measures a semi-log relationship the effect of per capita GDP on the own price
elasticity of product i; bi,2 (in 2) the effect of GDP/POP on the cross-price elasticities of product i;
and bi,3 (in 3) finally the effect GDP/POP on the income elasticity. The resulting slope parameters
generally decrease the absolute value of the elasticities, with especially strong effects in the case
of basic food items, i.e. “Engel goods”.
The following graphs compare original income elasticities at regional level from the WFM with
the results of the estimation process.
25
@2030 modelling system – major enhancements
Figure 3
Income dependent demand elasticities for wheat
Original and estimated income elasticities for wheat
1
Income elasticity
0.8
0.6
0.4
0.2
0
0
5000
10000
15000
20000
25000
30000
-0.2
-0.4
GDP (USD/person)
Original income elasticities (from 17 @2030 countries)
Figure 4
Estimated income elasticity (semi-log)
Income dependent demand elasticities for milk and milk products
Original and estimated income elasticities for milk and milk
products
0.8
0.7
Income elasticity
0.6
0.5
0.4
0.3
0.2
0.1
0
-0.1 0
5000
10000
15000
20000
25000
30000
-0.2
GDP (USD/person)
Original income elasticities (for 17 @2030 countries)
26
Estimated income elasticity (semi-log)
@2030 modelling system – major enhancements
Figure 5
Income dependent demand elasticities for beef
Original and estimated income elasticities for beef
1.2
Income elasticity
1
0.8
0.6
0.4
0.2
0
0
5000
10000
15000
20000
25000
30000
-0.2
GDP (USD/person)
Original income elasticities (from 17 @2030 countries)
Estimated income elasticity (semi-log)
The parameters resulting from this process were then used to calculate and calibrate the
elasticities  i2030
for the year 2030. Using the uncalibrated elasticities  ibase
for the base year, the
,i
,i
uncalibrated elasticities  i2030
are:
,i
Equ (17)
  GDP 2030 
 GDP base 




ln
2030 
base  

 POP 
  POP
 i2030
  ibase
 bi ,1 ln 
,i
,i
The cross-price and income elasticities for 2030 are derived accordingly. The elasticities for
intermediate years are a weighted average of these for the base year and 2030:
Equ (18)
2030  t  2030
 2030  t  base 
eit, j  
ei , j  1 
ei , j
 2030  base 
 2030  base 
4.2.3. Calibration of demand elasticities
As explained, the demand system discussed above is homogenous of degree zero in prices and
income, and symmetric if Pbd is symmetric. The somewhat more cumbersome proof that utility
is decreasing in prices and increasing in income as long the matrix Pbd has only positive off27
@2030 modelling system – major enhancements
diagonal elements is left out in here. The disadvantage of the restriction (for the sign of the
elements of Pbd) is that fact that the function then allows for Hicksian substitutes, only. The
function is then clearly not longer flexible which may be seen as a disadvantage in econometric
applications. Given the product list of the @2030 modelling system, the limitation was even
judged as a safeguard against curious price effects12 as complementarities for the compensated
demands are not easy to argue for.
The symmetry and non-negativity conditions are imposed during the calibration of the parameter
to the price and income elasticities borrowed from FDM and WFM. The calibration necessitates
derivatives of Marshallian demands versus prices and income from the expenditure system above
and are determined as follows:
PerCapr ,i
GdpExpe

PerCapr ,i
Equ (19)
ConsPrice r , j
Gii
Gr
 Giji , j Gii Gi j
 

2
Gr
 G

GdpExpe  F   i  j


where :
Giji , j 
Gii
 12 Pbd i , j Pbd i , j
ConsPrice j
ConsPricei ConsPrice j
i  j
The terms for the own price effects are somewhat more complicated, and therefore determined
indirectly via the homogeneity condition for elasticities during calibration. The objective function
minimizes squared differences between given and consistent elasticities, simultaneously for the
base year and the last year of the projection period. The parameters PBGl are calibrated at the
base and last year of the simulation period, with parameters for in between years constricted as a
weighted average. The PDtGl are then adjusted to observed demand quantities.
12
As an alternative, a normalized quadratic expenditure system was tested. According to the family of indirect utility
functions discussed above, the function G is then replaced by a form that is quadratic in normalized prices. However,
a Cholesky decomposition is then necessary to ensure correct curvature during the calibration process, which renders
the solution more cumbersome. An advantage of the NQ system is that fact that is allows formally for
complementarity in the Hicksian effects. In practice, that would mean that the Marshallian elasticities created by the
calibration of the NQ system have to be carefully checked for such complementarities to ensure a plausible behavior
of the demand system in simulations.
28
@2030 modelling system – major enhancements
The calibration process – similarly for feed and supply – consists of the following steps:

Aggregation of the single country elasticities from WFM/FDM to country blocks were
necessary. As reliable producer and consumer prices for single countries are not (yet)
available, the elasticity were simply weighted with quantities.

Introduction of manual corrections in the “raw” elasticity set where necessary. Especially,
missing own price elasticities and substitution elasticities in cereals were introduced,
respectively increased in size.

Derivation of cross-price elasticities via the symmetry condition if missing.

Definition of maximum and minimum bounds for calibrated elasticities.

And finally, search for set of parameters of the underlying system whose point elasticities
at given prices and quantities lead to a set of elasticities as close as possible to the “raw”
ones, using squared normalized differences as a penalty function. Appropriate constraints
on the parameters of the system ensure symmetry, homogeneity and correct curvature.13
4.3.
Partial adjustment process on the supply side
4.3.1. The supply system
The micro-economic behavioural model for farmers assumes that desired long-term production is
based on naïve price expectation, i.e. prices from the previous year. As the parameters of the
model are not estimated using the behavioural equations, and the starting point of the model is an
average of several years, a more complex price expectation was not deemed necessary.
Producers are assumed to adjust only partially to changes in these expected prices. That
mechanism is not only found in many other modelling framework like the WFM, but applied
regularly in econometric supply analysis as well by introducing lagged endogenous supply on the
right hand side. Partial adjustment approaches are typically motivated by two different types of
13
For further details, see “cal_gl.gms”.
29
@2030 modelling system – major enhancements
arguments. Firstly, assumptions regarding behaviour of individual farmers can be modelled in the
aggregate supply function by lagged responses – as cautious decision taking or the process of
slow penetration of successful market oriented behaviour into the farming community. Secondly,
the partial adjustment can be related to technological rigidities, especially to the concept of quasifixed factors in capital goods as plantation, buildings and farm equipment. Missing opportunities
to sell or alternatively use capital goods stemming from past investment decisions lower variable
production costs for the production activities linked to these quasi-fixed capital goods, and hence
reduce incentives to change production plans. Farmers are trapped by past investment decisions.
Nevertheless, as farmers receive market signals, they revise cropping pattern and adjust herd
sizes, and eventually initiate investments and production decisions to move in that direction. If
one assumes – as an example- that milking equipment has a technological life span of twenty
year, and that the effective selling price of used milking equipment is zero, one out of twenty
farmers will re-invest in milking equipment in any one year, and the price reaction of the
remaining nineteen is probably quite slow as their variable costs does not include the costs for
important capital goods. Summarizing, the partial adjustment factors hence represents the effect
of behavioural and technological assumptions regarding single farmers in the aggregate supply
response.
Depending on the assumed rigidities in production processes and decisions, price developments
in the current year will only trigger restricted adjustments in supply. The model assumes that
yields can be adjusted in the short run to a certain degree, so that supply in the current year is
determined by short time adjusted yield multiplied with the planned activity levels.
The system builds upon the following profit function at expected producer incentive prices:

 (1.  PartAdj ) PincPrice
i
*
i
CaliShift iPr od
i
Equ (20)
 1 2  (1.  PartAdji ) PincPricei* PincPrice *j PBlij
i
j
  PartAdji Prod it 1 PincPricei*
i
That equation is used to calculate part of the producer welfare in the modelling system, using
realized instead of expected producer incentive prices. The last term captures the effects of fixed
“net puts” – outputs quantities and input demands – on the profit. These fixed quantities are equal
30
@2030 modelling system – major enhancements
to a certain percentage of quantities produced or consumed in the last production period with
partial adjustment factors borrowed wherever possible from the WFM model. Some manual
corrections were deemed necessary where the difference between regions were hardly plausible.
The short-run (planned) profit maximal production quantity is derived by taking the first
derivative with respect to expected prices:
Equ (21)
Prodi 



 (1.  PartAdji ) CaliShift iPr od   PincPrice *j PBlij 
*
PincPricei
j


 PartAdji Prodit 1
The terms in brackets in the first line above define the desired long-term production quantity:
Equ (22)
Prodi*  CaliShift iPr od   PincPrice *j PBlij
[ProdFunL_]
j
which, together with lagged production and the partial adjustment factors, define short-run profit
maximal production quantities:
Equ (23)
Prodi  (1.  PartAdji ) Prodi*  PartAdji Prodit 1
[PartAdj_]
The prices are assumed to be normalized by the price index of non-agricultural goods which is
held constant in any scenario of the model. The matrix of supply effects PBL is calibrated to
supply elasticities both in the base and the final year under conditions derived from micro-theory
as described below.
Yield reacts to current year prices according to the following iso-elastic function:
Equ (24)




log Yield i  shiftiyield log PIncPricei  iyield
,i
[YieldFun_]
which define indirectly the activity levels:
Equ (25)
1
Prod i  1000
Yield i Levli
[ProdFun_]
31
@2030 modelling system – major enhancements
The producer incentive price is determined from farm gate prices and policy interventions, as
well as conversion factors multiplied with the shadow value of the requirements, as already
discussed above. These incentive prices in turn determine the expected ones in the next period:
Equ (26)
PIncPrice i*  PIncPrice it 1
4.3.2. Calibration of supply elasticities
The basic approach for the calibration of supply elasticities follows the method discussed for the
demand side. It is also based on a non-linear optimization process that minimizes squared
normalized differences between the given set of raw elasticities and the calibrated matrix:
2
Equ (27)
  Levl ,* 
  Yield ,* 
min   ij levl  1    ijYield  1

 i, j  

i , j   ij

 ij

2
s.t.

(a) Pblij  
Levl ,*
ij
(b) Pblij  Pbl ji
Equ (28)
(c )
 Pbl

Yield ,*
ij
Prod i
j


Prod i
PIncPrice j
i, j
i, j
PIncPrice j
ij

Levl ;* Yield ;*
ij
ij
(d ) Pblij   lu ik lu jki
 0 i
j  i
k j
(e)  Area,i 

crops
Levl ,*
crops,i
Levlcrops
 Levl
crops
crops
Condition (a) defines the supply effects from level and yield elasiticities at current quantities and
prices, (b) ensures symmetry, (c) homogeneity of the degree zero, and (d) guarantees a positive
definite matrix of substitution effects using a LU decomposition (the diagonal elements luii are
strictly positive). While the LU decomposition imposes a heavy computational burden, it
provides the only practical way to ensure that marginal profits of the resulting system are
increasing in prices. Compared to the earlier version, an enhanced version of the CONOPTx
solver – now version CONOPT3 – eases considerably the initialization of the above problem.i
32
@2030 modelling system – major enhancements
The additional constraint (e) on total supply responsiveness ensures that price changes cannot
result in an excessive land expansion or reduction for agricultural production.
The Pbl matrix captures the first derivatives of the supply functions with respect to own- and
cross prices, and is calibrated both for the base period and the last year of the simulation
horizon14. Pbl matrices for intermediate years are a weighted average between the ones for the
base and final year. It can be shown that the intermediate matrices are again symmetric and
positive definite15.
4.4.
Feed use
4.4.1. Feed demand system
Feed demand is based on the following normalized quadratic cost function where the feed is net
of the value of energy and protein and normalized by the general price index:
Equ (29)
FeedCost   CaliShift iFeed FeedPricei  12  BPFi , j FeedPricei FeedPrice j
i
ij
Applying Shepard’s Lemma, the following feed demands are derived:
Equ (30)
Feed i  CaliShift iFeed   BPFi , j FeedPrice j
j
where the price driving the feed composition is determined as
Equ (31)
FeedPricei  FGatPricei  FGatPriceEner ContentiEner  FGatPriceProt ContentiProt
14
For details, see “cal_elas.gms”.
15
The original cross-price supply elasticities found in the WFM between animal and crop outputs had been down-
scaled by factor ten as the new supply system is driven by “net prices” where the effect of changes in crop prices due
to feed demand is captured by the explicit prices for energy and protein.
33
@2030 modelling system – major enhancements
Feed costs are part of the welfare calculation of the modeling system as they constitute part of
agricultural profits.
4.4.2. Feed conversion factors for meat and animal products
As discussed above, the model uses explicit balances for energy and protein of feedstuff and thus
necessitates energy and protein requirements per unit of animal output produced. Several
approaches could be applied to derive such factors:
1. Engineering functions, which are based on characteristics of the production process (as
starting and final weights, daily weight increases, housing/feeding system, etc.). Data
limitations render that approach impossible at global scale with the limited resources at
hand.
2. Econometric estimation from time series on herd sizes/production output and feed use. A
separate paper discusses a Bayesian type of estimation employing a entropy estimator in a
cross-sectional time series analysis. Co-linearity between the developments of the
different herds as well as between these developments and total requirement use as well
as imperfections in the underlying data render econometrics difficult, and let the author
decide to abandon that approach.
3. Expert knowledge.
The last approach was chosen building upon the existing conversion factors from the World Food
Model. In a first step, the country specific conversion factors for grains and cakes where cut off at
certain limits (0.1;4) for grains, and (0.01;0;4) for cakes, and afterwards aggregated to average
world conversion factors, using the projected production in the year 2015 as weights. Any
country where the conversion factors were missing received in a second step that uniform world
conversion factor. The assignment process from the World Food Model was finalized by
aggregating the single country factors to average regional ones, again using the production figure
of the year 2015 as the aggregation weight.
The resulting factors suffer from different short-comings: (1) They are inconsistent with the
amount of energy/protein represented by the feed use quantities in the @2030 data base, and
34
@2030 modelling system – major enhancements
(2) the factors show a high and often hard to understand variance across regions. In order to
address both problems, a cross-entropy framework was applied. The final conversion factors
ConvFac for each region r, animal product a, requirement req and point in time t are presented as
a linear combination of so-called “support points” SP weighted with endogenous posteriori
probabilities PP:
Equ (32)
ConvFacr ,a ,req,t   SPr ,a ,req,k PPr ,a ,req,t ,k
k
The posteriori probabilities PP characterize a density distribution and must hence add up to unity:
Equ (33)
 PP
r , a , req ,t , k
1
k
The data constraints of the problem consist of balances for the requirements req energy and
protein:
Equ (34)
 Prod
a
r ,a ,t
ConFacr ,a ,req,t   FeedUSer ,i ,t Contenti ,req
i
The support points represent the a-priori knowledge, and are set as follows: the first one defines
an upper limit set derived from 0.1 kg of wheat per kg of good produced, and for cakes, it is set
close to zero. The second ones defines upper limits that represent conversion factors of 5 for
wheat and 1.0 for cakes. The a-priori probabilities for these “security” limits are set to 5% each.
The third support point that represents the “common standard” is set equal to the average
conversion factors at world level, whereby the latter one is equal to the conversion factor derived
from the WFM. The latter two receive a priori probabilities of 45% each. The elements are
integrated by maximizing the cross-entropy, i.e. the difference between the posterioriprobabilities and the a-priori ones under the constraints shown above16. The cross entropy is
defined as:
16
The standard Hodrick-Prescott filter used for all other elements of the data base and discussed below is applied to
“smooth” the factors over times, as the above estimation framework is only applied to the ex-post and forecast years
of the @2030 exercise.
35
@2030 modelling system – major enhancements
Equ (35)
CE 
 PP
r , a , req ,t , k
log PPr ,a ,req,t ,k APr ,a ,req,t ,k 
r , a , req ,t , k
4.5.
Industrial processing
Industrial processing is modelled by an iso-elastic function, with elasticities set to -0.8:
Equ (36)
4.6.




log Indui  shiftiIndu log FGatPricei*  iIndu
,i
Welfare analysis
One of the most important features of the @2030 modelling system is a closed and consistent
welfare analysis. The dual profit and cost functions on the supply and an expenditure function on
the demand side of the modelling system allow for a consistent calculation of welfare changes in
the modelling system. Using these function is not only computational elegant, but avoids problem
immanent to an iterative calculation of consumer/producer surplus by calculating the integrals
over the individual markets in a row which leads to path dependent results. But even leaving the
problem of path dependency of producer and consumer surplus calculations aside, it should be
noted that results are often doubtful as the underlying functional forms and/or their parameters
violate properties derived from profit and utility maximization. The downside of using the dual
function directly is the fact that the changes cannot be attributed to changes individual price.
Whereas changes in consumer welfare are calculated rather frequently in partial models, changes
in producer income are not. In the case of @2030, the derivation of agricultural supply and feed
demand from a dual profit function respectively a dual cost function allows to calculate changes
in profits easily and consistent to the behavioural functions in the model.
Remains the questions of the state budget, which is only relevant for counterfactual scenarios
with implicit or explicit policy changes. The only policy indicator are PSE/CSE data, and their
calculation is only partially based on budget outlays. In the absence of a better representation, the
changes in PSEs are used as a proxy for changes of the state budget. The problems behind that
assumption should clearly be noted. The so-called “PSE market” is based on price differences
between observed market prices and a reference border price. The price difference can result
from a multitude of factors, not even all of them relating to policy measures. For some countries,
36
@2030 modelling system – major enhancements
notably transition countries, less then perfect markets and missing infrastructure may cause low
internal prices, in fact, at levels below the respect international prices. But even if the price
difference is solely the effect of policy intervention, tariffs may play an important role. Reducing
the price difference in a simulation run may hence even increase the state budget if tariff
revenues decrease. Other market interventions such as purchases for public (intervention) stocks
or subsidized exports certainly result in costs, but the multiplier between the related budget
outlays and the price difference generated by the policy instrument is simply not known from
PSE data only. For direct payments, the relation is clearer, but any administration and control
costs are still not accounted for.
A specific feature of @2030 are endogenous per capita incomes during simulation runs. Changes
in agricultural profits and the state budget are mapped into changes of per capita income in the
following year. The equivalent variation hence captures the combined effect of changes in per
capita income and changes in consumer prices which are interacting with each other, and thus
provides the overall welfare measure in the modelling system. The effect of changed consumer
prices alone can be determined by calculating the equivalent variation at prices of the reference
run but unchanged per capita income. The table above summarizes the welfare indicators.
Table 5
Welfare indicators
Group
Measurement
Based on
Agricultural producers
Changes in
Agricultural profits
minus feeding costs
Normalised Quadratic Dual Profit Function
Normalised Quadratic Dual Cost Function for feed
State budget
Changes in value of
PSEs
OECD PSE data for certain countries
Consumers
Equivalent variation,
evaluated at per capita
income of base line
Generalised Leontief Expenditure System
Overall welfare effect
Equivalent variation,
evaluated at
endogenous per capita
income
Generalised Leontief Expenditure System; changes
in agricultural profits and state budget from previous
year are added to income in current year
37
@2030 modelling system – major enhancements
5. Technical documentation
Figure 6
Overview on code structure
Sets.gms
At2030.gms
dat\Aggdata.csv ?
Cmp_data.gms
dat\data_ori.csv ?
prices.gms
...
At2030pse.csv
sualiv.gms
...
Gdp.gms
dat\aggdata.csv
elas\elas.csv ?
agg_ela.gms
par\levlelas.gms
...
par\fdm_elas.gms
elas\elas.csv
elas\elasts.csv ?
cal_elas.gms
elas\elasts.csv
elas\elastd.csv ?
cal_gl.gms
elas\elastd.csv
elas\elastd.csv ?
cal_feed.gms
elas\elastf.csv
solve
out_map.gms
map\...csv
out_htm.gms
htm\...htm
5.1.
Data update
A complete data update of a larger modelling system is not an easy exercise, partly as the
parameterization of the system is typically depending on base year quantities and prices which
are used to elasticities in calibration steps. One of the first things to do before starting with the
process is a complete back-up copy of the system. The copy is not only necessary to eventually
revert back to the original code, but also to check systematically how the update has influenced
the behaviour of the system in simulations.
38
@2030 modelling system – major enhancements
5.2.
Integration of new raw data (both ex-post and ex-ante)
The system reads all data for the numerical block in comma separated variable format (CSV).
The format can be easily generated by essentially all software packages, notably spreadsheets but
also DBMS packages. The raw data are currently distributed to a list of files to be found in the
first twenty lines of “cmp_data.gms”, as shown below. They are only read, if the file “dat\dataori.csv” is not found. In order to integrate new data, it is necessary to delete “dat\data-ori.csv”.
The system will then automatically start the data integration as well as the aggregation process. In
a first step, it simply calculates some derived positions such as yields and stores the resulting data
array by re-creating “data-ori.csv” (until $label after_ori).
A first check of the process could start with the raw single country data, by putting a “DISPLAY
DATA” in the code, and simply check manually if the data have safely arrived in the GAMS
code.
Figure 7
Including the data base files
39
@2030 modelling system – major enhancements
5.2.1. World price trends
The next section in “cmp_data.gms” relates to price trends in world markets. Two sources are
used: long-term time series from FAO (stored in “dat\prices.gms”), and price forecasts provided
by the World Bank (stored in “dat\WorldBPrice.gms”). As the series does no comprise all
products of the @2030 model, some of the series had been derived by assumption.
The model uses a quadratic function to estimate a trend from the World bank price series
wherever possible. A corridor ensures that the estimates do not deviate more +/- 20% from the
highest/lowest estimate found somewhere in the World Bank time series. The error for 2015 is
further on set to zero. The results are written out into a CSV file (“prices.csv”) and can easily be
checked with a spreadsheet. If necessary, series specific upper and lower limits may be
introduced for manual corrections. The code fragment below shows the necessary equations. The
points above make it obvious that the proceeding has little in common with classical econometric
analysis. The OLS estimator is here used to create a smooth prolongation of the existing
estimates of the World Bank, using bounds for the estimates to ensure plausible results. In order
to integrate the bounds, the estimated values are defined as variable in GAMS. It is clear that it
would not be easy to embed such a framework in an econometric package. The disadvantage of
implementing estimators in GAMS is the fact that any test statistics would need to be
programmed manually.
Figure 8
Estimating long term trends of world market prices
5.2.2. Data aggregation to regions
The next block of statements aggregates from single countries to regions. There are two possible
aggregation rules (R_FROM_C, R1_FROM_C) due to the fact that single country data for EU,
40
@2030 modelling system – major enhancements
other Europe, central Europe and the Soviet Union are only available ex-post or ex-ante. The
results from that step are SUAs according to the product list of @2030 at regional aggregate level
for the ex-post period, and the @2030 projection years (2005,2010,2015,2030).
5.2.3. Feed conversion factors
The feed conversion factors come next. First, the original data conversion from the WFM – status
from around 1995 - are copied from similar products to some goods not available in the WFM.
Next, conversion factors are cut off at certain limits discussed in chapter xx above. Afterwards,
mean conversion factors for the world are calculated as production weighted averages, and
assigned to single countries where missing. The resulting matrix is then aggregated to the country
list of @2030, and converted to energy and protein requirement, using the energy content of
wheat and an assumed 45% protein content in cakes (the one of soya cake).
The resulting factors are the basis for the cross-entropy framework discussed above.
5.2.4. Hodrick-Prescott filer
As a recursive dynamic system the model is designed to work in yearly steps, whereas the
original baseline had only provided some points (2005, 2010, 2015, and 2030) in time. It is hence
necessary to construct a complete time series by interpolating from the four given points. The
easiest way would by linear interpolation between any two given points, but the resulting time
series would look kinked and thus unintuitive. Instead, a slightly modified Hodrick-Prescott filter
is applied, an instrument used in econometrics to smoothen time series. The normal Hodrick
Prescott filter combines in a penalty function the squared errors from trend function to define the
long-term components, plus squared first differences of the estimates multiplied with a weighting
factor for movements against the trend. The trend component is left out for the application at
hand, as the results from AT2030 are used as anchor points during the estimation and provided
hence a substitute for an explicit trend function. Technically, the variable “EstimY” is fixed for
the given points in the equation below. Secondly, to reduce problems with numerical stability, the
value of the time series in the year 2000 is used as a scaling factor for the penalty function.
41
@2030 modelling system – major enhancements
Figure 9
5.3.
The Hodrick-Prescott filter
Calibrating behavioural functions to a new data set
5.3.1. Regional aggregation of parameters from WFM
Supply and demand elasticities, partial adjustment factors and price transmission elasticities may
eventually need to be aggregated from single country data if the data for the base period has
changed. The process can be started by deleting the file “elas\elas.csv”. If that file is not found, a
new elasticity aggregation will be started by executing “agg_ela.gms”. Changes in that routine
are normally not necessary, it should, however, be mentioned that it comprises statements
defining elasticities for products not comprised in the WFM modelling system.
Figure 10
Elasticity aggregation
5.3.2. Parameter calibration
The calibration routines for supply, food and feed use are stored in different files. The relevant
lines from “@2030.gms” are shown below. There are three global settings which can be switched
to “YES” or “NO” in order to start the individual calibration process. The modelling system will
42
@2030 modelling system – major enhancements
stop afterwards ($exit). The process will automatically be initialized if the necessary files with
the parameters of the model cannot be found – the setting is then switched from the “NO” to
“YES”. The code with the non-linear optimization program will then be included and executed.
The three programs comprise all a set called “CRITR” which define the regions where a new
calibration is necessary. The set should normally include all regions (“CRITR(R)=YES”).
The relevant methodological issues pertaining to the parameter calibration process have already
been discussed above. For the base data framework at the time of the report, the calibration
routines worked without problems for all regions. Given the highly non-linear manner of the LU
decomposition, problems with a new data set cannot be excluded. Past experience shows that it is
often sufficient to simply restart the problems ending with infeasibilities, or to change very
slightly the starting values.
Normally, the calibration routines will use the result from the last calibration run. With changed
base data, that starting point may have been an inappropriate/unlucky one. It is usually a good
idea to simply first try to use the old values for all regions. Afterwards, a look at the listing (SET
INFES) will reveal which regions were not feasible. The next run of the calibration process
could/should then be limited to the INFES regions (exclude all regions from the dynamic set
CRITR, except those which were infeasible). Next, the lines in the code where the starting values
are loaded from file are commented out, and the problem can be re-executed. If there are still
infeasibilities remaining, this may hint at a data base problem.
43
@2030 modelling system – major enhancements
Figure 11
Calibration of parameters to new base data
With the parameters of the behavioural equations again calibrated to the new price and quantity
framework, the model is ready to be used for scenario analysis.
5.4.
Scenario steering of the system
Experience shows that it is not easy to create a user interface for larger modelling system which
allows to define and analyse scenarios. The “classical” interface for a model used for scenario
analysis would have to be able to accommodate – beforehand - a multitude of different
combinations of changes in exogenous variables. A separate interface that captures all possible
combinations is difficult to program, while an interface that is limited to a few possibilities for
changes in exogenous variables may unduly constrain the inexperienced user.
Rather than imposing the limits of a user interface, scenarios must be set up by changing the
GAMS code directly. The GAMS code for new scenarios is in fact designed such that new
scenarios can be integrated easily. The following paragraphs are will try to explain the details of
creating a new baseline as well as setting up alternative scenarios.
44
@2030 modelling system – major enhancements
5.5.
The base line
The creation of a new baseline is currently limited to re-calculating the additive and
multiplicative shift factors that match the unconstrained results from the equations with the
predetermined baseline. The calculation of the shift factors is defined as a scenario “SHS”, the
shift factors are defined as GAMS variables (CALISHIFT), their values are stored under the label
“SHS”. During the SHS run, all endogenous variables such as prices, supply, feed and food use
are fixed to their respective baseline values. The SHS scenario should always be “solved” before
any counterfactual scenarios can be analyzed. During any other scenario, the shift factors are
fixed (upper equal to lower limits) and substituted by the solver out of the equation system
(.holdfixed=1).
Figure 12
5.6.
Code fragment relating to the shift factor determination
Defining counterfactual scenarios
The following note may sound trivial for advanced modellers, but may nevertheless provide a
good starting point for a number of issues to be explained in the sequel. All prices (including
world market prices) and quantities (supply, feed, food, and industrial processing) are
endogenous variables. An analysis of the type “how would the world look when the world market
45
@2030 modelling system – major enhancements
price is 10% below the baseline” requires a change in the model structure. Why is that the case?
In the current model, the world market price is a variable which can move up and down to
equilibrate global supply and demand. Fixing one or several of the prices leads to a system with
more equation then free variables, and consequently, a solution is unlikely to exist. In order to
maintain feasibility, one has to drop one equation. There is, however, no “correct” one naturally
chosen. The same problem holds for a question like: what would happen if the production of
country r were x% higher or lower? But that question should not be confused with “what would
happen if the supply function is moved compared to the base line”? The latter is a legitimate
question for the model and the model should be able to provide an answer.
Before some technical issues are discussed, some words on how a model is solved in GAMS are
necessary. A model in GAMS consists of equations. Like in a journal paper, these equations
comprise indices – in GAMS called driving sets – and provide a kind of abstract description. Any
parameters or variables shown in equations have not yet numerical values at the point in the code
where the equation is defined. The numerical values will be loaded when the equation is used in
conjunction with a “solve” statement for a model comprising the equations. Accordingly,
different numerical values can be loaded into a GAMS equation at run time. The following figure
shows an example from the model: the behavioural equation for feed demand. The equation is
driven over all regions, products and the current year, in case there is feed demand exceeding 10
metric tons. The V(R,IM,”Feed”) is a sub-array from the model to host the endogenous variables.
The value of that variable must line up with the RHS, comprising the add-factor – another
variable - to line up the equation with base year quantities and prices, a possible shock introduced
by a scenario, the price-dependent terms.
46
@2030 modelling system – major enhancements
Figure 13
An example of an equation in the model
Name of the equation
The driving sets
When the “solve” statement in GAMS is executed at run time, the numerical values of the
variables loaded into the equations, together with lower and upper limits of variables and,
possibly, the elements of dynamic sets driving equations.
In practical terms, one may hence solve a row of scenarios in GAMS in the following way:

Assign new values to parameters in the equations (e.g. feed conversion factors)

Solve the model, and store the results somewhere (copy the “level” of the variables into
some array)

Assign another set of values to parameters in the equations (e.g. feed conversion factors)

Solve again …
Scenarios with @2030 can be broadly grouped in two types:

Changes in exogenous parameters – as price wedges, price transmission elasticities, income
per head, population or feed conversion rates. These are simply parameters in the model and
can be changed. One should take care to reset if necessary the parameters to the old values
after the simulation. Otherwise, any following simulation in the same run will be additive to
the previous changes.
47
@2030 modelling system – major enhancements

Shocks to endogenous variables. Most behavioural equations comprise shift factors to line up
the RHS to the baseline represented as variables “CALISHIFT”. These shifters should not be
changed, as own parameters called “exoshift” have been introduced in all equations in order
to introduce shocks in the system. Theses shocks allow to test e.g. different rate of technical
progress, by adding or subtracting against the yield level in the base line. The model will
adjust prices, supply, demand (and even yields) as a response to that shock.
The first step in setting up a new scenario consists of choosing a short-cut or “label” for it. That
new label should be introduced in the sets “DUMMY” and “SCEN” in wfm.gms, but always after
the “SHS” label. In “SET SCEN”, a longer description of the scenario may be added at well. All
scenarios which are not comprised in the current suite should be commented out in “SET SCEN”
(with a “*” in the first column) (see figure below).
Figure 14
Editing a new scenario, step 1: create a new set member
The new label in the
dummy set
The new label in the set of the current
scenarios and its description
The next step consists of mapping the conceptual scenario in the existing GAMS code.
Depending on the type of scenario, this means either changing elements of “exoshifts” or of some
other parameters. These changes should, however, only affect the current scenario, and relevant
statements have to be within an “IF” clause. Some examples can be found in “@2030.GMS”, as
for example:
48
@2030 modelling system – major enhancements
Figure 15
A new scenario, step 2
If clause, captures the statements
for the specific scenario
The above example shows how driving sets in combination with algebraic expression can be used
to create complex scenarios, as the above complete elimination of PSE market support until 2030
combined with a gradual increase of price transmission elasticities until 2030. It also underlines
the concerns raised above, i.e. that it is normally much more efficient to use GAMS statements,
instead of trying to build an editor for that kind of simulation.
In a third step, the model will be run, and (hopefully) solved. After necessary error corrections,
the solver should find a feasible solution with the new exogenous assumptions (variables). One
should first check if the resulting system is still a square one (same number of equations as
variables). If that is not case, there must be serious logical error in the scenario. Secondly, a look
in the listing file will reveal whether the model was feasible (the number of infeasibilities must be
zero). If that is not the case, the parameter “CHECKI” will report the endogenous variables that
have “bumped” against upper and lower limits, making it impossible for the solver to find a
solution. Unfortunately, with big non-linear problems, the solver may also report infeasibilities
despite all variables in between their bounds. That usually happens if the solution space is “flat”,
i.e. if derivatives of the sum of infeasibilities with respect to the variables are very close to zero.
Sometimes, the solver may however simply start to search in a somewhat unlucky direction. It
may help to re-set the starting values (different from the baseline) or even to tighten bounds. The
best way to tackle infeasibilities is difficult to describe beforehand – experience counts.
There are several ways to look at the results of a scenario analysis with the @2030 system:
(1) using a text editor, (2) the GAMS view tools, (3) HTML tables, and (4) maps.
49
@2030 modelling system – major enhancements
5.6.1. Using the equation/variable listing for debugging
The “hardcore” way is to use a text editor directly on the equation and variable listing of GAMS.
Whatever there is to find, there it starts. Especially if something goes technically seriously wrong,
that listing may the only way to find out where and why.
5.6.2. A direct look at the result array with a text editor
Already a little bit more user friendly is the use of the result array. Again, one may use a text
editor in the GAMS listing. Many editors have files in read access, only, and one should remind
himself to re-load the file after GAMS was run. The result array can be found by searching for
“PARAMETER RESULT”, and lists almost all variables and parameters in the equations, over
regions, products, items, times and the different scenarios.
5.6.3. Using GAMSVIEW
Instead of using a text editor, the listing may be loaded in “GAMSVIEW” as well. That utility
developed by Hans-Josef Greuel and Wolfgang Britz allows to look at any variable, equation or
parameter displayed in a GAMS listing with a kind of spreadsheet object with scroll boxes for the
different dimensions.
50
@2030 modelling system – major enhancements
Figure 16
Start up screen of GAMSVIEW
In first step, the correct listing must be loaded. In order to do so double click on “GAMS file
(LST”) in the “application setting window”. A dialogue pops up, where a second double click
opens a standard file selection dialogue.
51
@2030 modelling system – major enhancements
Figure 17
Select the GAMS list to view
The program will search all variables, equations and parameters listed and include them in a
selection box as shown in the first figure of GAMSVIEW below. By double clicking the line with
the currently selected parameter, a selection dialogue as shown below will be opened.
52
@2030 modelling system – major enhancements
Figure 18
Select the GAMS variable, equation or parameter to view
If the right element to view is selected, the window may be closed with pressing o.k., and
afterwards the view is started by using the start button .
The program will now parse the
GAMS listing and load the selected parameter into a spreadsheet like object. By default, the first
dimension will serve as columns, the second dimensions as rows, and the remaining ones are
presented as scroll boxes on top of the spreadsheet. The viewer hosts up to ten dimensional
arrays. The way the data dimension are shown can be changed with the rotation tool, press
. That will open a dialogue as shown below. Each of the grey boxes represents a data
dimension of the GAMS parameters. The number in brackets shows the order of these
dimensions as shown in the listing file, followed by the first few labels found in the listing. In our
example, the first dimension refers to years, the second to product and the third to the different
scenarios. In order to make a comparison between scenarios over time, the scenarios should be
53
@2030 modelling system – major enhancements
placed in the rows of the spreadsheet. These are shown as the second line in the selection tool. As
shown below, the user has started to drag and drop that box in the second line. Afterwards, the
box for the products should move in the third line.
Figure 19
Changing how data dimensions are shown
The resulting table looks as follows. One may now scroll through the different products with the
scroll box as shown below. The figure indicates the use of the different pushbuttons as well.
54
@2030 modelling system – major enhancements
Figure 20
GAMSVIEW after the rotating the dimensions
Export to extenal file (csv, HTML, txt ..)
Copy to clipboard
Press to as line graph
The two long push-buttons above the spreadsheet object open selection lists for the columns and
rows. One may either select with the mouse, or click on the first item in the list labelled
“Selection” which opens a dialogue. One may then type labels in the dialogue.
Figure 21
GAMSVIEW: using the selection boxes for columns and rows
5.6.4. The HTML tables
The GAMS code will automatically create HTML tables with the results of the current run
comprising the base line as the comparison points, as well as results for the different scenarios.
The start point is the file “result.htm” which comprises hyperlinks to selection tables for regions
55
@2030 modelling system – major enhancements
and years for the different types of tables provided. The following figure shows the different
switches triggering output options in the modelling system.
Figure 22
Switches for output options
The HTML tables are provided for two reasons. Firstly, they allow to look at the results in a
structured way, and thanks to the embedded hyperlinks, to navigate easily between related values.
The tables can be copied via the clipboard easily in office packages, which hopefully eases report
writing based on scenario analysis.
Secondly, they are an important tool to debug the model. Three tables per region and year are of
special interest here as they provide information about the mechanism underlying the changes in
quantities in the system. They disaggregate the changes against the baseline for supply, feed and
human consumption in the effect of changes of the own prices, all cross prices and exogenous
shocks. For supply, the lagged effect stemming from the partial adjustment process is included as
well, for human consumption the effect of changes in income.
The disadvantage of the HTML tables is the tremendous number of table created (with now 36
regions plus some regional aggregates, and a thirty year simulation period, any type of table will
be represented by more then 1000 files). It has thus been decided to provide in parallel the
underlying data in XML formats, and use XLT to convert the data into HTML on the fly.
Table 6
HTML report tables
Type
Content
Linked to
Market balances
Production
Feed
Production
56
@2030 modelling system – major enhancements
Type
Content
Linked to
Human consumption
Net trade
Production
Area/Herd
Yield
Production
Price
Decomposition Levels
Decomposition Yields
Market balance
Prices
Decomposition Levels
Own price effect
Sum of cross price effects
Lagged effect
Scenario shifter
Production
Decomposition Yields
Own price effect
Sum of cross price effects
Scenario shifter
Production
Food consumption
Price
Per capita Human consumption
Calories
Expenditure
Prices
Market balances
Food decomposition
Change to base
Own price effect
Sum of cross price effects
Income effect
Population effect
Scenario shift
Food consumption
Feed decomposition
Change to base
Own price
Sum of cross price effects
Scenario shifter
Market balances
Prices
Border price
Farm gate
Producer incentive
Feed incentive
Consumer
Food decomposition
Production
Food consumption
5.6.5. The mapping tool
The last reporting tools is as well internet based and builds upon a Java® applet. It provides
interactive maps of important result items.
57
@2030 modelling system – major enhancements
6. Technical solution
GAMS (General Algebraic Modelling System) has been chosen as the platform for the first
version of the @2030 model. It is used in conjunction with CONOPT3, a solver for non-linear
problems. GAMS is a well-established tool for solving large, non-linear models. Its main features
are:
 A compact and highly effective matrix language for basic data operations, supporting a selfdocumenting programming style
 A transparent link to a number of commercially available solvers for different types of
problems (NLP,LP,MIP,MCP etc.),
 Platform independence, i.e. portability between different Operating Systems and hardware
architectures.
 A rather broad user base both in the academics and international institutions and
 Still moderate license fees compared with concurrent packages.
It should, however, be noted that GAMS neither provides for a data-base management system nor
for any econometric features. The first shortcoming is overcome by the application of appropriate
tools linked to the projection exercise at hand; the second is of limited importance in view of the
fact that the system is largely based on synthetic parameters.
58
@2030 modelling system – major enhancements
7. References
RYAN D.L. & WALES T.J. (1996): “Flexible and Semi-flexible Consumer Demands with
Quadratic Engel Curves”. Discussion paper No.: 96-30, Department of Economics, University of
British Columbia, Vancouver Canada.
i
The author thanks Arne Drud, the brain behind the CONOPTx solvers for fruitful comments on the use of the
solver. Without Arne’s continues input in providing a stable and efficient solver, many of the methodological
solution presented in here could not be solved in a technical efficient way, and would have been abandoned.
59
Download