• No results found

Production planning of combined heat and power plants with regards to electricity price spikes: A machine learning approach

N/A
N/A
Protected

Academic year: 2022

Share "Production planning of combined heat and power plants with regards to electricity price spikes: A machine learning approach"

Copied!
73
0
0

Loading.... (view fulltext now)

Full text

(1)

UPTEC ES 17 008

Examensarbete 30 hp Juni 2017

Production planning of combined heat and power plants with regards to electricity price spikes

A machine learning approach

Nathalie Fransson

(2)

Teknisk- naturvetenskaplig fakultet UTH-enheten

Besöksadress:

Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0

Postadress:

Box 536 751 21 Uppsala

Telefon:

018 – 471 30 03

Telefax:

018 – 471 30 00

Hemsida:

http://www.teknat.uu.se/student

Abstract

Production planning of combined heat and power plants with regards to electricity price spikes

Nathalie Fransson

District heating systems could help manage the expected increase of volatility on the Nordic electricity market by starting a combined heat and power production plant (CHP) instead of a heat only production plant when electricity prices are expected to be high.

Fortum Värme is interested in adjusting the production planning of their district heating system more towards high electricity prices and in their system there is a peak load CHP unit that could be utilised for this purpose.

The economic potential of starting the CHP, instead of a heat only production unit, when profitable was approximated for 2013-2016.

Three machine learning classification algorithms, Support vector machine (SVM), Naive Bayes and an ensemble of decision trees were implemented and compared with the purpose of predicting price spikes in price area SE3, where Fortum Värme operates, and to assist

production planning. The results show that the SVM model achieved highest performance and could be useful in production planning towards high electricity prices. The results also show a potential profit of adjusting production planning. A potential that might increase if the electricity market becomes more volatile.

Handledare: Fabian Levihn

(3)

Popul¨arvetenskaplig sammanfattning

Volatiliteten p˚a den nordiska elmarknaden f¨orv¨antas ¨oka i och med den allt st¨orre andel v¨aderberoende energislag som introduceras p˚a marknaden. Detta tros kunna leda till fler timmar med l˚aga elpriset samt fler timmar d˚a priset skjuter i h¨ojden, s˚a kallad prisspikar.

Ett s¨att att arbete f¨or att s¨akra stabiliteten och leverensen av el i ett s˚adant scenario ¨ar att ha tillg˚ang till mer reglerkraft i systemet. I det h¨ar projektet unders¨oktes m¨ojligheten att anv¨anda ett kraftv¨armeverk, vilket ¨ar en produktionsenhet inom fj¨arrv¨armeindus- trin som kan producera b˚ade el och v¨arme, f¨or att m¨ota prisspikar och d¨armed fungera som reglerkraft. Detta gjordes genom att utv¨ardera om det redan idag finns ekonomisk potential i att anv¨anda ett specifikt kraftv¨armeverk till detta syfte. En prognosmodell baserad p˚a maskininl¨arningsalgoritmer utvecklades med fokus p˚a att identifera timmar med s¨arskilt h¨oga elpriser p˚a marknaden. Det ¨ar n¨ar priset blir tillr¨ackligt h¨ogt det skulle kunna bli aktuellt att k¨ora kraftv¨armeverket. En s˚adan prognosmodell skulle sedan kunna anv¨andas som ett verktyg vid produktionsplanering av en fj¨arrv¨armeanl¨aggning.

Projektet genomf¨ordes p˚a Fortum V¨arme som ¨ager och administrerar st¨orre delen av fj¨arrv¨armen¨atet i Stockholm. Hos Fortum V¨arme finns ett intresse av att ta mer h¨ansyn till elpriset d˚a man planerar k¨orningen av systemet f¨or att ¨oka l¨onsamheten. Med m˚anga olika produktionsenheter i systemet finns en flexibilitet mellan att producera enbart v¨arme eller el, eller en kombination av de b˚ada. I Fortum V¨armes system finns idag ett ¨aldre oljeeldat kraftv¨armeverk, KVV1, som fungerar som spetslastproduktion. Detta inneb¨ar att verket enbart k¨ors vid h¨oga v¨armebehov, till exempel under de kallaste vin- terdagarna, eller n¨ar ett annat verk g˚att ur produktion. Kraftv¨armeverk, KVV1, har stor tekniskt flexibilitet och har idag l˚ag utnyttjandegrad d˚a br¨anslepriset ¨ar h¨ogt. Detta verk har den tekniska potentialen att agera reglerkraft p˚a elmarknaden och om elpriset ¨ar h¨ogt nog kan det ¨aven vara l¨onsamt. Kraftv¨armeverket skulle d˚a k¨oras ist¨allet f¨or en enbart v¨armeproducerande enhet, vilket i Fortum V¨armes system inneb¨ar antingen hetvatten- pannor eller v¨armepumpar, d˚a prognosen visar p˚a att elpriset f¨ormodligen blir h¨ogt nog f¨or detta att bli l¨onsamt.

Den tidsperiod som studerades var 2013-01-01 till 2016-05-31. Hade Fortum V¨arme under denna period anv¨ant kraftv¨armeverket, KVV1, till att producera el under peri- oderna med h¨oga elpriser visar l¨onsamhetsstudien i denna rapport p˚a en potentiell vinst.

(4)

Om volatiliteten p˚a elmarknaden ¨okar, vilket ¨ar ett m¨ojligt utfall n¨ar mer f¨ornybar elpro- duktion integreras p˚a marknaden, skulle det kunna leda till ¨okad ekonomisk potential i att anpassa sin produktionsplanering b¨attre efter h¨oga elpriser.

Som prognosmodell j¨amf¨ordes tre klassificeringsalgoritmer, Support Vector Machine (SVM), Naive Bayes och en ensemble av beslutstr¨ad. Dessa algoritmer har anv¨ants i tidigare studier med goda resultat p˚a andra elmarknader och ans˚ags d¨arf¨or l¨ampliga att prova ¨aven p˚a den nordiska elmarknaden. Samtliga klassificeringsalgoritmerna visade potential f¨or att kunna f¨oruts¨aga prisspikar p˚a den nordiska elmarknaden. Den model som presterade mest tillfredst¨allande, vilket innebar att den med stor sannolikhet kunde f¨orutsp˚a de v¨aldigt h¨oga elpriserna, var SVM. Innan modellen implementeras kr¨avs dock vidare utv¨ardering p˚a hur v¨al den presterar p˚a olika tidshorisonter. F¨or vidare studier med syfte att applicera maskininl¨arningsalgoritmer p˚a den nordiska elmarknaden rekommenderas d¨arf¨or framf¨or allt SVM utifr˚an resultatet i denna studie.

(5)

Executive summary

As the amount of weather dependent energy sources increase in the electrical system, electricity prices will become more volatile on the Nordic electricity market. To ensure a stable and secure electricity deliverance more power regulating units will be needed.

Combined heat and power production plants (CHP) exist in many district heating sys- tems and could assist balance the market. The district heating system in Stockholm, run by Fortum V¨arme, consists of many different units and there is a potential to be flexible between heat and power production depending on the upcoming electricity price. A CHP fuelled with bio oil can reduce the need for fossil peak load production units in the future electricity system.

