1 Introduction

The electric power sector includes the generation, transmission, distribution and commercialization of electric power. Regulation in the Whole Sale Power Market (WPM) also created the figure of Load Serving Entities (LSE) , which are intermediary agents whose purpose is to make competition dynamic and to provide the final customers with different ways to access competitive prices in the electric market of whole sellers. Regulation in the market allows these agents to sell electric power to their customers through contracts which are endorsed by the electric generators to guarantee supply to the users. LSEs can take endless risks and, in the case of bankruptcy, they have no assets to lose. Electric power generators have warned of the risk that the existence of agents, who had agreed on long-term contracts without a real electric endorsement and used the electric financial market as an instrument to comply with their contractual obligations, could have on the future feasibility of the electric wholesale market. In times of low prices, the LSEs have probably not had any difficulty to comply with their obligations with the electric financial market and signed contracts. On the contrary, in times of high prices, LSEs would be surely facing financial difficulties due to their losses and would opt out of businesses in detriment of the wholesale market and their customers.

In this paper we consider regulated LSEs which are denominated Energy retailers (ER). An energy retailer (ER) procures power from the wholesale market at the spot price and resells it to consumers exhibiting variable demand. ERs have to buy electricity at a variable price set by the supply and demand equilibrium and serve a volatile demand at predetermined fixed prices. Typical ERs meet their obligations through combinations of long-term contracts, wholesale purchases and self-generation. The regulated demand is inelastic, and each ER has the obligation to deliver electricity on demand at the fixed price without failure, independent of costs.

Due to electric power features ERs’ profit is exposed to price and volumetric risks. The ER could hedge price risks by using financial instruments based on electricity price which are available in the financial markets. To hedge volumetric risks storage of electric power is currently not an option, and electricity volume-based financial instruments do no exists. As price and quantity in the electricity markets are correlated with weather, financial instruments based on weather could be used to hedge price and volumetric risks.

In this paper optimal hedging strategies to price and weather risks factors are proposed. The strategy consist of mitigating ER risk by constructing a contingency claim based on price and weather derivatives. The use of weather derivatives offers the chance to hedge against weather related risks in electric power markets. Companies hedge their portfolios against unexpected weather variations using contracts that are not correlated with classical financial assets, but are based on weather-linked indexes instead. This contracts allow the agents to transfer their risks exposures to financial markets, using financial instruments to hedge price and quantity fluctuations via climatic fluctuations.

We consider the hedging of price and weather risks in a discrete setting where price, quantity and weather index take values on a discrete set. We construct a contingency claim based on price and weather-linked derivatives, without any assumption on the underlying distributions. We construct such claim, optimizing the Mean-variance utility function for the ER. Mean-variance (Markowitz 1952) is the basis of the modern portfolio allocation strategies, leading the field of Decision Making in Financial Economics. Due to its simplicity mean-variance is widely used as an approximation to more general expected utility functions (see, Morone 2008). This paper exploits the convexity of the Mean-Variance utility function, which makes possible to find a global optimum to the posed optimization model (Boyd and Vandenberghe 2004).

1.1 Contribution

We construct a closed-form solution in discrete setting for the static hedging strategy for ERs whose net profits are exposed to price and quantity risks associated with weather fluctuations.

In Theorem 1 we provide an analytical closed form solution in terms of the input data, which is the probability of observing a given price-quantity-weather index combination and the ERs risk aversion coefficient. We also analyze this optimal solution. In Corollary 1 we show a ‘two fund theorem’ result; namely, for any risk averse ER the optimal contingent claims can be written as a combination of two ‘basic’ contingent claims. In Sect. 2.2 we show that when the risk free measure and the real world measure coincide, the optimal solution is unique, independent of the ER’s level of risk aversion; in this case, there exist contingent claims which maximize the expected profit and minimize the risk at the same time. In Sect. 2.3 we show that when weather and price are independent the price contingent claim and the weather contingent claim could be constructed by separately finding the optimal price contingent claim and the optimal weather contingent claim. Finally in Sect. 2.4 we characterize the efficient frontier of the model.

In practical terms, the discrete setting is more appropriate than the continuous one. First, the discrete setting allows a non-parametric approach, where any general discrete distribution could be used, including the case when dependence between price and weather occurs. Notice that this in contrast to the continuous setting, where the existing results depend on the type of distribution underlying the variables of interest (e.g. Id Brik and Roncoroni 2015); Lee and Oren 2009) which requires a (semi-) parametric approach.

Second, the set of assets traded in the market is a discrete set, and thus is more natural to assume that the available data is discrete in nature. Third, it is easier to interpret the outputs of the discrete model. In particular, is much simpler to replicate an optimal contingent claim in the discrete setting (see: Su 2008).

Our methodology allows the use Quadratic Optimization (QO), which is an optimization model that is efficiently solvable. Notice that even though we obtain a closed form solution, the existing efficient solvers for QO offer the possibility for extensions to our model which could include more constrains.

The rest of the paper is organized as follows. In the rest of this Section the preliminaries are presented. In Sect. 2 our solution to the hedging portfolio problem is presented. In Sect. 3 numerical experiments are performed to illustrate our results, and Sect. 4 concludes.

1.2 Weather risk and weather derivatives

Earnings obtained by weather-sensitive industries are affected by weather anomalies which is the case of energy industries (Dutton 2002). Weather risk in electric power markets is significant; unexpected changes in weather or hydrology could affect quantity and price fluctuations. In countries with seasons, random movements in temperature affect electric power demand. Huisman (2007) shows that the difference between actual and expected temperature significantly influences the probability on a spike in day-ahead prices in power markets. In some tropical countries, which are affected by hydrological conditions, demand is correlated with weather fluctuations and electricity production is based on hydro-generation (see Pantoja 2011).

