Optimization Methods for Gas and Power Markets
Applied Quantitative Finance series Applied Quantitative Finance is a new series developed to bring readers the very latest market tested tools, techniques and developments in quantitative finance. Written for practitioners who need to understand how things work on the floor, the series will deliver the most cutting-edge applications in areas such as asset pricing, risk management and financial derivatives. Although written with practitioners in mind, this series will also appeal to researchers and students who want to see how quantitative finance is applied in practice. Also available equity derivatives and hybrids Markets, Models and Methods Oliver Brockhaus modern derivatives pricing and credit exposure analysis Theory and Practice of CSA and XVA Pricing, Exposure Simulation and Backtesting Roland Lichters, Roland Stamm and Donal Gallagher modeling and valuation of energy structures Analytics, Econometrics, and Numerics Daniel Mahoney fx barrier options A Comprehensive Guide for Industry Quants Zareer Dadachanji xva desks: a new era for risk management Understanding, Building and Managing Counterparty and Funding Risk Ignacio Ruiz sabr and sabr libor market model in practice With Examples Implemented in Python Christian Crispoldi, Peter Larkin & Gérald Wigger quantitative finance Back to Basic Principles Adil Reghai discounting, libor, cva and funding Interest Rate and Credit Pricing Chris Kenyon, Roland Stamm interest rate modelling in the multi-curve framework Foundations, Evolution and Implementation Marc Henrard
Optimization Methods for Gas and Power Markets Theory and Cases Enrico Edoli Founder and CEO, Phinergy, Italy Stefano Fiorenzani Founder and Chairman, Phinergy, Italy and Tiziano Vargiolu Associate Professor of Probability and Statistics, University of Padua, Italy
Enrico Edoli, Stefano Fiorenzani and Tiziano Vargiolu 2016 Softcover reprint of the hardcover 1st edition 2016 978-1-137-41296-6 All rights reserved. No reproduction, copy or transmission of this publication may be made without written permission. No portion of this publication may be reproduced, copied or transmitted save with written permission or in accordance with the provisions of the Copyright, Designs and Patents Act 1988, or under the terms of any licence permitting limited copying issued by the Copyright Licensing Agency, Saffron House, 6 10 Kirby Street, London EC1N 8TS. Any person who does any unauthorized act in relation to this publication may be liable to criminal prosecution and civil claims for damages. The authors have asserted their rights to be identified as the authors of this work in accordance with the Copyright, Designs and Patents Act 1988. First published 2016 by PALGRAVE MACMILLAN Palgrave Macmillan in the UK is an imprint of Macmillan Publishers Limited, registered in England, company number 785998, of Houndmills, Basingstoke, Hampshire RG21 6XS. Palgrave Macmillan in the US is a division of St Martin s Press LLC, 175 Fifth Avenue, New York, NY 10010. Palgrave Macmillan is the global academic imprint of the above companies and has companies and representatives throughout the world. Palgrave and Macmillan are registered trademarks in the United States, the United Kingdom, Europe and other countries ISBN 978-1-349-56815-4 ISBN 978-1-137-41297-3 (ebook) DOI 10.1057/9781137412973 This book is printed on paper suitable for recycling and made from fully managed and sustained forest sources. Logging, pulping and manufacturing processes are expected to conform to the environmental regulations of the country of origin. A catalogue record for this book is available from the British Library. A catalog record for this book is available from the Library of Congress.
To our families
Contents List of Figures... List of Tables...xiii Preface...xiv Acknowledgements...xvii 1 Optimization in Energy Markets... 1 1.1 Classification of optimization problems.... 1 1.1.1 Linearversusnonlinearproblems... 1 1.1.2 Deterministic versus stochastic problems............... 2 1.1.3 Static versus dynamic problems... 2 1.2 Optimal portfolio selection among different investment alternatives... 3 1.3 Energy asset optimization... 7 1.3.1 Generation asset investment valuation with real option methodology... 7 1.3.2 Generation, transportation and storage asset operational optimizationandvaluation... 11 1.4 Energy trading and optimization......................... 15 1.4.1 Assetallocationwithcapitalconstraints... 17 1.4.2 Intraday trading................................ 22 2 Optimization Methods... 26 2.1 Linearoptimization... 26 2.1.1 LPproblems... 27 2.2 Nonlinearoptimization... 28 2.2.1 Unconstrainedproblem... 28 2.2.2 Constrained problems with equality constraints.......... 29 2.2.3 Constrained problems with inequalities constraints........ 30 2.3 Pricing financial assets... 31 2.3.1 Pricinginenergymarkets... 32 2.3.2 Pricinginincompletemarkets... 32 2.3.3 A motivating example: utility indifference pricing... 33 2.4 Deterministic dynamic programming...................... 35 2.5 Stochastic Dynamic Programming, discrete time.... 38 2.5.1 A motivating example... 39 x vii
viii Contents 2.5.2 The general case... 41 2.5.3 Treemethods... 43 2.5.4 Least Square Monte Carlo methods... 46 2.5.5 NaïveMonteCarlowithlinearprogramming... 47 2.6 Stochastic Dynamic Programming, continuous time.... 48 2.6.1 The Hamilton-Jacobi-Bellman equation... 50 2.7 Deterministic numerical methods........................ 55 2.7.1 Finite difference method for HJB equation... 55 2.7.2 Boundary conditions............................ 57 2.8 Probabilisticnumericalmethods... 57 2.8.1 Treemethods,continuoustime... 59 2.8.2 Computationallysimpletreesindimension1... 60 2.8.3 Lattice of trees... 63 2.8.4 MonteCarlomethods... 67 3 Cases on Static Optimization... 69 3.1 CaseA:investmentalternatives... 69 3.1.1 InvestmentAlternativeA... 69 3.1.2 InvestmentAlternativeB... 70 3.1.3 InvestmentAlternativeC... 70 3.2 Case B: Optimal generation mix for an electricity producer: a mean-variance approach... 79 3.3 Conclusions... 90 4 Valuing Project Flexibilities Using the Diagrammatic Approach... 92 4.1 Introduction... 92 4.2 Description of the investment problem... 92 4.3 Traditionalevaluationmethods... 94 4.4 Modellingelectricitypricedynamics... 95 4.5 Valuing investment flexibilities by means of the lattice approach.... 96 4.5.1 InvestmentalternativeA... 99 4.5.2 InvestmentalternativeB... 99 4.5.3 InvestmentalternativeC...101 4.6 Conclusions...101 5 Virtual Power Plant Contracts...105 5.1 Introduction...105 5.2 Valuationproblem...106 5.2.1 Example...110 6 Algorithms Comparison: The Swing Case...114 6.1 Introduction...114 6.2 Swingcontracts...115 6.2.1 Indexed strike price modelling for gas swing contracts...... 115
Contents ix 6.2.2 The stochastic control problem...119 6.2.3 Dynamicprogramming...121 6.3 Finite difference algorithm............................. 122 6.3.1 Boundary conditions............................ 124 6.3.2 Thealgorithm...126 6.4 Least Square Monte Carlo algorithm...128 6.4.1 Thealgorithmandareductiontoonedimension...129 6.5 NaïveMonteCarlowithlinearprogramming...131 6.6 Numericalexperiments...131 6.6.1 Finite differences............................... 132 6.6.2 Least Square Monte Carlo...133 6.6.3 One-yearcontract...135 6.7 Conclusions...137 7 Storage Contracts...146 7.1 Thecontract...146 7.2 Theevaluationproblem...148 7.3 The optimal strategy (in the case of a physical gas storage)........ 149 7.4 Theimplementation...150 7.4.1 Thegascave...151 7.4.2 Thegasspotprice...153 7.4.3 The boundary conditions......................... 154 7.4.4 Numerical experiment, no-penalty case.... 154 7.4.5 Numerical experiment, penalty case... 157 8 Optimal Trading Strategies in Intraday Power Markets...161 8.1 Intradaypowermarkets...161 8.1.1 Intradaypowerpricefeatures...162 8.1.2 Conclusions...169 8.2 Optimal algorithmic trading in auction-based intraday powermarkets...169 8.2.1 Theoptimizationproblem...170 8.2.2 Example: Italian intraday market.... 172 8.3 Optimal algorithmic trading in continuous time power markets...178 8.3.1 Theoptimizationproblem...179 8.3.2 Example: EPEX Spot market.... 181 Notes...185 Index...187
List of Figures 1.1 Decision alternatives and project s value probabilistic evolution of a simple investment project in a generic energy asset... 11 1.2 Binomialtreeforthepriceevolution... 19 2.1 Example of convex polytope generated by problem (2.1).... 28 2.2 Binomial tree for the underlying asset S k, k = 0,1,2... 45 2.3 Binomial tree for the value of an American call option C k, k = 0,1,2... 46 3.1 Investment Alternative A free cash flow... 70 3.2 Investment Alternative B free cash flow... 70 3.3 Investment Alternative C free cash flow... 71 3.4 Cash flow simulations.... 72 3.5 Logical implementation scheme of the optimization problem........ 73 3.6 Optimalportfolioallocation... 75 3.7 Expected IRR and standard deviations as functions of λ... 76 3.8 Efficient frontier, 250Me ofinvestedcapital... 76 3.9 Minimum risk portfolio with min target expected IRR of 7.12%... 77 3.10 Minimum risk portfolio with min target expected IRR of 9.31%... 77 3.11 Minimum risk portfolio with min target expected IRR of 11.78%... 78 3.12 Efficient frontier, 50Me ofinvestedcapital... 78 3.13 Electricityproductionbysource... 80 3.14 Normalized NPV interest rate 4%... 86 3.15 Normalized NPV interest rate 8%... 86 3.16 Efficient MV frontier... 88 3.17 Efficient MV frontier for different levels of interest rates........... 89 3.18 Optimalportfolio sweights... 89 3.19 Normalized NPV... 90 3.20 Optimalportfolio sweights... 90 4.1 ElectricityPricetrinomialtree... 97 4.2 EvaluationdiagramofinvestmentalternativeA...100 4.3 EvaluationdiagramofinvestmentalternativeB...102 4.4 EvaluationdiagramofinvestmentalternativeC...103 5.1 State transitions, given operational constraints... 109 5.2 Flat hourly curves used for the intrinsic valuation...111 5.3 Energy and gas spot price Monte Carlo simulations.... 112 5.4 Example of surface regression for the value function V performed by the LSMC algorithm...113 x
List of Figures xi 6.1 Calculation example of a 911 Brent index formula on historical values...117 6.2 Discretization on a binomial tree of the admissible cumulated quantity for a swing contract with K = 3 = 9 7.5 1 0.5...130 6.3 Contract value and execution time with finite differences with the relationship δ t = δ z = k 1 for k = 1,...,10...133 6.4 Contract value with respect to the number of basis function N ξ...134 6.5 Some sensitivities of LSMC algorithm...136 6.6 10 5 simulations of daily spot price and monthly index price...138 6.7 Optimal control u (t,p,i,î,z) obtained with FD algorithm when t = 15,î = 60 and the cumulated quantity is z = 1orz = 2...141 6.8 AnalysisoftheNMCoutput...142 6.9 Analysis of the LSMC output...144 7.1 Optimal control u at time 0 with T = 10, as a function of cumulated gas quantity Z and spot price P...155 7.2 Value function V at time 0 with T = 10, as a function of cumulated gas quantity Z and spot price P...155 7.3 Optimal control u at time 0 with T = 30, as a function of cumulated gas quantity Z and spot price P...156 7.4 Value function V at time 0 with T = 30, as a function of cumulated gas quantity Z and spot price P...156 7.5 Optimal control u at time 0 with T = 20, as a function of cumulated gas quantity Z and spot price P...157 7.6 Value function V at time 0 with T = 20, as a function of cumulated gas quantity Z and spot price P...158 7.7 Optimal control u at time 0 with T = 50, as a function of cumulated gas quantity Z and spot price P...158 7.8 Value function V at time 0 with T = 50, as a function of cumulated gas quantity Z and spot price P...159 8.1 Forecast error reduction for wind generation in Germany as forecast time horizon reduces, from [1]... 162 8.2 Average absolute spread between day-ahead and intraday markets (GME Italian markets) from January 1, 2013, to June 30, 2014...... 163 8.3 Average absolute spread between day-ahead and intraday markets (OMIE Spanish markets) from January 1, 2013, to June 30, 2014.... 164 8.4 Average high-low spread in EPEX Intraday market, from January 1 to July 31, 2014. The chart indicates a high degree of volatility....... 164 8.5 A typical path of intraday price in a continuous market............ 165 8.6 Liquidity: average transactions number and volumes for every hour... 166 8.7 Percentage of transactions already done with respect to time left to delivery...167 8.8 Trend identification: qualitative tests... 168
xii List of Figures 8.9 Trend identification: qualitative tests... 168 8.10 Distribution of the random variable P&L for a strategy that uses only the Italian DA market (called MGP) and a different strategy that uses also ID and unbalancing market...171 8.11 Example of the production of the PV plant for the first 330 hours..... 174 8.12 Cumulated performance of the strategy in the case when unbalancing is not allowed, i.e., the case when the final schedule after the last intraday market is exactly equal to the forecast energy production...176 8.13 RatiobetweenexpectedP&Landexpectedrisk...178 8.14 Calibration example of the dynamics (8.6).... 182 8.15 Example of wealth of trading strategies....................... 183
List of Tables 3.1 Input data used for the solution of the problem, from [4].......... 82 3.2 GBMparameters... 83 3.3 Interestrate4%... 87 3.4 Interestrate8%... 87 3.5 Descriptive statistics distributions with incentives.... 89 4.1 Synopticrepresentationofinvestmentalternatives... 93 4.2 Static DCF analysis of investment alternatives... 95 5.1 ConstraintoftheVPPcontract...110 5.2 Forward term structure used in the example...111 6.1 Summary of the main results of the three algorithms presented in this chapter for a one-month contract...135 6.2 Summary of the main results of the three algorithms presented in thischapterforaone-yearcontract...137 8.1 Structure and organization of intraday markets in Europe.......... 162 8.2 Excerpt of the strategy after it has been completely implemented in allmarkets...177 8.3 Average risk of the strategy versus benchmark...177 8.4 PerformanceOU...183 xiii
Preface Optimization is a widely used term and concept both in financial and industrial businesses. Its common meaning has to do with improving performance or taking the best possible decisions among different alternatives. Typically, in the financial industry the term optimization is used to denote maximization of economic and/or financial net flows generated by a certain business or initiative, while in the traditional industrial environment the same word is used to denote the productivity s improvement of a certain industrial process to make it more energy-efficient or less time-consuming. The modern energy sector is characterized by both financial and industrial connotations; hence, it is natural that the concept of optimization is used in both the meanings described above, and that quite often financial and industrial optimizations contaminate each other. In typical mathematical terminology, the concept of optimization is univocally associated to a specific class of problems (and their associated solution methodologies). The basic idea of generic optimization problems is that of determining the input variables of a certain function that maximize or minimize its output value. The function we aim at maximizing or minimizing is called the target or objective function, while the input to which is associated the function s maximum or minimum value is called the solution of the problem, or also optimal variables, controls or decisions, according to the field in which the problem appears (engineering, mathematics, physics etc.). As we in real life (not only in business) try to optimize our decisions or actions according to external constraints, in mathematics we are typically interested in searching for the maximum or minimum of our target function inside a specific subset of variables domain. For this reason, we often deal with constrained optimization problems. Modern energy markets, due to their high degree of financialization, expose market players to complex decisions that concern jointly the improvements of industrial processes and the maximization of economic results. Hence, optimization is invoked in many different sectors of the typical value chain that characterizes energy companies, from investment and strategic decisions to industrial operations related to energy assets and, finally, to hedging and trading decisions to be taken onto competitive energy markets. Many sources of uncertainty (prices, volumes, etc.) affect economic performance of power and gas markets agents; hence, the maximization of economic results should be necessarily accompanied by risk control. Taking optimal decisions in this xiv
Preface xv complex environment is almost never a simple task that market agents can tackle without a scientific, or at least rational, approach. The support of quantitative methods in this field is fundamental. During our experience in the power and gas sectors, we realized that most of the optimal decision problems that market agents have to face in their day-to-day jobs are extremely complex when they are translated into mathematical terms. Complexity arises due to flexibilities and constraints embedded in business activity but also due to uncertain dynamics that characterize many relevant variables such as prices and volumes. Complex problems need complex solution methods. Optimization problems that are extremely different ask for different optimization techniques for their formal solution. Mathematical methodologies are more and more used in order to correctly solve different optimization problems that modern energy markets present. Nevertheless, the correct solution of a problem is at least as important as the correct framing of the optimization problem itself. By problem framing" we mean the correct and rigorous translation of the business optimization issue into a formal mathematical problem: incorrect framing will lead to a wrong decision, exactly like a wrong solution to a problem. For extremely complex problems, the correct optimization problem is often too difficult to be solved; hence, simplifications are necessary in order to take our decisions. When optimal solutions are not attainable, approximations are more than welcome if we are able at least to assess the size of error we will face. This book is dedicated at presenting, framing and solving typical optimization issues that characterize the power and gas sectors. The economic and financial rationale of different optimization problems will be presented with the same accuracy that will be used in presenting mathematical methodologies necessary for solving the same problems. The discussion of business cases will help the reader to appreciate how different energy optimization problems are translated into mathematical terms and solved by means of complex mathematical techniques. For extremely complex problems we will propose adequate simplifications which will allow us to reach proper solutions as well as their potential impacts. Thebookisstructuredasfollows: Chapter 1 deals with a presentation of typical optimization problems characterizing the gas and power sectors. Chapter 2 proposes a detailed review of mathematical tools for representing and solving optimization problems. The remaining chapters present, in increasing complexity, business cases where real industry problems are translated into mathematical terms and solved using the methods proposed in Chapter 2. The target reader is the power and gas professional, well qualified under the quantitative point of view, who works in investment valuation, portfolio-management,
xvi Preface asset-management, structured trading, risk-management or proprietary trading and is willing to specialize in optimization problems in the power and gas sectors. The book may also appeal to academic professionals searching for new and interesting challenges to which to apply their research.
Acknowledgements We would like to express our gratitude to Marco Gallana for his conceptual and material help through a lot of profitable discussions and examples on continuous time stochastic dynamic programming applied to energy markets, which helped us in completing the details on intraday trading strategies. We are also grateful for the challenging inputs we received from our anonymous referees before the delivery of this work. The responsibility for all the remaining errors is uniquely ours. xvii