The economic potential of adapting a specific CHP in the Fortum V¨armes system to- wards high electricity prices for the time period 2013-2016 was approximated and a potential profit was found. A machine learning classification model was developed to forecast the probability of occurrence of electricity price spikes to see if the application of classification algorithms could be useful to production planning. Three algorithm were compared, Support vector machine (SVM), Naive Bayes and an ensemble of deci- sion trees. The results from all algorithms were promising but SVM was deemed most useful for the purpose.

System simulations resulted in a small additional cost of fuelling the CHP with bio oil instead of fossil oil whereas the difference in system CO2 emissions were large.

Adapting production planning of the CHP has a potential profit today and as the mar- ket becomes more volatile this could increase the potential. Classification algorithms perform well on explaining price spikes on the Nordic market and especially the SVM model developed in this study could be useful in production planning towards high elec- tricity prices but further studies are required before implementation.

(6)

Contents

1 Introduction 7

1.1 Background . . . 7

1.2 Problem formulation . . . 9

1.2.1 Research questions . . . 12

1.3 Limitations . . . 12

2 Theoretical background 14 2.1 Nord Pool- the electricity market . . . 14

2.2 Drivers of high electricity prices . . . 17

2.3 Predicting price spikes . . . 19

2.4 Decision making in electricity production . . . 21

3 Machine learning 23 3.1 Performance measures . . . 24

3.2 Cross-validation . . . 26

3.3 Support Vector Machine . . . 26

3.4 Naive Bayes . . . 28

3.5 Ensemble of decision trees . . . 29

4 Technical background 31 4.1 Combined heat and power plants at Fortum V¨arme . . . 31

5 Method 33 5.1 Data selection & data pre-processing . . . 33

5.2 Model selection . . . 35

5.2.1 Model parameters & variable selection . . . 35

5.2.2 Model evaluation . . . 37

5.3 Decision making in production planning . . . 38

5.4 Economic potential . . . 39

5.5 System simulations in Minerva . . . 39

6 Results 41 6.1 Electricity price spike definition . . . 41

6.2 Model selection . . . 41

(7)

6.2.1 Support vector machine . . . 43

6.2.2 Naive Bayes . . . 44

6.2.3 Ensemble of decision trees . . . 46

6.2.4 Performance of classifiers . . . 47

6.3 Decision making in production planning . . . 48

6.4 Economic potential . . . 50

6.5 System simulations in Minerva . . . 52

7 Discussion 55 7.1 Model selection . . . 55

7.2 Model performance . . . 56

7.3 Economic potential . . . 57

7.4 System simulations . . . 58

8 Conclusion 60 8.1 Conclusions . . . 60

8.2 Further research . . . 60

9 Appendix 67 9.1 Variable selection . . . 67

9.1.1 Support vector machine . . . 67

9.1.2 Naive Bayes . . . 68

9.1.3 Ensemble of decision trees . . . 70

(8)

Notation

Abbreviations

Abbreviation Meaning

CHP Combined heat and power production plant

E05 Fossil oil

HOB Heat only boiler

HP Heat pump

KVV1 A peak load production CHP in Fortum V¨armes system MFA Mixed fluid acids, bio oil

MVMN Multivariate multinomial distribution PR-AUC Area under precision and recall curve PT Electricity spike spot price threshold RBF Radial based kernel

SPT Electricity spike probability threshold SVM Support vector machine

(9)

1 Introduction

The introduction section presents a background to why this study is being conducted. It explains the purpose of the study and formulates the problem into research questions.

1.1 Background

The transition towards an energy system based solely on renewable energy has lead to an increase in weather dependent electricity production in the Nordic power system.

The power source to have increased the most in the Nordic countries is wind power but also solar power has seen an uptake in recent years. Figure 1 shows how wind power has increased its share of total electricity production in Sweden since 2005 and wind power now produces around 10% of the national demand of electricity.

Figure 1: Electricity production in Sweden per production type (Swedish Energy Agency 2016)

In Sweden the government has set a long term goal of having a 100% renewable en- ergy system (Regeringskansliet 2015) and by 2030 the EU wants to achieve at least 27% renewables in the energy system (European Commission 2016). In the electrical system the Swedish Energy Agency short term prognosis expect a 5% uptake in wind power by 2017 compared to 2015 (Swedish Energy Agency 2016) and the Swedish government are planning for 30 TWh wind power to be produced in the system by 2020 (Regeringskansliet 2015). In the 2050 Road Map the International Energy Agency (IEA) targets a 15-18% share of global electricity consumption to be produced by wind

(10)

power by 2050 (IEA 2013). Because of these political targets it is therefore likely that weather dependent production units, such as wind power, will increase in the foresee- able future (Swedish Energy Agency 2016). Weather dependent production units, such as wind and solar power, have been proven to decrease the overall electricity price be- cause of its low marginal cost while at the same time increase volatility on the market (Woo et al 2011). Volatility on the electricity market results in sudden jumps of the spot price, so called price spikes. Figure 2 shows the spot price per hour from 2013-2016 and the volatile nature of the spot price and the spiky behaviour is clear. Increasing intermittent power production is expected to lead to an increased need for power reg- ulating units to compensate for days with low wind power production. Finding ways to counteract volatility on the market is in line with the UN sustainable development goal number 7 ”Ensure access to affordable, reliable, sustainable and modern energy for all”(UN 2016).

Figure 2: Spot price in SE3 per hour from 2013-01-01 to 2016-05-31

Increasing volatility on the electricity market will result in more points in time where production units with higher marginal cost will be necessary to balance the supply- demand of the system. In principal there are four ways to deal with an increasing amount of intermittent power production (Linnarsson et al 2013):

(11)

1. Increase the use of hydro power

2. Flexible heat and power production units 3. Increase import and export in the system 4. Demand-side management

1.2 Problem formulation

In this thesis the focus is on managing volatility on the spot market through heat and power production units. Many district heating systems are integrated with the electric- ity market through combined heat and power plants (CHP), large scale heat pumps (HP) and electrical boilers. Stockholm has one of the largest and most complex district heat- ing systems with many different production units enabling flexibility between heat and power production. The system is managed by AB Fortum V¨arme sam¨agt med Stockholm Stad(Fortum V¨arme) (Fortum V¨arme 2016) and displayed in Figure 3.

Figure 3: Fortum V¨armes district heating system in Stockholm (Fortum V¨arme 2016) It has been noticed by Fortum V¨arme that their net electricity production is often not adjusted according to the electricity price and the company would like to improve in this area. Figure 4 illustrates the spot price and the net electricity production of Fortum V¨arme during a week in January 2016. The average daily temperature was below -5

(12)

degrees Celsius and the net electricity production follows the spot price rather well.

Figure 5 is from a week in November 2015 and the average daily outdoor temperature is around 0 degrees Celsius. The net electricity production is quite low during the day with several extreme price spike and two days later, when electricity prices are back to normal, the net electricity production is high. In the system Fortum V¨arme has an older but very flexible CHP, KVV1, fuelled either using bio oil or fossil oil. KVV1 is used as a peak load production unit because of its high fuel cost and because of its technical flexibility and potential to increase utilisation it has the potential to help the system better adjust to electricity price spikes. During the week presented in Figure 4 KVV1 was in production because the cold outdoor temperature required the additional heat demand whereas in Figure 5 KVV1 was not in production because it was not needed to cover the heat demand in the system. According to Fortum V¨arme one reason that the net electricity production is not well adjusted to electricity prices is because their electricity price prognosis is not good enough at detecting the occurrence of price spikes.