Evidence from the Colombian and the US markets shows that climate variation affects spot price and quantity behavior. The wholesale spot price in Colombia exhibits volatile behaviour, for instance in November 2010 average daily price per KWh was 14.1% less than in November 2009 due to La Niña phenomenon (138 COPs per KWh in November 2010, and 160.7 COPs per KWh in November 2009). In the generation side, there was 19.8% more capacity in 2010 after the effects of 2009 El Niño had diminished (75.2% in 2010 and 55.4% in 2009). Similarly, in the US, the spot price in PJM Market reached $141 per MWh in the summer of 2010, while the previous summer the price range was $31–$80. In the summer of 2010 load in the PJM system was 135 GW, while for the previous summer was around 186 GW. For more detail see Pantoja (2011).

Weather derivatives could be used to hedge unexpected changes in weather. These kind of derivatives were first launched in 1996 in the Chicago Mercantile Exchange (CME), in the United States, as a mechanism of protection against weather anomalies; since then, they are used by companies to transfer climate-related risk to capital markets. The underlying of weather derivatives are the weather fluctuations, and thus weather derivatives are use to smooth out weather related revenue fluctuations for companies, transforming non-tradable risk into tradable financial securities, which brings financial and commercial benefits (Jewson 2004). Weather derivatives are based on indexes of temperature, such as the Cooling-Degree-Days (CDD) and the Heating-degree-Days (HDD) at the CME.

The weather derivatives market does not have yet an effective pricing model. Constructing such model is difficult, due to the incompleteness of the market and the fact that weather derivatives are basically a speculative security as weather indexes are not a tradable commodity or a delivery asset. Richards et al. (2004) presented a pricing model based on a temperature process constructed from a mean-reverting Brownian motion. Chaumont et al. (2005) considered a model where under an equilibrium condition, the market price of risk is uniquely determined by a backward stochastic differential equation; this stochastic equation is translated into a semi-linear partial differential equation which is solved using two simple models for sea surface temperature.

1.3 Risk hedging in the electricity market

The hedging of price, quantity and weather risks in the Electricity market have been considered in recent literature. Several authors follow Markowitz’s mean-var methodology (Markowitz 1952) to construct hedging strategies. Woo et al. (2004), studied the interaction between stochastic consumption volumes and electricity prices, and proposed a mean-var model to determine optimal hedging strategies. Näsäkkälä and Keppo (2005) developed a hedging strategy for risk mitigation using forward contracts based on price, their formulation is an extension of the formulation given on (McKinnon 1967) to obtain the optimal hedge ratio considering price and quantity risks. Oum and Oren (2008) extended the model of Näsäkkälä and Keppo (2005) to include price derivatives in the hedging strategy. Lee and Oren (2009) extended Oum and Oren (2008) model, via the inclusion of forwards based on weather-linked indexes. Pantoja (2011) and Id Brik and Roncoroni (2016) considered the case of risk hedging assuming independence between price and weather index.

Other Risk measures have also been considered. For instance, Vehvilainen and Keppo (2006) suggested using value at risk as risk measure, when managing risk in the electricity market. Hedging of ER’s risk under value at risk using price derivatives has been considered by Oum and Oren (2008); Kleindorfer and Li (2005); Woo et al. (2004), and Wagner et al. (2003).

1.4 The hedging model

We study a one stage model for the hedging problem for one ER. The ER buys electricity at the spot price p and sells it at fixed retail price r at a fixed time T. Therefore the ER’s profit, at time T, from serving the customers’ demand q is \(y(p,q)=(r-p)q\). The retail price r is fixed and known, while the demand q and the spot price p are random.

To hedge risks due to price and quantity fluctuations, the ER constructs contingent claims \(x_p(p)\) and \(x_w(w)\), which represent the payoffs of financial portfolios based on electricity price and weather-index instruments respectively. These contingent claims are functions of the electric spot price and the weather index respectively. Notice that we work directly with contingent claims, and disregard the details on how to construct replicating portfolios composed by vanilla and derivatives. For such details, in discrete setting, see (Leung and Loring 2016).

To find the optimal contingent claims we use the following optimization model proposed by Pantoja (2011) (see also, Id Brik and Roncoroni 2016).

$$\begin{aligned}\max _{x_p,x_w}& \quad{\text {E}}^{\psi }[y(p,q)+x_p(p)+x_w(w)] - a {\text {Var}}^\psi [y(p,q)+x_p(p)+x_w(w)]\nonumber \\ {\text {s.t.}}&\quad{\text {E}}^{\phi }[x_p(p)]=0 \nonumber \\&\quad {\text {E}}^{\phi }[ x_w(w)]=0. \end{aligned}$$
(1)

In model (1) the probability measure \(\psi\) supported on \(\{(p,q):p \ge 0,\,q \ge 0\}\) represents (the ER beliefs on) the real distribution of the realization of p and q at time T, and \(\phi\) is a risk neutral probability measure. Notice that we do not assume \(\phi\) to be unique, since the electric power market is incomplete. The expectations \(E^{\psi }[.]\) and \(E^{\phi }[.]\) denote expectations under the probability measure \(\psi\) and \(\phi\), respectively.

The objective of (1) is to maximize the Mean-Variance utility function \(U(Y) = Y - a(Y-E^\psi [Y])^2\) of the ER’s hedged profit at time T. Model (1) seeks to maximize the ER’s expected utility, under the constrain that the cost of constructing the financial portfolios with contingent claims \(x_p(p)\) and \(x_w(w)\) is zero, that is those portfolios are zero-cost.

Notice that in this context having two separate zero-cost portfolios with contingent claims \(x_p(p)\) and \(x_w(w)\) is equivalent to having one zero-cost portfolio with contingent claim \(x_p(p) + x_w(w)\). We prefer to keep them separated in the constrains of model (1), as this simplifies our exposition.

