Matlab Based Stochastic Processes in Stochastic Asset Portfolio Optimization Workshop OR und Statistische Analyse mit Mathematischen Tools, May 13th, 2014 Dr. Georg Ostermaier, Ömer Kuzugüden
Agenda Introduction of Decision Trees Workflows of Stochastic Optimization in different problem settings Stochastic Processes Gas Asset Optimization Thermal Power Portfolio Optimization Hydro System Optimization Parameter Estimation for Stochastic Processes Outperformance of Stochastic over Deterministic Optimization 2
3 Introdcuction Decision Trees GmbH
Decision Trees Founded by Georg Ostermaier in 2006 Spin Off from the Institute for Operations Research und Computational Finance at the university of St.Gallen Cooperation with the IOR/CF (Prof. Dr. Karl Frauendorfer) Cooperation with EPFL (Lausanne, Prof. Dr. Daniel Kuhn) Currently six employees + student workers Main office: Munich, Germany Software and Consulting for the introduction of advanced Stochastic Optimization into the Energy Industry Added value of Stochastic over Deterministic Optimization Two major types of model application: Valuation of assets and asset portfolios (intrinsic/extrinsic) Advanced decision support in daily operation of asset portfolios based on deterministic/stochastic optimization 4
5 Solid customer base
DT.Energy Suite DT.Analytics Stochastic Processes for Power, Gas and CO2, demands Parameter Estimation for Stochastic processes Monte Carlo Scenario Generation Scenario Tree Generation DT.PFC Calculation of Daily Price Forward Curves for gas markets Calculation of Hourly Price Forward Curves for power markets 100% Matlab 50% Matlab DT.Plant Stochastic and deterministic valuation and operation planning of thermal power plants Stochastic and deterministic asset portfolio optimization (power plants, gas storages, steam generators, gas supply contracts, combined heat and power generation portfolios etc.) DT.Storage Stochastic and deterministic valuation and operation planning for Gas storages, gas contracts Gas procurement portfolios, gas trading portfolios DT.Hydro 10% Matlab 10% Matlab 10% Matlab Stochastic and deterministic valuation and operation planning of hydro power systems (pumped storage systems) 6
7 Workflows in Stochastic Optimization
Stochastic Optimization Workflow (Thermal generation portfolio) Stochastic impacts: Fuel Prices (e.g. TTF) Power Spot prices price (e.g. EPEX) EUA price (optional) Outages (optional) Historic TTF spot price Estimation VolatilityMean Reversion (TTF price) Stochastic Optimization 1) Scenario Trees Historic EPEX spot price Estimation Volatilität/Mean Reversion (EEX price) (Spot price, Demand etc.) 2) max Objective P&L Distributions Historic EUA price Estimation Volatilität/Mean Reversion (CO2 price) Actual PFCs 3) Solving of mathematical model Solver (CPLEX ) Constraints Marginal prices (shadow prices) Distributions of fuel consumptions Schedules 8
800 700 600 500 400 300 200 100 0 1 3 5 7 9 calendar week 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 Stochastic Optimization Workflow (Hydro Power Systems) Stochastic impacts Power price (spot EPEX) Reservoir inflows Historic infows monthly m^3 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 Estimation of process parameters (Reservoir inflows) daily Historic EEX Estimation of process parameters (spot price) DT Hydro Profit&Loss Distributions Historic EEX Calculation of HPFC (Fleten) Current HPFC, Inflow Forecasts Mean of distribution = Extrinsic value 9
Stochastic Optimization Workflow (Natural Gas Portfolio) Stochastic Impacts: gas Spot prices (single or multiple hubs), gas forward prices ((single or multiple hubs) gas retail demand, oil prices, FX rates Historic Gas prices (spot, forward) Historic Demand Estimation of stochastic proess parameters (Volas, Mean reversions, Correlations) Stochastic Optimization: 1) Scenario trees (Spot price, demand, oil indices) Historic Oil Indices Historic FX Rates Price Forward Curves, Demand Forecasts 2) max Objective function 3) Solving math model Solver (CPLEX ) Constraints Profit&Loss- Distribution Value of Asset Shadow prices Delta Positions Operational decisions 10
System Overview Market Data System Physical Asset Data Trading System (ETRM) DT. Energy PFC s. Matlab- Routines (Stochsatic Processes) Shadow prices Database Hist. prices Asset data Opt. results operational asset data operational trading data Marked data, PFC s asset data Stoch. parameters Cplex, Gurobi Output Shadow prices Portfoliomanagement System 11
Tool Building Blocks Contract Constraints 12
Price Pathing The current forward quotations are the baseline for the scenario generation. The scenarios are generated in such a way that for every day the average over all scenarios is equal the forward curve, thus satisfying the arbitrage free condition Stochastic Price Model Monte Carlo Scenario Generation Scenario Tree Generation Stochastic price models aim to model (scenario) deviation from forward curve using following logic For a given day, forward settlement prices are known and fixed, and thus the mean value to which the spot price scenario is supposed to revert to is also fixed Tomorrow however the expected value of the forward curve will have changed and thus the spot prices will be affected by the uncertainty of this mean-value as well Purpose of Monte Carlo scenario generation is to produce sufficiently many scenarios of joint (correlated) evolutions of forward products quotes in future 13
14 Stochastic Price Processes
Stochastic Pilipovic Process G = Simulated Deviation of Spot Price Mean Reversion ( s/ w) t ( s/ w) G ( s/ w) ( s/ w) dgt ( Yt Gt ) dt G dy dw ( G) ( G) G t T 2 Short Term Volatility dw ( s/ w) t Long Term Evolution G( t) G(0) exp( G ( t)) G = Simulated Deviation of Spot Price t Equation is referred to as a 2-risk Factor Stochastic Pilipovic Process because the simulated deviation of the Spot Price depends on a mean reversion and a short term volatility (G) dyt s w dg ( / ) t t Deviation form Long Term Price Simulated Deviation of Spot Price 15
Parameter Estimation for gas price Pilipovic Process Aims to provide parameters that enter into stochastic differential equations (Pilipovic equation) describing natural gas prices on different hubs, oil and other commodity prices Assuming that future is not much unlike the past, parameters can be extracted from historical prices Parameters to be estimated Short Term Mean Reversion α s/w Spot Volatility σ G s/w Long Term Mean Reversion ν G Input curves required for Parameter Estimation Historic spot price curve (red line) Historic Price Forward Curve (blue line) Historic quote of a selected forward product (green line) 16
Korrelation der Commodity-Preise System of stochastic differential equations for power, gas and CO2-prices Mean- Reversion Power spot price process (two factor): Fuel price process (two factor): Langzeit-Trend Volatilität CO2 price process: 17
System of stochastic differential equations for power prices, run of river and high mountain hydro inflows Spot price process: Long term process of EEX forwards: run of river inflows: high mountain inflows: Stochastic inflow process: Brownian motion with mean reversion, log normal distribution 18
Correlation of Commodity Prices Model of 4 Correlated Stochastic Price Processes for Oil, Power, Gas and CO2 (two factor models for oil and power) 19
Preprocessing of time series for the parameter estimation Gap Filling becomes importance due to different granularities in the commodity time series! 1. Check the historic time interval whether all needed time series data are available 2. Generation of logarithmic time series X(t) based on the historic spot prices S(t) and the historic PFCs F(t), for gas and power prices (Historic PFCs F(t) must be re-calculated, if not available anymore) 3. Assignment of price bands to the historic time series of power and gas prices 4. Filtering jumps out of the historic power price time series S(t) by means of 6-Sigma-Method (otherwise over-estimation of the volatility) 5. Gap filling in the historic time series utilizing Brownian Bridge or Ohrnstein-Uhlenbeck Bridges 6. Estimation of jump terms for power price process Jump height, jump intensity (separately for up and down jumps) Identification of jumps: 6-sigma-method 20
Kalman-Filtering: Iterative Max-Log-Likelihood-Estimation Start: Initial Set of Parameters,, r etc... Loop Generate a prediction for the next (multidimensional) value (time step by time step) Kalman Filter Prediction Calculate the error (difference) between prediction and real observation (time step by time step) Cumulate the error terms with respect to the parameters => Numeric Max Likelihood-Function Search for new parameters, which maximize the likelihoodfunction and thereby minimize the prediction error. Eventually the improved parameters are determined. Next loop Stopping criteria: if the improvements of the parameters falls below a defined value of e Correction 21
MC Scenario Generation Forward - example Exemplary result of a MC generation of 10 single path scenarios of German NCG gas forward prices Individual scenario generation for each tradable product considering all correlations Based on multidimensional stochastic process, VaR/Covar-Matrix estimated from past price quotations 22
23 Outperformance of Stochastic over Deterministic Optimization
Gasteinertal-Cascade (modeled in DT.Hydro) 24
Rolling Optimization, Gasteinertal hydro cascade 01.07.2011 to 30.06.2012 Scenario Trees of EPEX-Prices and reservoir inflows 01.07.2011 01.10.2006 366 stochastische Optimierungen 02.07.2011 30.06.2012 PFCs/Forecasts of EPEX-Prices and reservoir inflows 01.07.2011 02.07.2011 366 deterministische Optimierungen 30.06.2012 25
Cumulated revenues 26
27
Contact Dr. Georg Ostermaier M.Sc. Ömer Kuzugüden Decision Trees GmbH Ludwigstraße 8 D-80539 München Tel: +49 89 20 60 21 150 Mobile: ++49 172 9039456 email: georg.ostermaier@dtrees.com oemer.kuzugueden@dtrees.com Web: www.dtrees.com 28