Figure 4: The spot price and net electricity production (positive) or consumption (neg- ative) of Fortum V¨arme in January 2016

(13)

Figure 5: The spot price and net electricity production (positive) or consumption (neg- ative) of Forum V¨arme in November 2015

Assuming there is a heat demand in the district heating system that needs to be covered by either HP, heat only boiler (HOB) or a CHP. Which unit to start next depends on the outdoor temperature and to some extent the electricity price. If the electricity price is high enough the CHP should be in production instead of a heat only producing unit. In Fortum V¨armes system the CHP that would be considered for this purpose has a higher start-up cost than both a HOB and HP and a start-up time of approximately 48 hours.

This means that the company needs to take an economic risk if wanting to use the CHP during periods with high electricity prices.

By estimating the probability of high electricity prices, and the associated cost of run- ning a CHP plant, production planning in district heating system would be able to plan CHP production better after high prices on the spot market. This could result in higher utilization of the CHP and an increase in profit when the system is better adapted to the electricity spot market. Depending on what fuel is used in the CHP there could be environmental benefits if the CHP is fuelled with bio oil since it has the potential to replace other peak load production units in the electricity system that are fuelled with fossil fuels. The expected increase of volatility on the electricity market due to a larger

(14)

share of weather dependent production in the system (Swedish Energy Agency 2016) is likely to make this line of thinking in production planning more interesting in the future.

Findings in the literature in combination with Fortum V¨armes interest in investigating applications of supervised machine learning has lead to the method being chosen in this project to forecast the probability of price spikes. The goal is to improve production planning in a way that by accepting a risk the company is more likely to produce power when the price is high. A second goal is to assess the economic potential of better adapt- ing the CHP to high electricity prices and perform a systems analysis of KVV1 in the system.

The project can be divided into two parts. The first is to develop a model using machine learning classification algorithms in the numerical computing environment MATLAB that predicts the probability of price spikes occurring on the electrical spot market, Nord Pool Spot. The model output will then by evaluated to see whether this information can be useful to production planning by comparing the potential profit with expected profit according to the model.

1.2.1 Research questions

The problem formulation is narrowed down into two research questions;

1. What is the economic potential in optimally adapting a CHP in Fortum V¨armes system according to electricity price spikes?

2. What classification algorithm and variables can be useful to predict the probability of price spikes on the Nordic electricity market and especially in price area SE3?

1.3 Limitations

This project will only investigate the Nordic electricity market, Nord Pool Spot, and in particular the occurrence of price spikes on the spot market in power price area SE3 where Fortum Heat is operating. The studied time period was 2013-01-01 to 2016- 05-31. All data used for building the model is freely available whereas information necessary to perform the economic calculations and system simulations belong to For-

(15)

tum V¨arme.

The classification algorithms for predicting electricity price spikes were built in matlab and only built-in classification algorithms have been considered. The reason for using built-in algorithms was both to save time and because the project aims to show applica- tions of machine learning classification algorithms rather than developing them. Matlab is already being used at Fortum V¨arme which could make implementation easier. Only parameters that could be adjusted in the built-in models were considered for each algo- rithm and if nothing else is stated default settings were used.

The time horizon of interest for the model should be equivalent to the short-term produc- tion planning horizon at Fortum V¨arme, which is five days ahead. The model has been built under the assumption that if Fortum V¨arme would like to implement it, prognosis data of the chosen input variables would be bought. During construction and evalu- ation of the model in this project actual measured values of the variables were used since there were no historic prognosis data available. If the model is deemed promising enough analysis of prognosis accuracy can be bought and analysed along with future predictions of input variables necessary to implement the model. This is likely to lead to a decrease in model performance.

For CHP calculations and potential profit of implementing the recommendations to pro- duction planning are made under the assumption that the CHP is price-taking on the market. Meaning that the production unit has no direct influence on the outcome of the spot price.

(16)

2 Theoretical background

The theoretical background section presents an introduction to the Nordic electricity market and previous studies with the aim of predicting price spikes. It will summarise what methods have been used and what variables seem to be driving high electricity prices. Literature studying decision making in electricity production has been included to learn ways of formulating the decision problem and handling risks and uncertainties.

2.1 Nord Pool- the electricity market

Since deregulation of the electricity market in Sweden in 1996, electricity is now bought and sold through Nord Pool. Nord Pool is a common electricity market including Sweden, Norway, Finland, Denmark, Estonia, Latvia, Lithuania, Germany and the UK (Svensk Energi 2016).

(17)

Figure 6: The Nord Pool system including transmission capacity between price areas separated by with dotted lines in 2016 (Nord Pool 2016)

Nord pool is made up of two physical markets, Elspot and Elbas. The majority of electricity is sold on the day-ahead spot market, Elspot, where price is set hour by hour for the next upcoming day. Producers and consumers of electricity will place their bids before 12am for the day occurring 12-36 hours later. The price is calculated at the intersection between supply and demand bids according to Figure 7, which becomes the system price for the whole region at that hour (Nord Pool 2016).

(18)

Figure 7: Price setting of the spot price (Nord Pool 2016)

The region that the Nord Pool covers is divided into various price areas because of limitations in transmission capacity and therefore the price may differ between areas.

Sweden is since 2011 divided into four price areas, seen in Figure 6 to stimulate new production units to be built in areas with a shortage of production (Svenska Kraftn¨at 2016).

Apart from Elspot there is also Elbas, the intraday market. On the intraday market pro- ducers and consumers again place there bids but now on the upcoming hour to regulate for imbalances that have occurred after the spot market has closed. Examples of such events are loss of production units or major errors on the grid. Production being offered as upwards or downwards regulation must be available within 15 minutes and therefore only highly flexible production is used on this market. With the expected increase of wind power in the system and the differences between wind power production progno- sis and actual production this market could increase in importance in the future. Apart from the physical markets Nord Pool also offers the financial market where power mar- ket contracts are used for price hedging and risk management. The time horizon for the financial market is up to six years (Nord Pool 2016).

(19)

Figure 8: Effect of supply and demand on spot price. (Nord Pool 2016)

Figure 8 shows the production cost of different production units which in turn translates to electricity price on the spot market. A shift in demand can lead to great variations in spot price depending on which production unit will determine the price.

2.2 Drivers of high electricity prices

Li & Flynn (2006) studied several different electricity markets and found that most, in- cluding the Nordic market, show a strong correlation between demand and spot price.

They claim that the user side is price indifferent to sudden shifts in electricity price be- cause normal consumers buy electricity at a fixed price on a monthly or yearly basis (Li & Flynn 2006). This is also a conclusion of Fredriksson (2006) who also adds that the production side can also be slow in responding to short term changes in electricity price. High electricity price, according to Fredriksson (2006) occurs when demand is high which leads to production units with higher marginal cost to be price-setting on the market which agrees with figure 8.