Oum and Oren (2008), develop a static hedging estrategy based on composition of portfolio price-based financial energy instruments, where only a contingent claim \(x_p(p)\) is considered. Lee and Oren (2009) extend Oum and Oren (2008) model to one that includes forwards on weather index, which is equivalent to model (1) restricting the weather contingent claim to be of the form \(x_w(w) = \alpha w\), where \(\alpha\) is an optimization variable. Considering a contingent claim \(x_w(w)\) of general form offers the possibility of a better hedge, as shown in our numerical examples (Sect. 3). Also the consideration of general contingent claim makes the optimization problem more complex. Pantoja (2011) and Id Brik and Roncoroni (2016) derive first order conditions for model (1) and use them to find a closed form solution in the case when the price is not correlated to the weather index.

All the previous works assume the distributions \(\psi\) and \(\phi\) are continuous and known. In contrast, we work on a discrete setting. That is we assume the distributions \(\psi\) and \(\phi\) to be discrete and known. We present a closed form solution, derived using QO. The existence of efficient solvers for QO opens the possibility to modelling extensions. For instance, transaction costs and/or robustness could be added as linear or second order constraints, which produce models that are still efficiently solvable. Moreover, the combination of the discrete setting and the QO-based methodology, allows to consider any general discrete distribution, including the case when price and weather are not independent. Notice that working with continuous distribution requires working on a semi-parametric setting (see e.g. Id Brik and Roncoroni 2016) while discrete distributions allow to use a non-parametric data-based setting (see Sect. 3).

2 Optimal hedging via quadratic optimization

In this section we present a Quadratic Optimization based approach to solve model (1). We assume a discrete setting with n possible prices, m possible values for the weather index, and \(\ell\) possible values for quantity. That is, we are given a set \(P =\{p_i:i=1,\dots ,n\}\) a set \(W = \{w_j:j=1,\dots ,m\}\) and a set \(Q = \{q_1,\dots ,q_{\ell }\}\) of possible prices, weather index values and quantities respectively. In this setting, the ER- beliefs distribution \(\psi\) is a probability measure supported on \(P \times Q \times W\) and the risk-free distribution \(\phi\) is a probability distribution supported on \(P \times W\).

Let \(\mu _y = {\text {E}}^{\psi }[y(p,q)]\) be the expected value of y(p,q) under \(\psi\), and \(\sigma ^2_y = {\text {Var}}^\psi [y(p,q)]\) be its variance. Let \(\psi _p\) be the marginal of \(\psi\) on P, that is \(\psi _p(p) = \sum _{q,w}\psi (p,q,w)\). We will abuse the notation and also use \(\psi _p \in {\text {R}}^n\) to denote the corresponding vector of marginal probabilities. Similarly define \(\psi _w\). Also, let \(\psi _{pw}(p,w) = \sum _{q}\psi (p,q,w)\) be the 2-marginal on \(P \times W\) of \(\psi\). Again, we will abuse the notation and use \(\psi _{pw}\) to denote the corresponding matrix of marginal probabilities. Also, for any p, define \(\mu ^p_y(p) = {\text {E}}^\psi [y(p,q)|p]\), and use \(\mu _y^p\) to denote the corresponding vector in \(R^n\). Similarly define \(\mu ^w_y\).

Notice that our decision variables are vectors \(x_P\) and \(x_W\) indexed by P and W respectively. This vectors represent the contingent claim function value at each \(p \in P\) (resp. \(w \in W\)). More exactly, the price-contingent claim function is \(x_p = x_P^T \delta _P\), where \(\delta _P\) is a random vector drawn from \(\{u \in \{0,1\}^P: \Sigma _p u_p = 1\}\) according to \(\psi _p\). I.e. \(\delta _P\) is the random 0-1 vector with exactly one 1 in the realized p. Analogously \(\delta _W\) is defined to obtain \(x_w = x_W^T \delta _W\). We obtain then the following straightforward proposition.

Proposition 1

Let \(\delta _P\) and \(\delta _W\) be defined as above. We have then,

  1. 1.

    \({\text {E}}^{\psi }[\delta _P] = \psi _p\) and \({\text {E}}^{\psi }[\delta _W] = \psi _w\).

  2. 2.

    \({\text {E}}^{\psi }[\delta _P \delta _P^T] = {\text {Diag}}(\psi _p)\) and \({\text {E}}^{\psi }[\delta _W\delta _W^T] = {\text {Diag}}(\psi _w)\).

  3. 3.

    \({\text {E}}^{\psi }[\delta _P \delta _W^T] = \psi _{pw}\).

  4. 4.

    \({\text {E}}^{\psi }[\delta _P y(p,q)] = \psi _p \circ \mu _y^p\) and \({\text {E}}^{\psi }[\delta _Wy(p,q)] = \psi _w \circ \mu _y^w\), where \(\circ\) is the component-wise product of vectors.

From Proposition 1 we obtain

$$\begin{aligned} {\text {E}}^{\psi }[y(p,q)+x_p(p)+x_w(w)]&= {\text {E}}^{\psi }[y(p,q)] + {\text {E}}^{\psi }[x_P^T \delta _P] + {\text {E}}^{\psi }[x_W^T \delta _W] = \mu _y + \psi _P^T x_P + \psi _W^Tx_W. \end{aligned}$$

And, letting \(e_P\) (respectively \(e_W\)) denote the all-ones vector indexed by P (resp. W),

