920 likes | 1.11k Views
FASOM. Hamburg January 17-19, 2007. Topics. FASOM Basics FASOM Equations Analyzing FASOM Modifying FASOM. I FASOM Basics. Model Scope. Natural Resources Agriculture Forestry Processing Food, Fibre, Timber, Energy Markets. Purpose and Objectives.
E N D
FASOM Hamburg January 17-19, 2007
Topics • FASOM Basics • FASOM Equations • Analyzing FASOM • Modifying FASOM
Model Scope • Natural Resources • Agriculture • Forestry • Processing • Food, Fibre, Timber, Energy Markets
Purpose and Objectives To study and advice policy makers about the agricultural and forestry sector response to • Policies • Environmental change • Technical change • Socioeconomic change
Policy Scope • Climate and other environmental policies • Research subsidies • Agricultural policies • Trade policies Simultaneous assessment
Structural Changes • Policies • Environmental change • Technical change • Socioeconomic change (population, preferences)
Methodology • Partial Equilibrium • Bottom Up • Constrained Welfare Maximization • Dynamic Optimization • Integrated Assessment • Mathematical programming • GAMS
Model Structure Limits Limits Resources Land Use Technologies Products Markets Inputs Demand Functions, Trade Processing Technologies Environmental Impacts Supply Functions Limits
Programming Declare and Assign • Indexes • Exogenous data • Endogenous data • Equations (endogenous/exogenous) Run Programs and Display Results
Regions Periods Altitudes Species Resources Cohorts Farm sizes Farm types Technologies Products Substances Major Indexes (Sets)(decl_basicsets.gms)
Sets • Identify scope • Efficient, sometimes challenging • Super sets, Sub sets, Tuples (Index maps) • decl_basicsets.gms • 2_activesets.gms • calc_tuples.gms
Exogenous Data • Resource endowments • Technologies (Inputs,Outputs, Costs) • Environmental Impacts • Demand functions • Policies • Base Year Observations
Exogenous Data • Parameters (Tables, Scalars) • decl_parameters.gms • Data_*.gms
Data Subdirectories • EPIC • FINDUS • FADN + others • OSKAR • FAO • BIODIV
Endogenous Data • Land use decisions (control variables), Impacts (state variables), Shadow prices of constraints • Positive and Free Variables • (Integer Variabales) • 4_eufasom_model.gms
Equations • Understanding them is • to understand FASOM
Equations • Objective Function • Resource Restrictions • Technological Restrictions • Environmental Accounts • Others
Major ParametersFOREST_DATA (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,FARM,AGE,ALLTECH,ALLITEM)PEREN_DATA (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,FARM,AGE,ALLTECH,ALLITEM)CROP_DATA (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,FARM,ALLTECH,ALLITEM)ECO_DATA (PERIOD,REGION,SOILTYPE,SOILSTATE,ALLTECH,ALLITEM)LIVE_DATA (PERIOD,REGION,ANIMAL,ALLTECH,ALLITEM)FEED_DATA (PERIOD,REGION,PRODUCT,ALLTECH,ALLITEM)PROCESS_DATA (PERIOD,REGION,ALLTECH,ALLITEM)PRODUCT_DATA (PERIOD,REGION,PRODUCT,ALLITEM)MARKET_DATA (PERIOD,REGION,ALLITEM,SDTYPE,SDITEM)TRADE_DATA (PERIOD,REGION,REGION,PRODUCT,ALLITEM)RESOURCE_DATA (PERIOD,REGION,ALLRESOURCE,SDITEM)STOCK_DATA (PERIOD,REGION,PRODUCT,ALLITEM)LUC_DATA (PERIOD,REGION,SOILTYPE,SPECIES,ALLCHANGE,ALLITEM)
Major VariablesRESOURCE_VAR (PERIOD,REGION,RESOURCE) FOREST_VAR (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,OWNER,AGE,FORTECH) PEREN_VAR (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,FARM,AGE,CROPTECH) CROP_VAR (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,FARM,CROPTECH) LIVE_VAR (PERIOD,REGION,ANIMAL,LIVETECH) FEED_VAR (PERIOD,REGION,ANIMAL,PRODUCT,FEEDTECH)ECO_VAR (PERIOD,REGION,SOILTYPE,SOILSTATE,ECOTECH) PROCESS_VAR (PERIOD,REGION,PROCTECH) LUC_VAR (PERIOD,REGION,SOILTYPE,SPECIES,CHANGE) DEMAND_VAR (PERIOD,REGION,PRODUCT) SUPPLY_VAR (PERIOD,REGION,PRODUCT) TRADE_VAR (PERIOD,REGION,REGION,PRODUCT)
Major EquationsOBJECTIVE_EQU RESOURCEBAL_EQU (PERIOD,REGION,RESOURCE) RESOURCEMAX_EQU (PERIOD,REGION,RESOURCE) SOILSTATE_EQU (PERIOD,REGION,SOILTYPE,SOILSTATE) FORINVENT_EQU (PERIOD,REGION,SOILTYPE,SOILSTATE,SPECIES,OWNER,AGE,FORTECH) LUC_EQU (PERIOD,REGION,SOILTYPE,SPECIES,CHANGE) LUCLIMIT_EQU (PERIOD,REGION,SOILTYPE,SPECIES,CHANGE) STOCK_EQU (PERIOD,REGION,STOCK)EMIT_EQU (PERIOD,REGION,SUBSTANCE)PRODUCTBAL_EQU (PERIOD,REGION,PRODUCT) MINFEED_EQU (PERIOD,REGION,ANIMAL,NUTRIENT) MAXFEED_EQU (PERIOD,REGION,ANIMAL,NUTRIENT)
Managing the Model Scope • 2_active_sets.gms • index elements on/off • decl_scope.gms • components on/off
FASOM File Structure • Main directory (full access) • Data subdirectories (restricted access) • Agriculture (FADN) • Crop environmental impacts (EPIC) • Bioenergy (ENFA) • Nature Reserves (HABITAT) • Forest Stands (OSKAR) • Forest Industry (FINDUS) • FAOSTAT • Dynamics
FASOM File Naming (Main Dir) • Data files (data_*.gms) • Declaration files (decl_*.gms) • Input calculation files (calc_*.gms) • Program files (#_*.gms) • GAMSCHK files (*.gck), Solver option files (*.opt) • Report files (rep_*.gms) • Special program files (z#_*.gms) * = description # = 1,2,...,k
FASOM Sub Directories • Store original data files in provider format • Convert data to FASOM format (names, resolution, unit consistency) • Automated programs, slow, infrequent use • Protect main FASOM directory from information floods • Confidentiality (FADN), IPR
FASOM Execution • 1_load_data.gms (primary data files) • 2_active_sets.gms (determine model size) • 3_precompute.gms (calculation files) • 4_eufasom_model.gms (equations) • 5_base_report.gms (base solution report) • 6_scenario.gms (repeated solves) • 7_results.gms (scenario differences)
Save / Restart When using GAMSIDE, each program segment must restart from previous one and save for the next • 1_load_data.gms (save .\t\a1) • 2_active_sets.gms (restart .\t\a1 save .\t\a2) • 3_precompute.gms (restart .\t\a2 save .\t\a3) • 4_eufasom_model.gms (restart .\t\a3 save .\t\a4) • 5_base_report.gms (restart .\t\a3 save .\t\a4) • ...
* Indexes $include decl_basicsets.gms $include decl_foresttuple.gms $offlisting * Load Data $include data_crop2000.gms $include data_faowood.gms $include data_faocrop.gms $include data_faoworldcrop2002.gms $include data_oatsprice.gms $include data_feed.gms $include data_land.gms $include data_cropsupply.gms $include data_averagecropemission.gms $include data_euepic.gms $include data_euluc.gms $include data_uscrops.gms $include data_peat.gms $include data_forprocess.gms $include data_forproduct.gms $include data_formarket.gms $include data_treelog.gms $include data_rotlength.gms $include data_forestrent.gms $include data_forest_set.gms $include data_forest_nor.gms $include data_forest_lrg.gms $include data_forest_sml.gms 1_load_data.gms
2_active_sets.gms • Define active set elements • Region • Period • Product • Cohort • Can limit model scope to 1 Region, 1 Period, 1 Product
3_precompute.gms • Assumptions and Definitions (Discounting) • Deal with Data Gaps • Calculations (Data, Tuples) • Checks • Calibrations (Zero Marginal Profits!) • Experiments • Check whether statements can be moved to subdirectory
4_eufasom_model.gms • Variable declarations • Equation declarations • On/off switches for some equations • FASOM equations (see part II) • First solve statement • 4_eufasom_model.gck
5_base_report.gms • Declaration of report indexes and parameters • Display of FASOM base solution • Current period (?=? observation) • Future periods (?=? econometric forecast)
6_scenario_loop.gms • Define scenarios • Number (Set) • Assumptions (Parameters) • Declare report • Loop over scenario set • Restore all parameters to original values • Implement scenario assumptions • Solve • Save solution
7_scenario_report.gms • Display scenario results • Comparison between base line solution and scenario solution
8_scenario_graphs.gms • Display scenario results graphically • Need gnupltxy installed
II FASOM Equations 4_eufasom_model.gms
Understanding FASOM Equations • GAMS code (indexed equation block) • DISPLAYCR output (individual equations) • Display equation components
Condition(al)s • Restrict cases (very important, many indexes) • Use GAMSCHK to check PRODUCTBAL_EQU(REGION,PERIOD,PRODUCT) $ PRODUCT_TUPLE(REGION,PERIOD,PRODUCT).. • calc_tuples.gms
Constrained Optimization Max z = f(X) ... objective function s.t. G(X) <= 0 ... constraints
Objective Function(Normative Economics) Maximize + Area underneath demand curves - Area underneath supply curves - Costs ± Subsidies / Taxes from policies Maximum equilibrates markets!
Alternative Objective Function To get „technical potentials“ from land use for alternative objective u, simply use Maximize u s.t. all constraints Examples: u = Carbon Sequestration, Wheat production, Mire area
Is FASOM linear? • Input prices increase with increasing input use (scarcity of resources) • Output prices decrease with increasing output supply (saturation of demand) • Hence, FASOM has non-linear objective function but is solved as Linear Program using linear approximations
Linear Approximation? • For well behaved functions: yes • Concave benefit / convex cost functions • Decreasing marginal utilities • Increasing marginal costs • For ill behaved: no, need integer variables • Fixed cost (Investment) • Minimum habitat requirements (Biodiversity)
Linear Approximation in FASOM • Use step variables (xi) ... with i steps • Convexity Restriction Sum(i, xi) = 1 • Identity Restriction Sum(i, aixi) = x DEMAND_VAR(REGION,PERIOD,PRODUCT) DEMAND_STEP(REGION,PERIOD,PRODUCT,STEP) DEMAND_CONVEXITY(REGION,PERIOD,PRODUCT) DEMAND_IDENTITY(REGION,PERIOD,PRODUCT) How many steps?
Correct Convex Combination? Model will automatically choose closest neighbor points
PRODUCTBAL_EQU • Very important • Multi-input, Multi-output • Negative coefficients - Inputs • Positive coefficients - Outputs
RESOURCEBAL_EQU • Sum resource uses over all technologies, species, farm structures into an accounting variable RESOURCE_VAR(REGION,PERIOD,RESOURCE)