Sudden changes in price, so called price spikes, are generally a result of low cost pro- duction unit fall-out, limitations in transmission capacity, maintenance of large produc- tion units or other disturbances on the electrical grid (Fredriksson 2006). Nomikos &

Soldatos (2010) agrees and adds that a sudden shift in demand in combination with the

(20)

previously mentioned factors causes price spikes. The price will return to normal after what caused the price to jump has been taken care of. Nomikos & Soldatos (2010) sum- marises the reasons behind price spikes as a sudden shift in supply and demand that was not expected. Fredriksson (2006) also adds the problematic of storing electricity as a fundamental reason why price spikes occur. The present lack of efficient storage means that supply and demand of electricity always has to match in order to maintain statbility on the grid. After every winter season Svenska Kraftn¨at (SVK), the Swedish electricity transmission system operator, summarises the past season with regards to security and stability of the national grid. Their analysis agrees with what has been mentioned above that high demand leads to high electricity prices and for Sweden demand is closely re- lated to outdoor temperature (Svenska Kraftn¨at 2013).

J´onsson et al (2008) studied the effect that wind power prognosis had on the spot price on the Nordic market. They found that it is the prognosis of wind power production rather than actual wind production that drives the spot price. The visible effects is that a prognosis indicating high wind power production reduces the spot price. Also in J´onsson et al (2012) the importance of including wind power production prognosis when modeling elecitricty spot price is brought foreward. The hydro reservoirs in Sweden and Norway are generally an overall driver of spot price in the Nordic market. Hydro reser- voirs change slowly and is therefore not as important in short-term forecasting (J´onsson et al 2008).

Another parameter used by Mount et al (2006) to predict price spikes on a market in the USA is reserve margin. Reserve margin is the difference between available capacity and capacity being used. Mount et al (2006) argues that when the difference between available capacity and capacity being used decreases there is less available capacity to absorb a sudden change in the system which is thought to elevate the risk of high prices.

Lindstr¨om et al (2015) however claims in their study that when studying the Nordic market reserve margin is not a very good measure. Instead they suggest, as mentioned above, that the most reliable parameter in forecasting high prices is consumption and on the Nordic market consumption is closely dependent on weather. Also Huisman (2008) agrees with this conclusion and in his study chose to use temperature instead of reserve margin because the information included in reserve margin is not available for every market whereas weather data is both available and transparent. The results of

(21)

Huisman (2008) study were that price spikes occur more frequently when temperature shows a strong deviation from average temperature levels. Temperature is not the only climate variables driving the electric power demand, according to Willis (2002). Willis (2002) claims that there are three weather parameters that have a significant impact, temperature, humidity and solar illumination. Humidity has a larger impact on demand in summer because warm air can hold more moisture than cold air (Willis 2002).

Articles using classification algorithms to predicit the occurrence of price spikes have used a variaty of the above mentioned variables and have also found other factors.

Voronin et al (2013) identifies variables from previous studies and uses scatter plots to visualise factors correlation with spot price. Strong correlations were found with five variables and they were included in the model, temperature, non-base electricity demand, Supply-Demand balance Index (SDI), Elspot capacity-flow difference and day index. Non-base electricity demand is the predicted demand subtracted by predicted production of hydro and nuclear. SDI is an index of assumed available supply and fore- casted demand:

SDI = Supply − Demand

Demand (1)

Elspot capacity-flow difference is a measure of how much still available capacity before congestion, Elspot available capacity is assumed constant during the week and flow is forecasted. Day index is included because price spikes occur much more frequent dur- ing weekdays than weekends and holiday. Lu et al (2005) analysis of the Queensland electricity market resulted in the following factor to include in forecasting model: De- mand, reserve capacity, time index- hour of the day and time index- day of the week.

Similar factors were used by Zhao et al (2005) and Zhao et al (2007).

2.3 Predicting price spikes

Many articles have been published with the goal of predicting the day-ahead electric- ity price in different markets. The different methods can be divided into three main categories. 1) General stochastic models (eg Ornstein-Uhlenbeck process). 2) Regime switching model (eg Markovs Regime Switching model in Mount et al (2006) or thresh- old models). 3) Machine learning models (eg Neural Network, Decision Tree) or a com- bination of machine learnings models with statistical methods called hybrid models.

There is no absolute in whether parametric or non-parametric/semi-parametric mod-

(22)

elling is the better option because it generally depends on the analysed market and the available data (Samitas & Armenatzoglou 2014).

One study performed on the Nordic electricity market by Voronin et al (2013) used a Bayesian classifier to determine whether a price spike will occur at a certain time or not and then applied a k-Nearest Neighbour (k-NN) to predict the value of the spike. The probability of a price spike occurring is almost always lower than the probability of it not occurring and in their study they found that a probability threshold of 38% should be used for the classifier to categorise the hour as a spike. From their evaluation 50%

of price spikes could be predicted. A similiar method was performed on the Australian market by Lu et al (2005) also using a Bayesian classifier and k-NN. The Australian market has also been the subject when trying different classification algorithms perfor- mance. Both in Zhao et al (2005) and in Zhao et al (2007) the authors compared the bayesian classifier with a support vector machine (SVM). In their studies they found that SVM was most useful when looking at precision whereas the bayesian classifier re- ceived a higher recall. The Hungarian market was analysed for price spikes by Koban et al (2015) using a compound classifier made up of SVM, Decision Tree and Probabilistic artificial neural network to determine if a price spike will occur followed by k-NN to determine its value.

For the purpose of this study it is necessary to define electricity price spikes. There is no general definition of price spikes, a common starting point is to say that a price spike occurrs when prices exceed a threshold for a shorter duration of time Weron (2008).

Janczura et al (2013) performed a rather comprehensive summmary of price spike defi- nitions throughout the litterature and three of the most commonly used will be presented.

The first is to apply a fixed value threshold as done by Zhao et al (2005) on the Queens- land electrical market in Australia. Voronin et al (2013) define spikes as surpassing the mean price value by three standard deviations of a time-varying window so that spike definition differs throughout the year. Another definition used by Weron (2008) is that the price must exceed 2.5 standard deviations (although three is more commonly used) of all price returns and be follow by a decrease in price within a time period. The defi- nition of a price spike should reflect the purpose of the study.

(23)

2.4 Decision making in electricity production

Uncertainty is unavoidable when it comes to decision making since there is no way of knowing for certain the outcome of the future. This is true for every decision-making problem facing electricity producers. Variables, such as demand and electricity price, can only be known to a certain degree when the decision has to be made. Uncertain- ties are often dealt with by visualising the result in probability distributions to display uncertainty in variables or in profit distribution curves ( Carri´on et al 2010). Profit dis- tributions help avoid making a decision that leads to high probability of a low profit or even a loss (Sahed 2009). Risk measures are often implemented to avoid unbeneficial situations. One way of using risk measures when dealing with profit distributions is by trying to reduced the variance of the curve since high variance indicates that the profit is more likely to differ from the one anticipated. Another way of using profit distri- butions is by looking at either the probability of not achieving a target value or by the expected value of the profit being less than a specified value, a minimum profit con- straint ( Carri´on et al 2010).