$$\begin{aligned} {\text {Var}}^{\psi }&[y(p,q)+x_p(p)+x_w(w)] \\&={\text {Var}}^\psi [y(p,q)]+{\text {Var}}^{\psi _p}[x_P^T \delta _P]+{\text {Var}}^{\psi _w}[x_W^T \delta _W]\\&\qquad + 2{\text {Cov}}^{\psi }[x_P^T \delta _P,y(p,q)]+ 2{\text {Cov}}^{\psi }[x_W^T \delta _W,y(p,q)]+2{\text {Cov}}^{\psi }[x_P^T \delta _P,x_W^T \delta _W] \\&= \sigma ^2_y+ x_p^T({\text {E}}^{\psi }[\delta _P \delta _P^T] - {\text {E}}^{\psi }[\delta _P]{\text {E}}^{\psi }[\delta _P]^T)x_p + x_w^T({\text {E}}^{\psi }[\delta _W \delta _W^T] - {\text {E}}^{\psi }[\delta _W]{\text {E}}^{\psi }[\delta _W]^T)x_w\\&\qquad + 2( E^{\psi }[y(p,q)\delta _P] - E^{\psi }[y(p,q)]E^{\psi }[\delta _P])^T x_P + 2( E^{\psi }[y(p,q)\delta _W] - E^{\psi }[y(p,q)]E^{\psi }[\delta _W])^T x_W\\&\qquad \qquad + 2x_P^T ( E^{\psi }[\delta _P \delta _W^T] - E^{\psi }[\delta _P]E^{\psi }[\delta _W]^T)x_W \\&= \sigma ^2_y+ x_p^T({\text {Diag}}(\psi _p) - \psi _p\psi _p^T)x_p + x_w^T({\text {Diag}}(\psi _w) - \psi _w\psi _w^T)x_w + 2x_P^T ( \psi _{pw} - \psi _p\psi _w^T)x_W\\&\qquad + 2 (\mu _y^p\circ \psi _p - \mu _y \psi _p )^T x_P + 2 (\mu _y^w \circ \psi _w - \mu _y\psi _w )^T x_W. \end{aligned}$$

We obtain then,

$$\begin{aligned}&{\text {E}}^{\psi }[y(p,q)+x_p(p)+x_w(w)] - a{\text {Var}}^{\psi }[y(p,q)+x_p(p)+x_w(w)] \\&\qquad =\mu _y - a\sigma ^2_y + (\psi _p + 2a c_p)^T x_P + (\psi _w + 2a c_w)^T x_W - a\begin{bmatrix}x_P \\ x_W\end{bmatrix}^T \begin{bmatrix}M_{pp} &{} M_{pw}\\ M_{pw}^T &{} M_{ww}\end{bmatrix} \begin{bmatrix}x_P \\ x_W\end{bmatrix} \end{aligned}$$

where

$$\begin{aligned} c_p&= \mu _y\psi _p - \mu ^p_y \circ \psi _p&c_w&= \mu _y\psi _w - \mu ^w_y\circ \psi _w \nonumber \\ M_{pp}&= {\text {Diag}}(\psi _p) - \psi _p\psi _p^T&M_{ww}&= {\text {Diag}}(\psi _w) - \psi _w\psi _w^T&M_{pw}&= \psi _{pw} - \psi _p\psi _w^T. \end{aligned}$$
(2)

Similarly,

$$\begin{aligned} {\text {E}}^{\phi }[x_p(p)] = \phi _p^T x_P \qquad \text { and }\qquad {\text {E}}^{\phi }[x_w(w)] = \phi _w^T x_W \end{aligned}$$

where

$$\begin{aligned} \phi _p \in {\text {R}}^n {\text { and }}\phi _w\in {\text {R}}^m \end{aligned}$$
(3)

are the marginals of \(\phi\).

Model (1) is then equivalent to

$$\begin{aligned} \mu _y - a\sigma ^2_y +\displaystyle \max _{x_P,x_W}\qquad&\begin{bmatrix}\psi _p + 2a c_p \\ \psi _w + 2a c_w\end{bmatrix}^T\begin{bmatrix}x_P\\ x_W\end{bmatrix} - a\begin{bmatrix}x_P \\ x_W\end{bmatrix}^T \begin{bmatrix}M_{pp} &{} M_{pw}\\ M_{pw}^T &{} M_{ww}\end{bmatrix} \begin{bmatrix}x_P\\ x_W\end{bmatrix}\nonumber \\ {\text {s.t.}}\qquad&\phi _p^T x_P=0 \nonumber \\&\phi _w^T x_W =0 \nonumber \\&x_P \in {\text {R}}^n,\,x_W \in {\text {R}}^m \end{aligned}$$
(4)

To simplify the notation, define \(M =\begin{bmatrix}M_{pp} &{} M_{pw}\\ M_{pw}^T &{} M_{ww}\end{bmatrix}\), \(B = \begin{bmatrix} \phi _p &{} 0 \\ 0&{} \phi _w\end{bmatrix}\), \(b = \begin{bmatrix} \phi _p \\ \phi _w\end{bmatrix}\), \(c = \begin{bmatrix}c_p\\ c_w\end{bmatrix}\) and \(d = \begin{bmatrix}\psi _p \\ \psi _w \end{bmatrix}\).

The matrix M is positive semidefinite. Thus, for a>0 model (4) is a (convex) QO Problem. For QO the first order conditions (FOCs) imply optimality (Keller 1973). In Sect. 2.1. next, an optimal solution is obtained from the FOCs.

2.1 Closed form solution in the discrete setting

In Theorem 1 we give a closed-form solution to model (4). Obtaining a closed form solution is possible as model (4) only has equality constrains. Adding restrictions on the contingent claims might be desirable in practical situations. For example one might want to constrain the corresponding portfolio to closely follow a given benchmark (see Cornuéjols et al. 2006). Many constraints used in practice can be expressed as linear constraints on the contingent claims and thus when added to model (4) the model will be still a QO problem which could be solved efficiently. Commercial packages such as Cplex (2017) and Gurobi (2017) could solve QO Problems very efficiently.

Theorem 1

