FULLTEXT01
FULLTEXT01
FULLTEXT01
Viktor Edward
Examensarbete i matematik, 15 hp
Handledare och examinator: Johan Tysk
Maj 2014
Department of Mathematics
Uppsala University
Contents
1 Introduction 3
2 Electricity markets 3
1
Abstract
The liberalization of the electricity market has led to higher volatility and
occasional price spikes. To protect both buyers and sellers, contracts are
needed which requires good understanding of the underlying unit, the daily
spot price.
Calibrating the model is non-trivial since one function and two stochastic
processes are estimated out of one data-set and a method for this is sug-
gested. First the seasonal function is estimated, the Ornstein-Uhlenbeck
process is then estimated from the deseasonalized data and then the spikes
are estimated from extreme outliners.
Using the calibrated model the future spot price is predicated using a Monte
Carlo method and some forward contracts are priced.
2
1 Introduction
In the early 1990s some countries started to liberalize their electricity mar-
kets. From being operated by the government where the price was set to
reflect the marginal cost of production, the market changed to be run by
the free market principle of supply and demand. The market became much
more volatile compared to before which created a demand for contracts to
protect from high prices but sacrificing opportunity to profit from low ones.
Households do not buy their electricity from markets but big companies do.
This thesis focuses on the NordPool market funded in Norway 1991.
Since the liberalization of the market started just about 20 years ago the field
is quite new. But the concepts of options and derivatives are well researched
by now in finance and the idea is to start off by seeing what theory can be
recycled and the goal is to construct a stochastic model of the spot price.
This thesis uses the model proposed by Tino Kluge [1] (University of Oxford)
in his doctoral thesis from 2006 and this thesis is mainly written based on
Kluge’s work and some theory from Björk [2]. The spot price market is
modelled after a simple mean-reverting process with spikes and a seasonal
component. Spikes usually happen when the demand is getting close to the
maximum supply of the market and are unique for the electricity market.
This thesis starts off with a technical description of the Nordpool market in
Chapter 2. In Chapter 3 a model of the spot price is proposed and calibrated
after historical market data, which is the main topic of the thesis. Then
some applications of the model are provided in Chapter 4 and future prices
are predicated. Finally in Chapter 5 conclusions are drawn and future work
suggested.
2 Electricity markets
The first goal of this chapter is to look at the differences between the elec-
tricity market and the stock market to determine what known theory from
the well researched financial area can be recycled. Secondly a more firm
description of the electricity spot and derivative market is given.
3
The assumption of no arbitrage is just like in the financial market the fun-
damental principle which all electricity market options will be based upon.
Underlying unit: The underlying are simply ”units of electricity” and are
mostly bought in units of 1 MWH.
The inability to store electricity makes hedging not possible which leads to
the market being automatically incomplete and independent of the stochas-
tic process used to model the underlying. In other words the risk neutral
probability measure Q is not unique.
NordPool was funded in Norway 1991 when the Parliament of Norway de-
cided to deregulate the power trading market. In 1996 Sweden joined the
market and thus NordPool became the world’s first international power ex-
change market. Eventually more countries also became a part of the Nord-
Pool market, Finland (1998), Denmark (Western in 1999, eastern 2000) and
4
in 2002 Nord Pool Spot were established. Nord Pool Spot also includes Esto-
nia, Latvia and Lithuania. Since 2010 Nord Pool Spot is responsible for the
day-ahead market(the spot market) and NASDAQ OMX for the forward con-
tract market. More than 70 % of all electrical energy in the Nordic countries
are traded through NordPool as of today.
The daily averages, i.e. base load contracts are usually the underlying prod-
uct in contracts. Even though the spot price varies a lot during the day, the
daily average is mostly the underlying product for contracts. The maximum
price of the day can be as high as twice of the minimum. The contracts sold
on the Nasdaq OMX market are of the duration of a week, month, quar-
ter or year and the delivery period is as long as four years for the yearlong
contracts.
Due to the market being incomplete and hedging not possible one could think
the market would be more risky for sellers compared to the stock market.
But since producers produce electricity at an almost known future cost the
risk is almost eliminated in exchange for the possibility for high profits with
contracts.
5
In 2008 hydro power were 98.5 % of Norway’s and 45 % of Sweden’s energy
production. This leads to there being a huge dependence on the weather.
The model proposed however is solely based upon data without trying to
understand the mechanics behind the price.
In Figure 1 the daily spot market price can be seen from 1 January 2012 to
May 2014. First of all the spot price seems to lack any positive drift, so using
a geometric Brownian motion (commonly used in the financial market) for
modelling the spot price is not feasible. Instead a mean-reverting behaviour
is shown and this property will be the base for the stochastic process used.
A strong yearly seasonality is shown, which could be expected in cold Nordic
countries where there are a high demand for heating during the winter. From
Figure 2 a strong weekly seasonality is seen where the price goes down during
weekends and peak during the working days, e.g. day 596 is a Sunday. Several
spikes can also be seen, both positive and even some negative ones, in this
thesis’ model the negative ones will be ignored. The positive spikes are
mostly explained by some power plant temporary being out of function and
the supply and demand principle. Notice how fast the price during spikes
reverts back to normal levels.
6
Figure 2: The daily spot price starting at first of January 2012 zoomed in to
easier examine the weekly seasonality.
There are two main approaches to model a stochastic process. The first one
is trying to understand the underlying mechanics, how has the weather been,
have any new laws been implemented etcetera. The other one, which will be
used, is to simply look at the available data and try to fit a mathematical
model to it.
Considering the observations made in the last chapter a natural model of the
daily spot-price market would be of the form
7
spike process will be added on the form suggested by Kluge and the model
used will be of the form
dXt = −αXt dt + σdWt
dYt = −βYt− dt + Jt dNt (2)
St = exp(f (t) + Xt + Yt )
where Jt is an i.i.d. process representing the jump size, Nt the time in
between the jumps and β a parameter describing how fast the spikes revert
back to the normal level. Wt , Nt and Jt are assumed to be independent. For
simplicity and due to only assuming positive spikes the jump sizes Jt will
be assumed to be exponential and the jump frequency Nt to be a Poisson
process.
Estimating f (t), Xt and Yt from just knowing historical spot price values
St leads to the estimation being non-trivial. However it feels natural to
estimate the deterministic seasonal component first and by removing the
seasonal component of St try to estimate the Ornstein-Uhlenbeck process.
Finally using the estimate of Xt one could identify extreme outliners and use
these to approximate spikes.
For the seasonal part some assumptions of the function f (t) needs to be
made. From the observations in chapter two there were strong weekly and
yearly seasonality and the function is defined to be of the form
6
X
f (t) = c + ai cos(2πγi t) + bi sin(2πγi t), (3)
i=1
8
Figure 3: The least-square estimates with and without outliners excluded
plotted against the spot price data.
Since an estimate of the seasonal function f (t) is acquired the right hand
side of
ln(St ) − f (t) = Xt + Yt . (4)
is left to be estimated. The idea is to ignore the spike process Yt for now and
estimate the Ornstein-Uhlenbeck process Xt . If Xt is estimated one can find
the extreme outliners and use these to estimate Yt . The deseasonalized-log
values can be seen in Figure 4.
9
Figure 4: The log values of the spot price with seasonality removed.
To be able to estimate the parameters α and σ one first need to know the
solution of (5).
dXt = µt dt + σt dWt
1 2 ∂ 2f
∂f ∂f ∂f
df (Xt , t) = + µt + σt 2 dt + σt dWt
∂t ∂x 2 ∂x ∂x
10
Theorem 3.2. The solution to the SDE (5) defining the zero-mean Ornstein-
Uhlenbeck process is given by
Z t
−αt
Xt = X 0 e + σeα(s−t) dWs , (6)
0
for 0 ≤ s ≤ t.
f (Xt , t) = Xt eαt
one get
df (Xt , t) = αXt eαt dt + eαt dXt = σeαt dWt
assuming µ = 0. Integration from 0 to t then gives
Z t
αt
Xt e = X0 + σe−αt dWs
0
and hence Z t
−αt
Xt = X0 e + σeα(s−t) dWs .
0
The solution of the OU-process is later on used for simulations of the model.
Using Theorem 3.2 and the following theorem about Ito integrals one can
find a conditional distribution of change for an OU-process.
where Wt is a standard Brownian motion has expected value 0 and the vari-
ance Z t
f (t)2 dt.
0
11
Proof. The definition of an Ito integral is
Z t X
I := f (t)dWt = f (ti )(Wti+1 − Wti ). (7)
0 ∆ti →0
Brownian motion has the property that increments in time are independent
with the expected value zero and the variance ∆ti . So the expected value of
(7) is given by
X X
EI = E f (ti )(Wti+1 − Wti ) = f (ti )E(Wti+1 − Wti ) = 0.
∆ti →0 ∆ti →0
12
Theorem 3.5. likelihood for an OU-process] Given a set of observations
(S0 , S1 , ..., Sn ), the MLE estimation for a zero-mean Ornstein-Uhlenbeck pro-
cess of the form
dXt = −αXt dt + σdWt
is given by
1 Sxy
α = − log
δ Sxx
1 (9)
σ̂ 2 = Syy − 2e−αδ Sxy + e−2αδ Sxx
n
2α
σ 2 = σ̂ 2
1 − e−2αδ
where δ is the time step and
n
X
2
Sxx = Si−1
i=1
Xn
Sxy = Si−1 Si
i=1
Xn
Syy = Si2 .
i=1
Proof. A short version of the proof will be given. The conditional density
function can be derived using the method used in Theorem 3.4 and gives
The maximum of (11) is found where the partials derivatives are zero, which
13
gives the MLE estimates of α and σ̂:
n
∂L(α, σ̂) δe−αδ X
Si Si−1 − e−αδ Si−1
2
=− 2 =0
∂α σ̂ i=1
Pn (12)
1 Si Si−1
α = − ln Pi=1 n 2
δ i=1 Si−1
and n
∂L(α, σ̂) n 1 X 2
= − 3 Si − e−αδ Si−1 = 0
∂ σ̂ σ̂ σ̂ i=1
n (13)
1 X 2
σ̂ 2 = Si − e−αδ Si−1 = 0
n i=1
which equals the equations in (9). For a rigorous proof see Sitmo [3].
Figure 5: The change each time step for the deseasonalized logarithmic price.
Using the Maximum Likelihood Estimation from Theorem 3.5 a first param-
eter estimation can be acquired. Extreme outliners are then excluded and a
new estimation is done, this process is repeated three times. The changes in
14
Figure 6: The change each time step for the conditioned deseasonalized log-
arithmic price.
Parameter Estimate
α 29.4568
σ 1.4723
each step and a 99.7 % confidence interval can be seen in Figure 5 and the
conditioned change in time can be seen in Figure 6 after one iteration. This
method gives us the parameters in Table 1.
From the algorithm used in the last chapter to estimate the Ornstein-Uhlenbeck
process parameters, the outliners are saved and used to estimate the spike
15
process. The spike process Yt is defined to be
Parameter Estimate
Exp(µ) 0.3122
P o(λ) 106.8000
β 200/365
In total 5 positive spikes were identified and it is easy to estimate the param-
eters µ and λ for the exponential and Poisson distributions. The estimated
16
values can be seen in Table 2 and a realization of the spike model can be
seen in Figure 7.
There is however one big flaw with the method used, only big spike values can
be identified and with the exponential parameter obtained, spikes simulated
can become bigger than realistically possible. To avoid unrealistic results an
upper limit of three times the expected value can be set for the spikes to
avoid bizarre predictions, this limit was set after running several simulations
and observing the model behaviour.
A full calibrated model has now been obtained. A quick way to see if the
model is somehow realistic is to compare some realizations against the his-
torical market data. A realizations can be seen in Figure 8.
17
Obviously it cannot be said that the model is good from comparing one
realization with the old data but at least one can say that the estimation
methods seemingly are correct.
To be able to get a good predication of how the future spot price will develop
a Monte Carlo method is used. Several realizations are made and the average
will be the best prediction. Due to spikes being quite rare (occurring after
a Poisson model with λ = 106.8) many iterations will be needed to give a
fair representation of the spike processes. A rough estimation is that each
day will have a spike every 100th simulation so to simulate them correctly
around 100 000 iterations would be needed at least.
In Figure 9 and Figure 10 predictions after one and 100 000 Monte Carlo
iterations can be seen. Due to the OU-process being mean-reverting with
zero-mean one could expect the price to move towards the seasonal estimation
18
Figure 10: A predication made after 100 000 Monte Carlo iterations of the
calibrated model.
after a while and that is also what is happening. Due to the spike process
the model prediction is however slightly above the seasonal.
The standard formula for pricing forward contracts in the stock market is
not applicable in the electrical market due to there being no price of risk
and no possibility to store the underlying unit traded. Instead the market
practice is to set the price to be the expected value of the spot price for that
day. Forwards lasting a period longer than a day is priced to be the weighted
average during the whole period.
In figure 11 some week and month long forward contracts are priced. The
19
Figure 11: Pricing of forward contracts made after 100 000 Monte Carlo
iterations of the calibrated model with the same weight for every day.
The model proposed in this thesis is not perfect but manages to mimic the
main characteristics of the electricity market well, the seasonal part, the
mean-reverting behaviour and the spikes are all accounted for. To improve
the model some sort of weather prediction added would most likely cause
20
the best improvement since the Nordic countries, Norway and Sweden in
particular, are very dependent on hydro-power hence downfall has a huge
impact on the electricity production. Also warm days, especially during the
weekends, can cause a drop in consumption from private consumers. Even if
industry is responsible for most of the consumption a small drop in demand
can cause a big drop in the price.
As seen from the Monte Carlo predictions in Figure 10 the long term pre-
dictions moves towards the seasonal function. If the goal of the model is to
simply price long term forward contracts an interpolation model might be to
prefer and is also easier to calibrate. However information of the path of the
process is then lost which is needed in the case of pricing Swing Options that
are commonly used in the electricity market. Swing Options gives the buyer
the possibility to change the amount of electricity bought several times and
introduces a path-dependency.
The forward prices predicated from this model were slightly above the mar-
kets. This could be because the market prediction were more local (the price
has been low the last month) or due to risk averse behaviour of the sellers.
Also the model is calibrated after not even 2.5 years of data, in Kluge’s thesis
10 years of data were used. The reason for this is that to get access to more
data from NordPool an expensive membership is required.
21
References
[1] Kluge, T Pricing Swing Options and other Electricity Derivatives. PhD
thesis, University of Oxford 2006.
22