Different papers have been written on improving the electricity production of units by using probability density functions, and expected value, of the upcoming spot price (Sa- hed 2009), (Wu et al 2006), (Ni & Luh 2001). Sahed (2009) claims that when it comes to decision making knowing only the expected value of the outcome is much less use- ful than knowing the distribution of the outcome and consider a measure of risk. This statement agrees with Mylne (2002) who adds that this is especially true for medium- range forecasts where the lead times are greater than 48 hours. Sahed (2009) suggests using the variance of profit between different outcomes as a risk measure where larger variance implies greater risk. Wu et al (2006) divides the electricity price data set into three classes xlow, xnormal, xspike, and by using a classification algorithm determines the likelihood of new input belonging to either of the classes. By knowing the prior distribution of the electricity price sample for each class an estimate of actual price can be assmued. In Ni & Luh (2001) the electricity price is divided into many different seg- ments and allocated a class index for each of the segments. Then by using a bayesian based classification method determines the posterior probability of new input belonging to either of the segments, which can be seen as a discrete probability density function.

Given the segment with the largest prior probability the expected value can be estimated

(24)

using the class index (Ni & Luh 2001).

Using probability distributions has also been helpful when planning an optimal bidding strategy of production units such as in Garcia-Gonz´ales et al (2007), Ravn et al (2005), Conejo et al (2002). Garcia-Gonz´ales et al (2007) studied how to optimise the profit of operating a set of hydro plant by maximising a profit function and implementing two risk-aversion criterias. In their study they suggest implementing a simple mini- mum profit constraint on the profit function to ensure a protection against some worst- case scenarios. The second risk criteria they implemented was minimum conditional value-at-risk (CVaR) to get a protection against the low probability but severe impact outcomes. The CVaR is formulated as the ”minimum profit that will be reached with a probability δ”.

A similar study was performed by Kanamura & Ohashi (2007) on a pumped-storage hy- dropower facility trying to maximise profit considering price spikes by deciding when to pump water and when to generate electricity. They claim that with the increasing volatility on the electricity market the probability of price spikes is a risk that must be manage by all actors on the market. Ravn et al (2005) looked at a system including a CHP, a HOB and an immersion heat unit and wanted to adjust production in the differ- ent units depending on the electricity price. The objective function was defined by a time period were they wanted to minimise the costs of expected production and start-up costs when subtracting the income from electricity production. Same as for most sys- tem that can produce both heat and electricity in one or more production units there is a heat demand that has to be met at all times. In their paper Ravn et al (2005) assumes the production unit to be price taking in the system and thus has no direct influence on the outcome of the spot price. Also Conejo et al (2002) makes the assumption of the production unit being price-taking. They further make the assumption that the expected value of the electricity price is the expected value from the distribution it is chosen from.

The day-ahead price is again assumed a random variable but conditioned by the actual historic electricity price that the distribution is made of. Further Conejo et al (2002) states that the distribution of the random variable - electricity price- is approximately lognormally distributed.

(25)

3 Machine learning

This section will give a theoretical background to supervised machine learning and the classification algorithms that were compared in the study.

Machine learning has been applied to a wide variety of fields such as finance, medicine, telecommunication and more recently also the field of energy studies. Machine learning is typically applied when the details of the complete process cannot be fully explained but assuming that from a large set of data there are patterns that can be recognised and used to make an approximation for the process. The identified patterns can be used to achieve a better understanding of the process, a descriptive model, or to make predic- tions about the process, a predictive model, or both (Alpaydin 2010).

Machine learning can be divided into two subcategories, supervised and unsupervised.

In supervised learning the model is given a set of inputs, xi, i = 1, .., n, accompanied with the corresponding outputs yito train on. The aim of supervised learning is to make accurate predictions of the output on a new set of input variables or to better understand how input variables connect to the output. In unsupervised learning the model is only provided with the inputs xiwithout a corresponding output, yi, and is used to recognise patterns and relationships between these inputs (James et al 2013), (Alpaydin 2010).

Supervised machine learning, which is the method used in this report, can be used to solve both classification and regression problems. Classification is used when the output variable is categorical, the simplest case being a binary class problem where one case is the positive case and the other the negative case. The aim is to find a pattern that ideally describes all positive cases and none of the negatives in order to separate the two classes. The classification problem can also be extended to multiple class classification.

For regression problems the outputs are continuous and the aim is to retrieve a numeri- cal value instead of a categorical (Alpaydin 2010).

(26)

3.1 Performance measures

Classification of price spikes is a highly imbalanced data set problem with price spikes only making up 1% of all outcomes. This can be treated in different ways by classifica- tion algorithms, for example by assigned a higher misclassification cost when the model predicts an actual spike as a non-spike, false negative (F N ), than the cost of a non-spike being misclassified as an actual spike, false positive (F P ). Imbalance between classes must also be considered when comparing different classification algorithms. A normal accuracy measure calculates the percentage of correctly classified points

ACC = T P + T N

P + N . (2)

In the equation above T P is true positive meaning a spike is predicted as a spike, T N is true negative meaning a non-spike is predicted as a non-spike, P is total number of spikes and N is total number of non-spikes.

The accuracy measure in equation 2 is not a good measure when dealing with imbal- anced datasets. If it were used the algorithm that chooses to only classify points as non-spikes is likely to have the highest accuracy because the probability that the point is a non-spike is close to 99%. However, this result would not be useful for the purpose of this study that aims to forecast the minority group, price spikes. Other measures such as precision and recall are better measures (Chawla 2005)

P recision = T P

T P + F P, Recall = T P

T P + F N. (3)

Precision indicates how accurate the model is in classifying price spikes. It measures how many of the classified spikes indeed turned out as spikes. Recall measures how many of the spikes in the data set that were discovered. A good model should have high number in both precision and recall, however when building a model there is a trade-off between the two and one if often prioritised. For example a company looking to buy electricity would aim for a high recall to avoid buying high priced electricity. A high level of precision would be more interesting for a company deciding to start an expen- sive production unit because they need a higher degree of certainty that the electricity price will spike when the model claims it will.

(27)

Comparing different classification algorithms performance for binary classification is often done by plotting the receiver operator characteristics (ROC) curves. ROC curves show the true positive ratio (T P/P ) versus the false positive ratio (F P/N ). In the case of highly imbalanced classes, such as price spike, the Precision-Recall (PR) curve, plot- ting the precision and recall against each other, is a more informative visualisation of the performance when dealing with imbalanced data sets than ROC curves ( Saito &

Rehmsmeier 2015). PR curves are more frequently being used when comparing perfor- mance of classifiers dealing with imbalanced data sets.

ROC curves and PR curves are build by varying the a design parameter, most commonly the probability threshold of class belonging. In this study all PR curves are made by varying the probability threshold. From the PR curve a lower probability threshold for predicting a spike is likely to result in a higher recall but a lower precision because more non-spikes are now being misclassified. The ROC- and PR-curves can therefore also be used as a tool to determine the optimal probability threshold. Both visualising the PR curve and comparing the area under the PR curve (PR-AUC) are useful in model selection. The model with higher value of PR-AUC has simultaneously higher precision and recall (Boyd et al 2013). When considering a ROC curve the performance of a random classifier, the baseline, is a straight line through the diagonal and ROC-AUC is equal to 0.5, regardless of class distribution. The baseline in PR-curves depend on class distribution and is determined by the ratio between positive and negative cases, y = P/(P + N ). For a balanced data set y=0.5 and PR-AUC is equal to 0.5 but for an imbalanced data set where the positive case only makes up 1% of the points the baseline will be a horizontal line at y=0.01 and PR-AUC=0.01 ( Saito & Rehmsmeier 2015). Figure 9 shows an example of the visualisation of ROC and PR curves for an imbalanced data set. In the ROC curve it looks like both algorithm are performing well and the area under the ROC curve is close to 1, where 1 is a perfect classifier. In the PR curve it is noticeable that performance, considering the positive case, is far from perfect.