Let \(a> 0\).

  1. 1.

    The pair \((x_P,x_W)\) is an optimal solution to model (4) if and only if there exist \(\lambda _p, \lambda _w \in {\text {R}}\) such that

    $$\begin{aligned} 2aM \begin{bmatrix} x_P\\ x_W \end{bmatrix} + B \begin{bmatrix} \lambda _p \\ \lambda _w \end{bmatrix}&= 2ac + d {\text { and }} B^T \begin{bmatrix} x_P\\ x_W \end{bmatrix} =0. \end{aligned}$$
    (5)
  2. 2.

    Let \(\hat{M}\) (resp. \(\hat{b}\), \(\hat{c}\) and \(\hat{d}\)) be the matrix obtained from dropping from M the last of the p-rows (resp. p-entries) and the last of the w-rows (resp. w-entries). The unique solution to model (4) is

    $$\begin{aligned} \begin{bmatrix} x_P\\ x_W \end{bmatrix} = \begin{bmatrix} \hat{M}\\ B^T \end{bmatrix} ^{-1} \begin{bmatrix} \hat{c} + \frac{1}{2a}(\hat{d} - \hat{b})\\ 0 \end{bmatrix}\nonumber \\ \lambda _p = 1, \qquad \lambda _w =1 \end{aligned}$$
    (6)

Proof

To prove the first part, notice that because the feasible set of model (4) is a polyhedron, the first order conditions (5) are necessary conditions for the optimal solutions (see, e.g. Eustaquio et al. 2008). Also, as M is positive semi-definite, model (4) is convex. Also \((x_p , x_w) = (0,0)\) is a Slater point, and thus (5) is sufficient for optimality (see, e.g. Boyd and Vandenberghe 2004).

To prove the second part, Let \(e_p \in {\text {R}}^n\) and \(e_w \in {\text {R}}^m\) be the all ones vectors. Multiplying (5) to the left by \(\begin{bmatrix}e_p^T&0 \end{bmatrix}\) we obtain

$$\begin{aligned} 2a e_p^T M_{pp} x_p + \lambda _p e_p^T \phi _p = e_p^T \psi _p + 2a e_p^Tc_p. \end{aligned}$$

But, \(e_p^T M_{pp} = 0\), \(e_p^T \phi _p =1\), \(e_p^T \psi _p =1\) and \(e_p^T c_p = 0\). Thus \(\lambda _p =1\). Similarly \(\lambda _w =1\). Thus (5) is equivalent to

$$\begin{aligned} \begin{bmatrix} M\\ B^T \end{bmatrix} \begin{bmatrix} x_P\\ x_W \end{bmatrix}&= \begin{bmatrix} c +\frac{1}{2a}(d - b)\\ 0 \end{bmatrix}. \end{aligned}$$
(7)

Let \(u_1 = {\tiny \begin{bmatrix}e_p \\ 0 \end{bmatrix}}\) and \(u_2 = {\tiny \begin{bmatrix}0 \\ e_w \end{bmatrix}}\). Then \(Mu_i =0\), \(cu_i = 0\) and \((d-b)u_i = 0\) for \(i=1,2\). Thus, dropping the last of the p-rows and the last of the w rows we obtain that (7) is equivalent to

$$\begin{aligned} \begin{bmatrix} \hat{M}\\ B^T \end{bmatrix} \begin{bmatrix} x_P\\ x_W \end{bmatrix}&= \begin{bmatrix} \hat{c} + \frac{1}{2a}(\hat{d} - \hat{b}) \\ 0 \end{bmatrix}, \end{aligned}$$
(8)

from where (6) follows. \(\square\)

Remark 1

Part 2 of Theorem 1 implicitly assumes that \(\begin{bmatrix}\hat{M}\\ B^T\end{bmatrix}\) is invertible. Generically, this is true, as \(\hat{M}\) is full row rank (see Lemma 1 below), and the rows of \(B^T\) are generically linearly independent from the rows of M, given the nature of the distributions \(\phi\) and \(\psi\).

Computing \(\begin{bmatrix}\hat{M} \\ B^T\end{bmatrix}^{-1}\begin{bmatrix}\hat{c} + \frac{1}{2a}(\hat{d} - \hat{b})\\ 0\end{bmatrix}\) is equivalent to solving the system \(\begin{bmatrix}\hat{M}\\ B^T\end{bmatrix} \begin{bmatrix}x_P\\ x_W\end{bmatrix} = \begin{bmatrix} \hat{c} + \frac{1}{2a}(\hat{d} - \hat{b}) \\ 0\end{bmatrix}\) which can be solved using \(O((n+m)^3)\) operations. In general this systems are solved using Gaussian elimination or QR decomposition. In the case of ill-posed systems robust versions of this methods can be used, which generate good approximate solutions. For more information see, e.g., Meyer (2001)

For any a let \(x^a = \begin{bmatrix}x_P^a\\ x_W^a\end{bmatrix}\) where \(x_P^a\), \(x_W^a\) are the optimal solutions to model (4). Let

$$\begin{aligned} x^o = \begin{bmatrix} x_P^o\\ x_W^o \end{bmatrix} = \begin{bmatrix} \hat{M} \\ B^T \end{bmatrix} ^{-1} \begin{bmatrix} \hat{d} - \hat{b}\\ 0 \end{bmatrix} {\text { and }} x^\infty = \begin{bmatrix} x_P^\infty \\ x_W^\infty \end{bmatrix} = \begin{bmatrix} \hat{M} \\ B^T \end{bmatrix} ^{-1} \begin{bmatrix} \hat{c}\\ 0 \end{bmatrix} \end{aligned}.$$

In Corollary 1 we show that for any \(a>0\) the optimal contingent claim \(x^a\) is a linear combination of \(x^o\) and \(x^\infty\). Corollary 1 is a sort of Two Fund Theorem (see Cornuéjols et al. 2006). In particular this implies that the optimal hedging portfolio is a combination of the hedging portfolios corresponding to \(x^o\) and \(x^\infty\). Notice that \(x^\infty\) is the contingent claim minimizing the total profit risk, while \(x^o\) is in correspondence to the contingent claim maximizing the expected value of the hedged profit. That is any optimal portfolio can be obtained by combining a risk-efficient portfolio with a profit maximizing portfolio. Theorems of this type are important as they allow to compute optimal portfolios even when the risk aversion parameter a is not exactly known.