(Davis & Goadrich 2006).

(28)

Figure 9: Visualisation of ROC vs PR curves (Davis & Goadrich 2006)

3.2 Cross-validation

In machine learning cross-validating the model is a normal measure to examine robust- ness and stability of the model to changes in training data. The aim of which is to estimate how the model will perform in practice and to avoid overfitting the model to a specific training set (Voronin et al 2013). The original data set is first divided into two subsets, one part will be the training and validation set and the other will be a final test set after the classifier has been adjusted. The training and validation set are used to adjust and improve parameters and variable selection in the model through cross- validation. The data is divided into k number of subsets, S1, ..., Sk, of roughly the same size. The algorithm is then trained on all subsets but one, being the training set, and performance evaluated on the last subset, the validation set, Si. This process is iterated for i = 1, .., k, until all subsets have been left out as validation set. The averaged per- formance of the cross-validation folds can be calculated which gives a better measure of the classifiers overall performance (Sammut & Webb 2010).

3.3 Support Vector Machine

Support vector machines (SVM) can be applied to both classification and regression problems in machine learning. When SVM are presented with a two-class classifica- tion problem it finds the hyperplane that provides the widest margin to separate the two classes. By choosing the hyperplane with the largest distance to surrounding points the

(29)

classifier does not only aim at correctly classifying point but it improves generalisation for dealing with unseen data. The data points positioned closest to the hyperplane make up the margin and are called support vectors. Only data point that lie on the margin, the support vectors, will make up the SVM as they make up the decision boundary between positive and negative class prediction. Since most real-world problems are not linear, the SVM can be trained using kernels providing non-linear decision boundaries between the two-classes (Sammut & Webb 2010), (MathWorks 2016a). Choosing an appropriate kernel and kernel settings is crucial for the performance of the SVM.

Real-world problems are often not perfectly separable, meaning a hyperplane can not be positioned in a way that all positive and all negatives points are on different sides. This is solved by implementing a soft-margin SVM allowing for some misclassification to occur at a cost. The strictness of the margin is decided by tuning of the box constraint.

The box constraint decides how many data point are allowed on the wrong side of the hyperplane, indicating how much the hyperplane should be fitted to the data set and how much to generalise. When the box constraint takes on a larger value, the cost of mis- classifying increases which tightens the margin allowing for less misclassification and a hyperplane more fitted to the data set. A small value of the box constraint allows for more violations of the margin and a more general hyperplane (Awad & Khanna 2015).

To further explain SVM the simplest case with only two input variables and a binary class classification is illustrated in Figure 10. The red and blue dots make up the two classes and the dots with circles around them are the support vectors. Along the x- and y-axis are the two input variables. The black line represents the decision boundary that separates the two classes.

(30)

Figure 10: Illustration of how the SVM separates two classes, the red and the blue class, in a simple case with only two variables along the x- and the y-axis. The circled dots are the support vector meaning the data points used to separate classes. (MathWorks 2016a)

3.4 Naive Bayes

Naive Bayes is a probabilistic classifier and works under the naive assumption that the input variables are independent of each other but has shown good results also for viola- tions of this assumption. It is based on Bayes theorem:

P (y = k|x) = P (x|y = k) ∗ P (y = k)

P (x) (4)

P (y = k|x) is the posterior probability that the output, y, belongs to class k given the input variables.

P (y = k) is the prior probability of class.

P (x|y = k) is the probability distribution of input variable given class.

P (x) is the prior probability distribution of input variable.

If the input variable consists of multiple entries, X = [x1, ..., xn]:

(31)

P (y = k|X) ∝ P (x1|y = k) ∗ ... ∗ P (xn|y = k) ∗ P (y = k) (5) In the first training step the classifier approximates the parameters of the probability distributions P (x|y = k). Then for any unseen input vector X = x1, ..., xn the model calculates the posterior probability of the vector belonging to either class and assigns the output variable y ∈ 1, 0 to the class with the largest probability (Zhao et al 2007).

A crucial part of the training step is for the classifier to make a good approximation for the probability density, P (X|y = k) of input variables given the class output. It is therefore important to assign an appropriate distribution to each of the input variables (MathWorks 2016b).

3.5 Ensemble of decision trees

Decision trees have the advantage of being simple and easy to interpret. They are called trees because when segmenting the predictors according to splitting criteria it can easily be visualised as a tree. A new prediction is made by passing it through the splitting criteria until it makes its way to a terminal node (James et al 2013). This is illustrated in Figure 11 where depending on variable value the new input is being classified as either a 1 or a 0 depending on the terminal node it ends up in.

Figure 11: Illustration of an easy interpretable decision tree for two class classification (MathWorks 2016c )

Bootstrap aggregating, often called bagging, can be applied to an ensemble of decision trees. It is a powerful method when dealing with complex systems and can be imple- mented for both classification and regression problems. It builds on the decision tree method but instead of relying on a single tree it averages the result of B trees, where B

(32)

is usually a couple of hundred to a couple of thousand trees. This decreases the vari- ance that comes with only using a single tree. The high variance with decision trees comes from the fact that two decision trees, each trained on one half of the training set, can yield very different outcomes. In bagging the training data set is sampled B times, called bootstrap method, which enables the use of different variations of the training set within the trees. The method of bagging with regards to classification takes the result of class belonging from each individual tree and the majority vote yields the class be- longing. An important parameter when using bagging is the number of trees included in the method. The value is normally chosen as sufficiently large when the performance stops increasing. Choosing a too large number will not lead to overfitting the model but is unnecessarily complex (James et al 2013). The maximum allowed number of splits of a variable at each node is a way of controlling against overfitting such that a smaller number of splits is less likely to overfit the data (Frank & Witten 1996).

(33)

4 Technical background

4.1 Combined heat and power plants at Fortum V¨arme

Production planning of CHP in Sweden is based on the heat demand in the system and electricity is produced as a by-product. In the future it will be more interesting to adapt the production of CHP to better follow the electricity market to improve profit, increase utilisation and reduce volatility on the market. By planning CHP production more to- wards high electricity prices it is likely to generate hours with surplus of heat. In order for CHP to be efficient and profitable there needs to be either a high enough current demand of heat or a storage facility where heat can be stored to when the electricity price is lower and production in the CHP will decrease (Zinko & Gebremedhin 2008).