Corollary 1

For any \(a>0\)

$$\begin{aligned} x^a =x^\infty + \tfrac{1}{2a} x^o. \end{aligned}$$
(9)

Proof

Follows from the definition of \(x^o\) and \(x^\infty\) and (6). \(\square\)

To finish we present Lemma 1, a technical result, which guarantees the existence of the closed form solution (see Remark 1, and the subsequent paragraph).

Lemma 1

The matrix M is psd, with row rank \(n+m-2\). In particular, \(\hat{M}\) the matrix obtained dropping from M the last of the p-rows and the last of the w-rows is full row-rank.

Proof

M is the Variance-Covariance matrix of the vector \(\begin{bmatrix}\delta _p\\ \delta _w\end{bmatrix}\), thus it is psd. We claim now that all eigenvalues of M are positive except for the smallest two, corresponding to the eigenvectors \(\begin{bmatrix}e_p\\ 0\end{bmatrix}\) and \(\begin{bmatrix}e_w\\ 0\end{bmatrix}\), where \(e_p \in {\text {R}}^n\) and \(e_w \in {\text {R}}^m\) are the respective all ones vectors. To prove this let \(\begin{bmatrix}u\\ v\end{bmatrix}\) be an eigenvector with 0 as corresponding eigenvalue. We have then

$$\begin{aligned} VaR[u^T\delta _p + v^T\delta _w] = \begin{bmatrix} u\\ v \end{bmatrix} M \begin{bmatrix} u\\ v \end{bmatrix} = 0, \end{aligned}$$

which implies, \(u = \alpha e_p\) and \(v = \beta e_w\), where \(\alpha\) and \(\beta\) are scalars.

As M is a psd matrix with exactly two zero eigenvalues, M has row-rank \(m+n-2\). Also, from symmetry of M, \(\begin{bmatrix}e_p^T&0\end{bmatrix}\) is a left eigenvector of M with eigenvalue 0, that is \(\begin{bmatrix}e_p^T&0\end{bmatrix}M = 0\). This means that the last of the p-rows of M is a linear combination of the other p-rows. Similarly the last w-row is a linear combination of the other w-rows. Thus dropping this two rows we obtain a matrix of the same row-rank as M, that is \(n+m-2\) that has exactly \(n+m-2\) rows. I.e. it is full row rank. \(\square\)

2.2 Analyzing the solution when \(\phi = \psi\)

Next, we analyze the rather unrealistic case when \(\phi = \psi\). Special attention has been paid to this case in Oum and Oren (2008), Pantoja (2011) and Id Brik and Roncoroni (2016). Oum and Oren (2008) noted that assuming \(\phi = \psi\), when constructing the price only hedging in the continuous setting, the optimal contingent claim is \(x_p = \mu _y - \mu _y^p\) independent of the value of a. Our next result is that, under the assumption \(\phi = \psi\) the optimal contingent claims in the general case are also independent of a.

Corollary 2

Assume \(\phi = \psi\). For any \(a>0\) the optimal solution to (4) is independent of a.

Proof

If \(\phi =\psi\), we have that \(b=d\) and thus \(x^o=0\). Thus, from Corollary 1 we have \(x^a = x^\infty\). \(\square\)

As can be seen from the proof of Corollary 2, when \(\phi = \psi\) the optimal solution to model (4) is the contingent claim that minimizes the total risk, for any \(a>0\). A limiting argument shows that this solution is optimal also when \(a =0\), that is, this contingent claim also maximizes the expected total profit.

2.3 Solution to the independent case

If the price and the weather index are independent, solution (6) simplifies further as shown in Corollary 3.

Corollary 3

Assume the price and the weather index are independent according to \(\psi\). Then the solution to model (4) is given by

$$\begin{aligned} x_P&= \begin{bmatrix} \hat{M}_{pp} \\ \phi _p^T \end{bmatrix} ^{-1} \begin{bmatrix} \hat{c}_p + \frac{1}{2a}(\hat{\psi }_p- \hat{\phi }_p) \\ 0 \end{bmatrix} \\ x_W&= \begin{bmatrix} \hat{M}_{ww} \\ \phi _w^T \end{bmatrix} ^{-1} \begin{bmatrix} \hat{c}_w + \frac{1}{2a}(\hat{\psi }_w - \hat{\phi }_w) \\ 0 \end{bmatrix} \end{aligned}$$

Proof

If p and w are \(\psi\)-independent we have \(M_{pw} = 0\), and thus using part 2 of Theorem 1 the statement follows. \(\square\)

Remark 2

Notice that in the case of \(\phi\)-independence between p and w we have \(\mu ^p_y(p) = {\text {E}}^\psi [y(p,q)|p] = {\text {E}}^\psi [(r-p)q|p] = (r-p){\text {E}}^\psi [q|p]\). Similarly \(\mu ^w_y(w) = {\text {E}}^\psi [y(p,q)|w] = {\text {E}}^\psi [(r-p)q|w] = (r-{\text {E}}^\psi [p]){\text {E}}^\psi [q|w]\).

In the case of \(\psi\)-independence between p and w, the optimal solution corresponds to solving independently the hedging problem for p and w. One can check that in this case, the optimal contingent claim pair \((x_p,x_w)\) given by Corollary 3 solves the problems of constructing the best contingent claim using information on price only, and information on weather only, separately. This can also be shown by analyzing the optimization model (4), if \(M_{PW} = 0\) the model separates, that is model (4) is equivalent to

$$\begin{aligned} c_y + \max _{x_P}\quad &c_p^T x_P - x_P^T M_{pp} x_P\qquad + &\max_{x_P} \quad & c_w^T x_W - x_W ^T M_{ww} x_W \\ {\text {s.t.}}\quad & b_p^T x_P = 0 & {\text {s.t.}}\quad&b_w^T x_W =0\\ &x_P \in {\text {R}}^n && x_W \in {\text {R}}^m. \end{aligned}$$