In this study it is assumed that there is an existing heat demand in the district heating system and that middle or even peak load production units are required to cover the de- mand. For daily average temperatures above 3 degrees middle load production units, in Fortum V¨armes system HP are utilised. If the daily average temperature in between -3 and 3 degrees it is the top middle load production units, HOB fuelled with mixed fatty acids (MFA), which is a type of bio oil, that would start. However, depending on the electricity price, it could be more profitable to start a peak load CHP production unit. In Fortum V¨armes system there is a CHP, called KVV1, that is normally fuelled with fossil heating oil (EO5) but can also use bio oil (MFA). This CHP has the technical capability to be used as a peak load production unit due to its flexibility.

The decision being studied in this report is whether to start a peak load production CHP because the electricity price is likely to yield profit or to produce heat in a heat only production unit. Depending on what unit the CHP replaces in production it comes at a different cost. The risk involved in this decision is a so called speculative risk meaning the risk is accepted as a voluntary choice by the decision makers. Accepting a specula- tive risk could result in either profit or loss. The risk being taken is the higher start-up cost and the higher cost of producing heat in the CHP than in a heat only production unit. The reason for decision makers to accept a speculative risk is the prospect of profit.

The CHP considered in this project, KVV1, has a thermal generating capacity, GCHP,th,

(34)

at 330 MW and an electric generating capacity, GCHP,el, at 210 MW. The amount of electricity that can be produced depends on the amount of heat being produced and the relationship is normally described by an α value, which is the quota between electricity produced in a CHP, CCHP,el, and heat produced in a CHP, CCHP,th:

α = CCHP,el

CCHP,th. (6)

(35)

5 Method

The method section describes how the probability of a price spike occurring was simu- lated and evaluated between different algorithms to find the best performing model. A way of using the model output in production planning is presented along with calcula- tions of economic potential.

Previous literature show that classification algorithms have yielded good results in pre- dicting price spikes on different electricity markets, even though the stochastic nature and rare occurrence of price spikes make them very difficult to predict (Voronin et al 2013) (Koban et al 2015) (Zhao et al 2005). The problem of forecasting the probability of a price spike occurring can be seen as a binary classification problem:

y =

1 if Pt > PT 0 if Pt < PT

. (7)

Where Pt is the power price at a given hour, t, and PT is the power price threshold value to be classified as a spike. A binary classifier is provided with a set of training observations (x1, y1), ..., (xi, yi), the input variables being x and their corresponding output y (James et al 2013). The spike probability at a given hour, t, is the probability that the classifier outputs yt= 1 given the input variables, xt, formulated in equation 8.

The spike probability SP is used to define an optimal spike probability threshold, SPT, for which all probabilities above the threshold are classified as spikes

SP (t) = P rob(yt= 1|Xt). (8)

5.1 Data selection & data pre-processing

Historic data was gathered between 2013-01-01 to 2016-05-31 from the sources stated in Table 1. The purpose of the length of the data set is to allow the classifier to recog- nise seasonal trends in the variables and their correlation to the spot price. Variable that have been included based on the literature review and their sources are listed in the table below:

(36)

Table 1: Input variables included in model selection Variable Historic data source (Resolution) Spot price SE3 Nord Pool (hourly)

Temperature SMHI (hourly)

Humidity SMHI (hourly)

Wind Power Production SE Nord Pool (hourly) Consumption Prognosis SE Nord Pool (hourly) Transmission Capacity SE3 Nord Pool (hourly) Nuclear Power Production SE SVK (hourly)

Hydro Reservoir SE Nord Pool (weekly)

Weekday index - (hourly)

Hour index - (hourly)

Weather variables are from the measuring station in Observatorielunden in Stockholm.

There are two reasons for the choice of this weather station. The first being that it is already the weather station Fortum V¨arme uses in production planning. The second reason is because a large share of consumers live in the Stockholm region thus the tem- perature in Stockholm has the single largest impact on consumption. Weekday index was categorised as 1 or 2, where 1 indicates weekday and 2 indicates weekend. The hour index was categorised between 1-24 for every hour of the day.

Data pre-processing was performed in two steps. Firstly gaps with missing information was filled out. All variables have missing values in association with the start and end of summer time in Sweden, normally end March and end October. The values have been adjusted as the mean of the two surrounding values. For the weather variables other values were also missing, probably due to errors in the measuring equipment, and were also replace with the mean of surrounding values. Secondly before model selection all input variables, xn, were standardised according to equation (9) to avoid any potential bias because of the different order of magnitude. µx represent the mean value of the input variable and σx represents the standard deviation.

xi,new = xi− µx

σ (9)

(37)

5.2 Model selection

The purpose of comparing different classification algorithms is because it is impossible to know beforehand which method will yield a higher performance on the Nord Pool market given the chosen input variables. The following classification algorithms were considered based on their proven usefulness in predicting price spikes on other electric- ity markets; SVM, Naive Bayes and Ensemble of decision trees.

The performance measure that has been used in this study to compare models and al- gorithms is mainly PR-AUC. The reasoning for choosing this performance measure is because PR-AUC, as previously mentioned, is a good performance metrics when deal- ing with imbalanced data sets. The PR curves are calculated by varying the probability threshold, SPT, for when a classified data point should be considered a spike or a non- spike. Reaching a large value of PR-AUC indicates a simultaneously high recall and precision which means the model is performing better than a model with lower PR- AUC.

The data set was first divided into two parts, one for training and validation, and one for testing. To evaluate and get a better measure of in practice performance and re- duce the risk of overfitting a 10-fold cross-validation was implemented to find the best performing classifier. Because the data set is a time series, dividing the subset by ran- domness could potentially be bias since one point in the data set is likely to be similar to its neighbouring points and the performance of the model is likely to be overestimated.

The subsets were therefore divided in 24 hour clusters to reduce the bias. The best model from each algorithm was then applied to the test set to get a better approximation of actual performance on unseen data. The test set was chosen to be October-November 2015. The reason for choosing this time period is because it is representable to the data set with regards to spike percentage and contains both high and low spikes to test performance on and at least one event were it would be profitable to start the CHP.

5.2.1 Model parameters & variable selection

From the theoretical section, explaining machine learning and the different algorithms in more detail, the parameters of importance to tune in order to optimise performance were described. For SVM choosing an appropriate kernel function is very important

(38)

because this enables the SVM to set a non-linear boundary between the two classes.

Choices to choose from in Matlab are radial based function (RBF) or polynomial. Zhao et al (2007) compared RBF and polynomial for the purpose of price spike detection and found that only RBF was useful. Therefore only RBF were considered in this thesis.

When choosing RBF the box constraint and kernel scale must be carefully adjusted and recommended values to alter between are in the interval [1e−3, 1e3] in log-scale for both parameters. The parameters control how many data point are allowed to be on the wrong side of the decision boundary. Meaning it controls how strictly the model should adjust to the specific data set and how much to generalise (MathWorks 2016a).

In Naive Bayes the probability density of a variable given the class, P (x|y = k), is the most important configuration. This parameter is the only parameter that needs to be es- timated when applying Bayes theorem, the rest is calculated from the data set. Choosing a suitable distribution for each input variable improves performance by getting a better approximation of the distribution during the training phase. In matlab possible distri- butions are normal, kernel and multivariate multinomial distribution (MVMN). MVMN should be used if the input variable has categorical values and was therefore chosen for both weekday index and hour index. The other input variables were tested with both normal and kernel distribution. The kernel distribution should be used if the assumption of a normal distribution is too strong, for example if the data set is skewed or has more than one peak. The kernel distribution represents the input variable by a non-parametric probability density function (MathWorks 2016b). When kernel distribution was tried for an input variable the default settings of the kernel were used to save time on number of iterations. The distribution that yielded higher performance was assigned to each input variable.