Corollary 4 describes the optimal contingent claims for the independent case when \(\phi = \psi\) is assumed.

Corollary 4

Assume \(\phi = \psi\) and w independent of p. Then the optimal contingent claims are \(x_p = \mu _y - \mu _y^p\) and \(x_w = \mu _y - \mu _y^w\).

Proof

This is easily checked directly by plugin in the given \(x_p\), \(x_w\) and \(\lambda _p = \lambda _w = 1\) in part 1 of Theorem 1. \(\square\)

2.4 Efficient frontier

We apply now Markowitz (1952) concept of efficient frontier to our model for hedging the electric power market. In Sect. 3, we use the results of this section to compare different solutions to model (4). There, we compare the efficient frontier of the solution obtained by wrongly assuming independence between price and weather with the solution obtained by assuming the right level of correlation. By comparing the efficient frontier of this two solutions, we observe that the solution to the general case dominates, in the Pareto sense, the independence-based one.

Proposition 2

For any \(a>0\), let \(x^a_p\) and \(x^a_w\) be the optimal solution for model (1). Then

$$\begin{aligned} {\text {E}}^{\psi }[y(p,q)+x^a_p(p)+x^a_w(w)]&= \mu _y + d^T x^\infty + \tfrac{1}{2a} d^T x^o\\ {\text {Var}}^{\psi }[y(p,q)+x^a_p(p)+x^a_w(w)]&= \sigma ^2_y - c^T x^\infty + \tfrac{1}{2a}(c^T x^o + (d - b)^T x^\infty ) + \tfrac{1}{4a^2}(d - b)^Tx^o. \end{aligned}$$

Proof

From Corollary 1 we have \(x^a = x^\infty + \tfrac{1}{2a}x^o\). Then

$$\begin{aligned} {\text {E}}^{\psi }[y(p,q)+x^a_p(p)+x^a_w(w)]&= \mu _y + d^Tx^a = \mu _y + d^T x^\infty + \tfrac{1}{2a} d^T x^o. \end{aligned}$$

Also, using (7),

$$\begin{aligned} {\text {Var}}^{\psi }[y(p,q) +x^a_p(p)+&x^a_w(w)] = \sigma ^2_y - 2 c^T x^a + (x^a)^T M x^a\\&= \sigma ^2_y - 2c^T x^a + (c + \tfrac{1}{2a}(d - b))^Tx^{a} \\&= \sigma ^2_y - c^T x^a + \tfrac{1}{2a}(d - b)^Tx^a \\&= \sigma ^2_y - c^T x^\infty + \tfrac{1}{2a}(c^T x^o + (d - b)^T x^\infty ) + \tfrac{1}{4a^2}(d - b)^Tx^o. \end{aligned}$$

\(\square\)

3 Numerical results

In this section we evaluate our proposed solution. We use data similar to the one used in Lee and Oren (2009). Namely, we construct hedging strategies for an ER that charges a flat retail rate of $120 per MWh. We assume lognormal distributions of price and quantity. Under \(\psi\) the three variables, price, weather index and quantity are distributed according to a multivariate normal distribution in log price, log quantity, and the weather-index. Under \(\phi\) price and weather index are distributed according to a bivariate normal distribution in log price and weather-index. In all cases, except when looking at the efficient frontier, the risk aversion parameter is fixed to \(a = 1.0\).

Our method is set in a discrete frame. So to apply the method, we should have as input discrete distributions. To do this, the given continuous distributions are discretized using a grid with \(n=100\) points equally spaced from \(\mu - 3\sigma\) to \(\mu + 3\sigma\) in each of the coordinate axis (log price, log quantity and weather-index), where \(\mu\) and \(\sigma\) are respectively the mean and the standard deviation of the projection of the corresponding multivariate normal distribution in the given axis. So in total \(n^3\) triples (price, quantity, weather-index), each one with a probability value assigned are obtained as input. We calculate joint distributions of p, q and w according with the marginals \(\Psi _{p}\) and \(\Psi _{w}\).

To produce the output in each case, first contingent claims \(x_p^*\) and \(x_w^*\) are obtained by solving the corresponding case (using Theorem 1 or one of its corollaries). The distribution of the hedge profit is then plotted computing the hedged profit for each of the \(N = n^3 = 1000\) data points in the input and using the matlab function ksdensity which allow us to produce profit distributions plots for each strategy.

3.1 Independence case

In the independence case, it is possible to use the analytical solution for the continuous case obtained by Pantoja (2011) and Id Brik and Roncoroni (2016)]. We compute this continuous solution, using as input the distributions’ parameters given for the independence case. Then we compare the analytic continuous solution against our discrete independence solution. This solution is obtained using Corollary 3. Following (Lee and Oren 2009) we use the parameters given in Table 1 for the input distributions

Table 1 Data parameters for the independence case

Notice that the discrete independence solution can be interpreted as an approximation to the continuous solution. To check the quality of the approximation we vary the number of data points. Besides from \(N = 1000\) we take \(N= 512\), 2016 and 5400. As could be observed in Fig. 1 the solutions obtained using both methods do not differ much from each other. Figure 1a, shows the comparison between continuous and discrete setting using profit distributions with the different number of data-points. Figure 1b illustrates that difference. We can see that as the number of data-points increases the results converge to the continuous solution. Also for \(N=1000\) we already obtain a good approximation, as the discrete and the continuous solutions are very close.

Fig. 1
figure 1

Profit distributions independent case. Continuous versus Discrete solutions. Left: Profit density distribution, right: Profit quantiles

Next we compare three different strategies for the independence case solution in discrete setting: “No-hedge”, “Price Only” and “Price and Weather”, we can see the gain when the weather claim is included into the hedging strategy. Figure 2 shows the profit distributions in the independence case for the three strategies. We can observe that both hedges reduce the variance of profit relative to the No-hedge strategy.