The ensemble of decision trees uses the method of bagging described in the theoretical section on machine learning. The most important parameter is the number of decision trees and normally a couple of hundred trees is sufficient (James et al 2013). The value was tested between 1 and 1200. The number of trees should be increase until perfor- mance stops improving, increasing it further only adds unnecessary complexity to the model. The second most important parameter is the maximum number of splits since it controls the over- or underfitting to the data set. Maximum number of splits was tried between [20, 210] (MathWorks 2016c ), (James et al 2013).

(39)

The input variables of the model have been chosen based on the literature review. Pre- vious studies show that these inout variables could have an impact on the occurrence of price spikes. It is possible that all the chosen variables are helpful in classifying spikes but it is also possible that only a subset of the variables are useful when predict- ing the output. If only a few are actually needed including more variables would only reduce performance and yields unnecessary complexity in the model. Determining the best subset of variables is called variable selection and in this study it was performed through backward selection. This method was chosen because a complex system such as the electricity price market is more likely to need many input variables to make a good prediction. In backward selection the model is first trained and performance eval- uated through cross-validation including all the variables. Then one by one the variables are removed and performance calculated again. If performance increased, which was noticeable is the value of PR-AUC increased, when removing any of variables, the best version of the model is kept and the excluded variable discarded. This process was re- peated until excluding more variables only reduced the performance of the model and the variables still in the system were chosen as the optimal subset (James et al 2013).

As a complement to the variable selection a matrix with the correlation coefficients be- tween all the variables was calculated in Matlab.

In practice the process of parameter adjusting and variable selection are performed at the same time and is a time consuming and iterative process. As the variables were removed one by one from the algorithms the remaining variables form a unique system.

For each of these systems all different values of the parameters must be tried out to find the best performing set-up for this particular system. It is likely that every system needs different values of the parameters in order to reach optimal performance.

5.2.2 Model evaluation

For each of the three algorithms the best performing classifiers were compared in a PR plot from the performance of training and validation set to see which one had the higher performance. Also the performance on the previously unseen test set were compared in a PR curve. The classifiers were first trained on the whole training and validation set and then applied to the test set. The model with the highest performance on the test set

(40)

will be chosen for further calculations since it is likely that this model will perform best when implemented.

5.3 Decision making in production planning

By defining a threshold for price spikes, PT, on the spot market and using a classifi- cation algorithm to calculate the probability that a spike will occur, the output will be different probabilities for every hour. The second step is to define a probability thresh- old, SPT, that serves the purpose of the study. For different SPT the actual electricity price leading to probabilities in the spike and non-spike group were gathered from the training and validation set. The mean of the spot price was calculated for each class to get an approximation of expected value of the forecasted electricity price depending on the probability output. The test set was used to determine the probability threshold by choosing the threshold that lead to an expected profit as close to the potential profit as possible. The expected profit was calculated using the expected values of the spike and non-spike class and depending on the outdoor temperature the CHP was replaced either a HOB or HP in the system. It was assumed that the CHP would be in production for atleast 24 hours and in full production during profitable hours and 1/3 of full load if non-profit hour. When choosing SPT it was also considered to keep a high recall and a high precision in the final model. Precision was deemed more important than recall since the model would otherwise be likely to overestimate the potential profit. It was also of interest to achieve a high expected value of the spike class.

Depending on the electricity price there is a certain cost associated with producing heat in a CHP instead of producing the same amount in either a HP or HOB. Simulations in M inerva, a simulation programme based on excel used by Fortum V¨arme to simulate the outcome of changes in the system, yielded approximated linear functions between heat production cost and electricity price for replacing a HOB or a HP. By simulating in M inerva the whole system with production units, taxes and fuel prognosis is taken into consideration.

(41)

5.4 Economic potential

The historic economic potential in planning the CHP better according to the electricity price during 2013-01 to 2016-05 was calculated under the following assumptions. All potential days with electricity prices surpassing the fixed value threshold, PT, for more than two hours were evaluated for economic potential in starting the CHP. Depending on the outdoor temperature the CHP will be replacing different units in the system.

With an outdoor daily average temperature of below -3 degrees it is often the case that the CHP is needed to cover the heat demand but the economic potential was calculated as if the CHP would be replacing a HOB fuelled with MFA. When the temperature is between approximately minus three to plus 3 the CHP would be replacing the HOB.

Above 3 degrees it would be replacing, in first place, HP. It was assumed that the CHP would be in production for at least 24 hours. During hours that generate profit the CHP would be in full production and hours generating loss the production would be decreased to one third of full production capacity. The economic potential for 2013-2016 was calculated using the heat production depending on electricity price that was valid for 2015. After 2015 the Fortum V¨armes system changed by introducing a new biomass fired CHP, KVV8, as base load which pushed the CHP considered in this project, KVV1, further towards a peak load production unit. Therefore the economic potential was also calculated using the heat production cost given electricity price approximated with the prognosis for a future scenario to see if there still would be economic potential for the CHP in the future system even if electricity prices remained as they were in 2013-2016.

After approximating the total amount of income that could have been earned the start-up cost for every individual time the CHP would have to be started was subtracted to get a better idea of potential profit.

5.5 System simulations in Minerva

Simulations were performed in M inerva to estimate the effect on the system with re- gards to total system cost and CO2 emissions, with and without KVV1. Simulations were performed with both a lower electricity price at 450 SEK/MWh and a high price scenario at 700 SEK/MWh. The CHP can be fuelled with both bio oil and fossil oil, although today fossil oil is more common. For the different price scenarios it was also tried varying the fuel in the CHP to see its effect on system cost and CO2 emissions.

For each combination of electricity price and fuel the system was simulated with and

(42)

without the CHP and the difference was saved and plotted.

References

Related documents

Much work has been done in the theoretical field of hedging and risk management, but not as regards different hedging scenarios for a smaller electricity trading company to

The reasons behind this result of intraday reductions in price volatility are, according to Mauritzen (2010), due to the supply shift caused by the low marginal cost of

of Mining and Metallurgy (Sect. and Salamon D.G., Traditional vs. Mathematical Optimization Model of Open Pit Mine Planning, 22nd APCOM Berlin, Germany, pp 69-80, 1990.

Others have reported on a connection between the usage of formal methods and development time (shortened) and project failure rate (reduced) [29]. With a cross-disciplinary topic

An effective approach to handle the solving procedure of the ODE (6.8) is that, first, discretize the space domain to yield a nonlinear system of algebraic equations, and then

Ämnets korta historik erbjuder läraren stora chanser att göra Estetisk kommunikation 1 till ett ämne där eleverna får ökad förståelse för andra människor och andra

Therefore, the purpose of this qualitative research is to gain deeper understanding of how the process of knowledge transfer evolves over time and how

concentration dependent intracellular MR imaging contrast properties are shown in the upper panel using monolayer a cell cluster of SkBr3 (i) The pH dependent T2