Fig. 2
figure 2

Profit distribution in the independence case for different strategies: no-hedge, price only and price plus weather. Left: Profit density distribution, right: Profit quantiles

Table 2 shows the numerical value of the Quantiles plotted in Fig. 2b. By looking at the table values as well a the figures it can be seen that price plus weather hedge cuts off the left tail of profit distribution compared to the price only hedging. That is the Discrete independence solution allows the ER to protect itself against rare but detrimental events by hedging weather risk.

Table 2 Profit Quantiles in the independence case for different strategies: no-hedge, price only and price plus weather

3.2 General case

In this section we evaluate the proposed methodology in the general case. Without the independence assumption, there is no solution for the continuous case, and thus we only consider the discrete frame. We use the same data parameters as in the previous section (independence case) except for a positive correlation between w and p (See Table 3).

Table 3 Data parameters for the general case

Figure 3 illustrates the comparison of four possible strategies “No-hedge”, “Price Only”, “Weather Only” and “Price and Weather”. The weather only strategy seems to dominate in distribution the no-hedge strategy. While the price only has smaller risk, but also has smaller expected profit. As expected, the effect of hedging reduces the variance. When price and weather instruments are use together risks is reduced more than when only price or weather instruments are used.

Fig. 3
figure 3

Profit distributions in the general case under the strategies: No hedge, Price only, Weather only, and Price and weather. Left: Profit density distribution, right: Profit quantiles

Electricity markets face a higher level of loss risk which conduces to profits that are distributed with heavy tails (see, Andriosopoulos and Nomikos 2015). The lognormal distributions exhibits fat-tails. In order to analyze how these fat tails affect our models we run a numerical experiment in which we analyze how the tail of both contigent claims, price and weather, change due to changes on volatility (sigma = 0.1, 0.25, 0.5 and 0.72) for each price and weather separately, while keeping a fixed correlation value (rho = 0,75). In Fig. 4 we can observe that the claims (namely the price hedging and weather hedging) show high volatilities levels and if volatility changes that event may produce a heavy tail or extreme value. Still, our model will generate a gain over the other models used as a reference. Fig. 4 shows the fat tails, for different values of volatility \(\sigma\), for price and weather contingent claims.

Fig. 4
figure 4

Tails of price and weather contingent claims for different values of volatility sigma. Left: Price claim, right: Weather claim

3.3 Independence case as proxy to general case

Id Brik and Roncoroni (2016) suggest using the Independence case solution as a proxy to solve the general case. They argue that if the correlation between p and w is small, the solution obtained under the independence assumption is almost optimal for the general case. Next, we analyze the difference between the independence case solution (see Corollary 3) and the general case solution (see Theorem 1) when the correlation \(\rho\) between p and \(\log w\) varies from \(0\%\) to \(75\%\).

First, we analyze how the weather and the price claim change as the correlation between price and weather index vary. As can be seen, while changes in the correlation only produce small changes in the price contingent claim, the weather contingent claim is affected by the level of correlation between p and w (Fig. 5). In the weather contingent claim the effect is rather strong with the weather payoff offering a better hedge as correlation increases. Thus when using the independence solution, the price claim will be almost optimal for all values of correlation \(\rho\), while the weather claim will lose quality as \(\rho\) increases.

Fig. 5
figure 5

Optimal contigent claims for weather and Price, for Independent and General cases with different values of correlation. Left: Price claim, right: Weather claim

We can see that the general solution completely dominates the one constructed under the independence assumption. This fact is illustrated, in Fig. 6, where the efficient frontier for the optimal solution of the general case (see Corollary 2) and for the independence case solution are presented. To see the effects on the hedge, Fig. 7 shows the gain of the General case over the Independence one in terms of profit distribution and Quantiles.

Fig. 6
figure 6

Efficient frontiers for the hedges using price and weather instruments, under the independence assumption and for the General Case

Fig. 7
figure 7

Profit distribution for the hedges using price and weather instruments, under the independence assumption and for the General Case. Left: Profit density distribution, right Profit quantiles

In Fig. 8 hedge profit distributions under different levels of correlation \(\rho = 0.13\) and \(\rho =0.75\) are compared. The figure illustrate that similarly to what is observed in the comparison between the general and independence case, the hedge improves as the level of correlation between price and weather increases.

Fig. 8
figure 8

Hedged profit for different level of correlation between p and w in the General Case solution

4 Conclusions

This paper develops numerical methods to determine the optimal derivative contingent claim written on both electricity price and a weather; aiming to improve the performance of the hedging claim due to the link between price, demanded quantity and weather-linked index. We introduce a discrete framework which allows to construct optimal contingent claims as functions of price and weather, without any assumption on the underlying distributions. Our solution method is based on Quadratic Optimization; we give a closed form solution for the basic model consider here, where only zero cost constraints on the contingent claims are considered. But, the Quadratic Optimization model could be applied under more general linear and second order constraints, in which case numerical solutions could be obtained.

Our method improves upon the existing literature, which has only considered the case when weather linked index and price are independent (Id Brik and Roncoroni 2016 and Pantoja 2011). Our numerical results illustrate the gain due to the inclusion of the weather variable, improving on existing hedging positions. Our results confirm that the weather contingent claim allows adjustment of hedge strategy with the price contingent claim in order to hedge the double exposure of the agents. Our numerical results support the gain of the proposed strategy over the best performing claim derived for strategies using price instruments only and over strategies using price and weather instrument assuming independence of price and weather.

We derive several results characterizing the optimal contingent claims. In particular we show the existing of a ‘two fund’ theorem in this case. Also, we show that when the market measure and the real world measures coincide the optimal solution to the given model, for any \(a \ge 0\) is the contingent claim that minimizes the total profit risk and maximizes the expected total profit.