Utility indifference pricing and hedging for structured contracts in energy markets

In this paper we study the pricing and hedging of structured products in energy markets, such as swing and virtual gas storage, using the exponential utility indifference pricing approach in a general incomplete multivariate market model driven by finitely many stochastic factors. The buyer of such contracts is allowed to trade in the forward market in order to hedge the risk of his position. We fully characterize the buyer's utility indifference price of a given product in terms of continuous viscosity solutions of suitable nonlinear PDEs. This gives a way to identify reasonable candidates for the optimal exercise strategy for the structured product as well as for the corresponding hedging strategy. Moreover, in a model with two correlated assets, one traded and one nontraded, we obtain a representation of the price as the value function of an auxiliary simpler optimization problem under a risk neutral probability, that can be viewed as a perturbation of the minimal entropy martingale measure. Finally, numerical results are provided.


Introduction
Since the start of the energy market deregulation and privatization in Europe and in the U.S., the study of energy markets became a challenging topic both for the practical effects of energy availability, as well as in terms of the theoretical problems of pricing and hedging the related contracts. In fact, these contracts are typically more complex than the standard contracts present in financial markets such as bonds, stocks, options and so forth, as they usually incorporate optionality features which can be exercised by the buyer at multiple times. A notable example are swing contracts, which are one of the two main types of contract which are used in energy markets for primary supply, the other one being forward contracts. Swing contracts give the buyer some degrees of freedom about the quantity of energy to buy for each sub-period, usually with daily or monthly scale, subject to a cumulated constraint in the contract period. This flexibility is much welcomed by contract buyers, as energy markets are influenced by many elements such as peaks in consumption related to sudden weather changes, breakdowns of power plants, financial crises and so on. Apart from these standardized contracts, many other kinds of contract are traded in the energy market and are often negotiated over-the-counter. Also some of them, like virtual storage contracts, include an optionality component for the buyer which can be exercised at multiple times as in swing contracts.
The pricing problem of these products has a consolidated tradition in discrete time (see [18] and references therein), where the most used approach is based on multiple stopping and optimal switching techniques as in, e.g., the papers [13] and [12]. A different method to compute swing price based on optimal quantization has been proposed in [28] and [29]. Finally, a very recent paper on natural gas storage in discrete time is [24], where a new joint model for spot and futures is developed and tested on real US market data.
In this paper, we will follow another approach, which consists in approximating the contracts payoff with its time continuous counterpart, as it has been proposed in [4,10] for swing contracts and in [15,19,36] for virtual storage contracts. The advantage of this approach is that it makes the pricing problem more tractable, since it allows to use the stochastic control machinery based on HJB equations. In those papers, the price of a structured contract is defined -in analogy with American options -as the value function of some maximization problem, reducing the pricing issue to numerically solve a suitable Bellman equation in discrete time, or a partial differential equation of Hamilton-Jacobi-Bellman (HJB) type in continuous time. This approach relies on the fact that the contract value is obtained by maximizing, over all the strategies available to the buyer, the expected value of the sum of an intermediate and a final payoffs under a suitable equivalent martingale measure, which is usually interpreted as "pricing" measure.
All those papers, however, suffer from the following two drawbacks: first, they lack a sound financial justification to the definition of the price as the value function of a stochastic control problem. Moreover, a theoretical justification of the "risk neutral" pricing procedure cannot be found in the literature either, as the underlying of the contract is either not traded in any official market (as for certain types of crude oil or natural gas), or, even if it is traded, it is not storable in an efficient way. The second drawback of this valuation technique is the absence of the hedging counterpart in the literature on energy structured derivatives. This is a nontrivial problem, as the assets traded in the market usually are forward contracts on the relevant commodity, and not on the spot itself. The only exception is the paper [38] which focuses on gas storage contracts, using a delta hedging approach. We end our discussion on related literature with the papers [26] and [32], that deal with the pricing of a physical/industrial asset using a utility indifference approach with an investment component. The optimization problems studied therein are mathematically similar to the one arising from utility indifference pricing of energy structured products, one difference being that the controls affecting the asset they price are in switching form with finitely many states. The methods they used are based on optimal switching, in [26], and on reflected BSDEs, in [32]. For an extensive review of the existing literature with a detailed comparison of the main articles, we refer to the forthcoming book [1].
The main contribution of the paper consists in giving a sound financial justification of the definition of price used in the papers previously cited, such as, e.g., [4,10], and in computing such price together with the corresponding hedging strategy for a buyer, who can invests in quite a general incomplete market for forward contracts.
To do so, we will adopt the utility indifference pricing (henceforth UIP) approach, which is one of the most appealing way of pricing in incomplete markets. Indeed, the models of commodity markets are typically incomplete, meaning that there exist infinitely many prices compatible with the no-arbitrage principle. This is due to the presence of non tradable factors, the most notable example of which being spot electricity prices. The UIP approach allows to select one of those prices, taking into account the risk aversion of the agent. We refer to the survey [25]) and the references therein for an exhaustive treatment of this topic.
We consider a large class of incomplete multivariate market models, with finitely many risky assets (forward contracts on energy), with diffusive dynamics and whose coefficients depend on a certain number of exogenous factors. This setting includes many models that have been previously studied in the literature, e.g. the ones in [3,11,14,35].
Within the UIP approach, we solve the problem of evaluating a class of structured derivatives, such as swing and virtual storage contracts. We compute the UIP of such products for an agent investing in the forward market and whose preferences are described with an exponential utility function. The UIP is characterized as the unique viscosity solution of a suitable nonlinear PDE. In the complete market case, this PDE reduces to the particular cases treated for example in [4,10,15,19,36]. In both complete and incomplete cases, the solution of this nonlinear PDE gives an effective way to compute an optimal withdrawal strategy for the structured product, as well as a portfolio strategy to partially hedge the financial position deriving from it. As expected, in the complete market case, the financial hedge in terms of forward contracts turns out to be perfect. Moreover, in a model with two assets and constant correlation, we obtain a representation of the price as the value function of an auxiliary simpler optimization problem under a risk neutral probability, that can be viewed as a perturbation of the minimal entropy martingale measure. To our knowledge, that measure change has never been used before in the incomplete markets literature.
The paper is organized as follows. In Section 2 we formulate the problem, by introducing the general form of the structured contracts that we want to price, and the exponential utility indifference pricing approach, with a first result on the case of complete markets. In Section 3 we characterize the UIP in terms of viscosity solutions of a suitable nonlinear PDE; in the complete market case, this PDE is consistent with previous results found in literature for swing and virtual storage contracts. In Section 4, we consider a particular case of an incomplete market with one traded asset which is correlated with the underlying of the structured product. In this case, the price has a simpler form and it can be expressed via the so-called minimal entropy martingale measure. Section 5 presents some numerical results which illustrate the previous findings.
Notation. In what follows, unless explicitly stated, vectors will be column vectors, the symbol "*" will denote transposition and the trace of a square matrix A will be denoted by tr(A). Furthermore, a, b := a * b stands here for the Euclidean scalar product and a⊗b := ab * denotes the Kronecker product. We choose as matricial norm |A| = tr(AA * ). On the set S n of all symmetric squared matrices of order n, we define the order A ≤ B if and only if B − A ∈ S + n , the subspace of nonnegative definite matrices in S n . We will denote I n the identity matrix of dimension n.

Formulation of the problem
We aim at finding the utility indifference price of a structured contract in energy markets, e.g. a swing or a virtual storage contract, for a buyer whose preferences can be described by an exponential utility function U with risk aversion parameter γ > 0, i.e., U (x) = − 1 γ e −γx for x ∈ R. We will always assume throughout the paper that the interest rate is zero.

Description of the products
In this section we are going to describe the class of products we are aiming to price using the utility indifference approach. The payoff of a typical structured contract in energy markets is, in general, given by a family of random variables indexed by control processes u, which typically represents the marginal quantity of commodity purchased and it will belong to a suitable set of admissible controls U that we will specify later. P in the above Equation (2.1) is the spot price of the commodity (e.g., gas) and Z u t := z 0 + t 0 u s ds for all t ∈ [0, T ], for some nonnegative initial value z 0 ≥ 0. Two main products that we have in mind are, i.e., swing contracts and virtual storage contracts. More details are given below.
Example 2.1 (Swing contract). For a swing contract one has (see, e.g., [4,10]) where K is the purchase price, or strike price and the control u is any progressively measurable process, such that u t ∈ [0,ū] for all t ∈ [0, T ] and some fixed thresholdū > 0. These products usually include some additional features, such as inter-temporal constraints on u or on the cumulated control Z u or some penalty function appearing in the payoff. More precisely, constraints on u and Z u are typically of the form Z u T = T 0 u s ds ∈ [m, M ], with 0 ≤ m < M , with possibly further intermediate constraints on Z u t i , t i < T , i = 1, . . . , k. In the absence of such additional constraints, a penalty is usually present which can be expressed as a function Φ of the terminal spot price P T and cumulated consumption Z u T . A typical form of Φ could be for constants C > 0 and 0 ≤ m < M (see [4,10] and references therein). We will focus on the latter case, i.e., a non-zero penalty function Φ(P T , Z u T ) without any other contraints on the admissible controls.
Example 2.2 (Virtual storage contract). These products replicate a physical gas storage position, while being handled as pure trading contracts. In this case one has L(p, z, u) = p(u − a(z, u)), with C, M > 0 suitable constants, a(z, u) :=ā1 u<0 and the control u is such that where u in , u out are suitable deterministic functions given by the physics of fluids: their typical shapes are given constants [15,19,36].

The market model
In this section we present a very general market model, which will typically be incomplete. All the processes introduced below will be defined on a probability space (Ω, F, P) equipped with the natural filtration (F t ) t∈[0,T ] generated by a d-dimensional Brownian motion W . Moreover, let F = F T . We assume that the driver of the economy is an m-dimensional state variable X t with Markovian dynamics given by The process X is a state variables vector, in the sense that the spot price underlying the structured contract is a deterministic function of it, i.e., P t = p(t, X t ) for all times t ≥ 0, where p : [0, T ] × R m → R is a given measurable function.
We also assume that n ≤ d forward contracts are traded in the market, with maturities T 1 < . . . < T n , with T 1 ≥ T . By calling F i the price of the forward contract with maturity T i , i = 1, . . . , n, we assume that the dynamics of F := (F 1 , . . . , F n ) is where µ F : [0, T ] × R m → R n and σ F : [0, T ] × R m → R d×n are continuous functions. Under such assumptions, the SDEs (2.2) and (2.3) are well-known to admit a unique strong solution (X, F ) such that X 0 = x and F 0 = f 0 . We will also make the following Assumption 2.3. (i) The forward volatility is uniformly elliptic, i.e., for some > 0, There exists a positive constant c such that, for a.e. x ∈ R m , uniformly in t where ς(t, x) denotes the smallest eigenvalue of the matrix (σ * F σ F )(t, x), i.e., Remark 2.4. For sufficient conditions for (2.5) to hold, we refer to Remark 2.3 in [30].
Notice that the forward contracts are not necessarily written on the commodity with spot price P t , as they could be written also on a correlated commodity. For instance, P could be the spot price of gasoline, while the F 's are written on oil, as in [11,20]). This can be also due to illiquidity or non-existence of forward contracts relative to the commodity: for a detailed discussion of this phenomenon, see [11,Section 2.3].
Example 2.5 (Linear dynamics). This example is a slight generalization of the model used in [11]: set where a, k, σ, δ, θ, σ P are real constants, the correlation ρ belongs to (−1, 1), and W 1 , W ⊥ are two independent Brownian motions. Here F represents the price of a forward contract with maturity T written on a commodity, whose spot price is P t := e Xt . By letting W := (W 1 , W ⊥ ), we obtain the situation above in the special case where the (log-)spot price is the unique state variable. For k = 1 we obtain exactly the model in [11].
Example 2.6 (Cartea-Villaplana). The model introduced by Cartea and Villaplana in [14] for the spot price of electricity is a two factor model: the logarithm of the electricity spot price P at time t is decomposed into the sum of two stochastic factors X C and X D , i.e., with α C < 0 and α D > 0, where h represents a seasonal deterministic component. The factors X i t , i = C, D, are Ornstein-Uhlenbeck (OU) processes driving, respectively, the capacity and the demand, with dynamics where k i are constant coefficients, σ i are deterministic measurable functions of time and W i are one-dimensional Brownian motions such that d W C , W D t = ρdt with a constant ρ. If we now represent W D as W D = ρW C + 1 − ρ 2 W ⊥ with W ⊥ independent of W C , then again W := (W C , W ⊥ ) is a bi-dimensional Brownian motion. Assuming that interest rates are independent of the spot price, then the forward price where B(t, T ) is a suitable function of time. This is clearly a particular case of our setting. Notice that the Cartea-Villaplana model reduces to the Schwarz-Smith model [35] for α C = α D = 1 and k C = 0 (or k D = 0).
Example 2.7 (Aïd-Campi-Langrené-Pham). Another model that can be included into our setting is an uncontrolled version of the one proposed in the paper [3] for electricity, where the spot price is given by P t = p(t, D t , C t , S t ), with p a suitable real-valued Lipschitz function linking the demand for electricity D, the capacities C = (C 1 , . . . , C n ) and the fuel prices S = (S 1 , . . . , S n ) with the spot price P . For the precise shape of such a function we refer to [3]. The function p models the behavior of an electricity producer having n technologies at his disposal and setting the spot price after looking at the levels of demand and capacities. The demand D t and the i-th capacity, i = 1, . . . , n, are given respectively by . . , n, are bounded deterministic measurable functions describing the seasonality effects, and Z i , i = 0, . . . , n, are OU processes Finally, S t is modelled as a multidimensional, cointegrated geometric Brownian motion, i.e., where Ξ and Σ are n × n matrices with 1 ≤ rank(Ξ) ≤ n, and W S is a n-dimensional Brownian motion. Under suitable conditions on the cointegration matrix Ξ, the prices S i t are strictly positive whenever the initial prices are. In this model, the forward prices are given by It turns out that, with a suitable choice of the market price of capacity and demand risk, the dynamics of the forward prices under P has the same form as in Equation (2.3), with X = (D, C, S). We refer to the original paper [3] for more details on the model and the corresponding capacity control problem, and to the paper [8] for the pricing and hedging of non-smooth Vanilla options using the UIP approach.
We suppose that the market model is arbitrage free, i.e., that there exists at least one (local) martingale measure Q, equivalent to P.
We consider an agent (buyer) at time t ∈ [0, T ], who is exposed to a position q ≥ 0 in a given structured product with global payoff C u T , depending on the control u ∈ U. Assume that (s)he is able to trade in the financial market described above. Trading takes place by the agent investing at time s the amount of wealth π i s in the forward contract F i for all i = 1, . . . , n, so that the stochastic differential of the agent's portfolio can be expressed as where we recall that ·, · denotes for the Euclidean scalar product in R n and we use the symbolic notation In order to define the UIP of any structured product, we need to specify the set A of admissible strategies (u, π) that the agent is allowed to use for maximising his expected utility.
Definition 2.8. Letū > 0 be a given threshold. The set of admissible controls A is the set of all couples (u, π), where u is any adapted process such that u t ∈ [0,ū] for all t ∈ [0, T ], and π is any progressively measurable R n -valued process such that for some ε > 0. We will denote by U the set of all admissible controls u. Moreover, A t (resp. U t ) will be the set of admissible controls (u, π) (resp. admissible controls u) starting from t. Now, we are in the position to define the utility indifference (buying) price of a given structured product C T = (C u T ) u∈U for an agent with an exponential utility function U (x) = − 1 γ e −γx , γ > 0, x ∈ R. We will use the notation C u t,T for the payoff of the structured contract C u T starting at time t, i.e., Moreover, we set C u T = C u 0,T . Definition 2.9. The utility indifference (buying) price at time t for a position q ≥ 0 in the structured product, when starting from the initial portfolio value y t , is defined as the unique solution v t ∈ R (whenever it exists) to where E t stands for the conditional expectation given F t .
Clearly, V (y 0 , q) represents the maximal expected utility from terminal wealth, computed at time 0, that an agent with an exponential utility can obtain starting from an initial wealth y 0 and having a position q ≥ 0 in the structured product.
Remark 2.10. In principle, it seems that controls associated to the virtual storage contract described in Example 2.2 do not satisfy Definition 2.8, where the control u t belongs to [0,ū] withū constant. However, this example can be reduced to our setting by simply reparameterizing the control. In fact, one could define a new control c with values in [−1, 1] such that the old control u satisfies u t = f (c t , Z t ) for a suitable function f (c, z) given by

The complete market case
In this section, we will consider the complete market case. We say that our market model is complete if there exists a unique equivalent (local) martingale measure Q for the forward prices F . To simplify the notation, we drop the arguments from the coefficients in the dynamics of X and F . It is well known that in general there exists (not uniquely) a market price of risk λ ∈ R d such that where 1 = (1, . . . , 1), so that the dynamics of F and X, under the corresponding riskneutral measure Q, are where W Q is a Q-Brownian motion. However, if d = n and σ F has full rank n, then the market is complete and we obtain and the dynamics of X under the unique equivalent martingale measure Q becomes In the complete market case the UIP is straightforwardly characterized, as stated in the following result.
Proposition 2.11. Assume that d = n and that σ F has full rank. Moreover, suppose that, for all u ∈ U t , C u t,T ∈ L 2 (Q, F T ) and the replicating portfolioπ u is admissible as in for all times t ∈ [0, T ], initial positions q ≥ 0 and t-time wealths y t . Moreover, if the supremum in Equation (2.13) is attained by u * , then there exists an optimal hedging strategy π * for the structured product, which is the replication strategy of qC u * t,T . Proof. By assumption, for every admissible control u ∈ U t , there exists an admissible strategy π u such that where we have used the fact that if (u, π) and (u, π u ) belong to A t , then (u, π + q π u ) ∈ A t . As a consequence, v t is the unique solution to To conclude, notice that V is strictly increasing in its first argument, thus the equation above has v t = sup u∈Ut qc u t as unique solution, and the conclusion follows. Furthermore, if the supremum in Equation (2.13) is attained by u * , then the replication strategy of C u * t,T is a perfect hedging strategy for C.
Remark 2.12. Since in this case the UIP v t is the value function of the control problem (2.13), it is also possible, under further regularity assumptions on the model coefficients, to express it as a solution of a suitable HJB equation (see Corollary 3.7).

The incomplete market case: characterization of the UIP with viscosity solutions
In this section we will, first of all, turn the maximisation problem (2.10) into a more tractable stochastic control problem, by suitably changing the state variables. Secondly, we will derive heuristically the HJB equations for the value functions in Equation (2.10), indexed by the quantity q of structured product that the agent has in his portfolio, and the PDE for the utility indifference price v t , as defined in Equation (2.9). Finally, we will prove that the log-value functions can be characterized as unique continuous viscosity solutions to suitable PDEs with the right terminal conditions. The UIP will be given by the difference between the two log-value functions, corresponding to the problems with and without the claim. This will be done by using techniques developed in Pham [30] together with recent results on uniqueness for a class of second order Bellman-Isaacs equations, established in Da Lio and Ley [16].

Reformulation of the problem and HJB equation
Let t ∈ [0, T ]. We rewrite the terminal wealth as follows, using Equation (2.1): We now want to reformulate the maximization problem in Equation (2.10) in a more standard way with a Markovian dependence. In order to do so, we first recall that P t = p(t, X t ) and to emphasize the dependence of the value function on X and Z u , we enlarge the set of independent variables in V , so that we can define the running value function as: We have then obtained a stochastic control problem where the state of the system is (Y u,π , X, Z u ), the control is given by the pair process (u, π), the running cost function is null, the terminal cost function is G and the dynamics of the state variables are with initial conditions (Y t , X t , Z t ) = (y, x, z). Again, the UIP for a position q ≥ 0 in the structured product is the unique solution (whenever it exists) v t ∈ R to Equation (2.9), which we rewrite here with an explicit dependence on the new variables: We conclude this subsection with a first preliminary rigorous result showing that the value function V defined above is a (possibly discontinuous) viscosity solution of a Hamilton-Jacobi-Bellman (HJB) equation in the interior of its domain. The connection between such a PDE and the price will be examined in the next subsections.
Proof. As it is now formulated, the maximisation problem (3.1) can be treated analogously as in [31], in particular in Proposition 4.3.1 (viscosity supersolution property) and in Proposition 4.3.2 (viscosity subsolution property). All the arguments there can applied to our problem as well. For instance, it can be easily checked that the value function is bounded since it is trivially nonpositive and, being (u, π) = (0, 0) an admissible strategy, we have V (t, y, x, z; q) ≥ − 1 γ e −γ[y+q inf p∈R ((T −t)L(p,0,0)+Φ(p,0))] > −∞ since the infimum above is finite by assumption. The rest of the proof is omitted since it follows closely the ones in [31].

The pricing PDE: heuristics
In this section we derive, in a heuristic way, the PDE that the UIP of the structured product C u T with running payoff L and penalty Φ is supposed to satisfy. In this case, as it is classical with exponential utility functions (see, e.g., the papers [5,6,7,25,37]), we have that V (t, y, x, z; q) = e −γy V (t, 0, x, z; q), for all y ∈ R. By using the definition of UIP, we obtain that e −γ(y−v) V (t, 0, x, z; q) = V (t, y − v, x, z; q) = V (t, y, x, z; 0) = e −γy V (t, 0, x, z; 0) so that the UIP v is given by Let us define the log-value function J as Notice that in the exponential utility case V < 0. Then we have that the UIP v, that is, indeed, a function of t, x, z and q, can be represented as v = v(t, x, z; q) = J(t, x, z; q) − J(t, x, z; 0). (3.4) This representation allows us to formally derive a PDE for the UIP.
Recalling that V (t, y, x, z; q) = −e −γy−γJ(t,x,z;q) , we compute all the partial derivatives necessary to characterize the HJB equation for J (for simplicity, from now on we skip all the arguments of the functions V and J): where we recall that ⊗ denotes the Kronecker product.
Substituting the above partial derivatives into the HJB Equation (3.2), after the simplification for −γV , leads to with the terminal condition J(T, x, z; q) := q Φ(p(T, x), z). The candidate optimal investment strategyπ is given byπ Substitutingπ into the HJB Equation (3.5) leads to whereb The terminal condition G for V translates into the terminal condition for J as J(T, x, z; q) = log γ γ + qΦ(p(T, x), z), (x, z) ∈ R m × [0,ūT ]. (3.9) In order to compute the UIP as in Equation (2.9), we first calculate J(t, x, z; 0), which satisfies Equation (3.7) with the terminal condition J(T, x, z; 0) = log γ γ . It is a classical and intuitive result that, in this situation, J(t, x, z; 0) does not depend on z. Denoting J(t, x, z; 0) by J 0 for simplicity, we have that J 0 fulfills Thus, subtracting Equation (3.10) to Equation (3.7) and using the fact that we obtain the following PDE for the UIP v: Notice that solving the HJB equation for the UIP v(t, x, z; q) above requires the knowledge of J 0 , which is the log-value function of the optimal investment problem with no claim. This phenomenon is due to the presence of the non-tradable factors X in the dynamics of the forward contracts F and it has been observed in a somewhat different model in [6], where the non-tradable factors follow a pure jump dynamics. We show in Section 5 that, in some relevant examples, the PDE for the log-value function J 0 can be considerably simplified.

Existence and uniqueness results
In this section we concentrate on Equation (3.7), together with the terminal condition in Equation (3.9), and we show that the log-value function J is its unique continuous viscosity solution with quadratic growth. From there, the UIP v is easily found via the following equality v(t, x, z; q) = − 1 γ log V (t, 0, x, z; q) V (t, 0, x, z; 0) = J(t, x, z; q) − J(t, x, z; 0).
For this purpose, we need to make several assumptions on the coefficients of our PDE as well as on the functions appearing in the terminal condition. We recall for reader's convenience that the matrix B = B(t, x) has been defined in (3.8) as (iii) The matrix B is positive semidefinite and such that there exists a constant δ > 0 (uniform in t, x) such that for all vectors ξ ∈ Im(B), the image of B.
Some comments on the hypotheses above are in order. The continuity property of p will be used to prove that the value function V satisfies the good terminal condition. Condition (iii) on B is related to the coercivity hypothesis in Assumption A1 in [16], which has a crucial role in the proof of their comparison theorem. Conditions (iv) and (v) will allow us to use results from [30] to get the smoothness and the quadratic growth condition of the log-value function J 0 of the investment problem with no claim, which thanks to condition (i) are inherited by the log-value function with the claim, J. More details on how these assumptions come into play are given in the proof below. They will also be discussed on few examples in Section 5. so that |L(p, z, u)| ≤ for all (p, z, u), for a suitably chosen and large enough threshold > 0 such that the instantaneous profit should not be reasonably above in absolute value. The same truncation argument can be applied to the penalty function Φ(p, z). Now we are ready to state the main result of this section. Proof. We consider the existence first. This is an easy consequence of Proposition 3.1, which gives the result that the value function V is a viscosity solution of Equation (3.2). It then suffices to use the definition of viscosity solution to check that the log-value function J given by Equation (3.3) is a (possibly discontinuous) viscosity solution of the PDE (3.7) above.
To complete the proof, it remains to show that J is unique in the class of all continuous viscosity solutions with quadratic growth to the Cauchy problem given by (3.7) and (3.9).
The main idea for uniqueness is to use the comparison theorem in [16,Th. 2.1]. For the reader's convenience, we split the rest of the proof into two steps.
(i) Reduction to Da Lio and Ley [16] setting. First, we use a Fenchel-Legendre transform to express the quadratic term in our pricing PDE into an infimum over the image of B of a suitable function. More precisely, we apply a classical result in convex analysis (e.g. [34, Ch.III, Sect. 12]) to get for all vectors w ∈ R m , where L is the conjugate of F and it is also given by L(α) = − 1 2 α, B −1 α when α ∈ Im(B) and −∞ otherwise. Notice that the first infimum is computed over the image of B since the matrix B is not necessarily invertible in our framework. Using (3.16), we can rewrite Equation (3.7) as with terminal condition J(T, x, z; q) = log γ γ + qΦ(p(T, x), z). In order to reduce our PDE to the one in [16, Eq. (1.1)], we need to perform the time reversal transformation J(t, x, z; q) := J(T − t, x, z; q), which turns the PDE above into the following Notice that this Cauchy problem is a particular case of the one studied in [16]. Indeed, our Assumption 3.3 implies assumptions (A1), (A2), (A3) in [16]. 1 (ii) Uniqueness. In order to prove that the log-value function J is the unique continuous viscosity solution satisfying the terminal condition, we argue by contradiction. Assume that there exists another continuous viscosity solutionJ of Equation (3.18) satisfying the terminal condition (3.19) and with quadratic growth. Then, by calling J * andJ * their u.s.c. envelopes and J * andJ * their l.s.c. envelopes, we have, by definition of viscosity solution, that J * ,J * are u.s.c. viscosity subsolutions and J * ,J * are l.s.c. viscosity supersolutions of Equation (3.18), obviously withJ * =J * =J. We also have J * (T, x, z; q) ≤ log γ γ + qΦ(p(T, x), z) ≤ J * (T, x, z; q), by definition of upper and lower envelopes. We now want to prove that J * (T, x, z; q) ≥ log γ γ + qΦ(p(T, x), z) and J * (T, x, z; q) ≤ log γ γ + qΦ(p(T, x), z) for all q ≥ 0, x, z. We only show the latter, as the former can be proved similarly. First notice that we have lim t→T J(t, x, z; q) = log γ γ + qΦ(p(T, x), z).
This implies that J * = J * = J =J, and that J is continuous and the proof is complete.
Notice that we worked on the log-value function's PDE (3.7) instead of on the PDE for the price v (cf. Equation (3.11)), because the latter is more delicate to handle due to the fact that it contains the first derivative J 0 x of the log-value function with no claim. Applying Da Lio and Ley results directly to Equation (3.11) would require a Lipschitz continuity for J 0 x uniform in t, which is difficult to have in general. Nonetheless, when this condition is satisfied as in Cartea-Villaplana and in the linear dynamics model (see Section 5), the same arguments go through and one can prove that v is the unique continuous viscosity solution with quadratic growth to Equation (3.11) with terminal condition (3.12), as the following corollary explicitly states. Its proof is analogous to that of Theorem 3.5, it is therefore omitted. In the complete market case, one can show that the UIP v is the unique viscosity solution of the HJB equation for the control problem in Equation (2.13). This result generalizes previous ones in [4,10,15,19,36], which were obtained for particular types of structured contracts, e.g., swings and virtual storages.
with terminal condition v(T, x, z; q) = qΦ(p(T, x), z). As a consequence of the result in Theorem 3.5, we have a good candidate for the optimal hedging strategy, which is given bŷ

22)
where v x is the gradient with respect to the factor variables, when it exists, of the UIP. Indeed, the candidate optimal strategy with or without the structured product in the portfolio is given by Equation (3.22), where J = J(t, x, z; q) with q > 0 or q = 0 in the two cases, respectively. Thus it is given by the difference of the two optimal portfolios, i.e., in analogy with [5,6].

A model with two assets and constant correlation
In this section we focus on the following incomplete market model which is a particular case of our general setting, where W 1 and W 2 are two correlated one-dimensional standard Brownian motions with constant correlation ρ ∈ (−1, 1), i.e., d W 1 , W 2 t = ρdt for all t ∈ [0, T ]. We will often use the decomposition W 2 = ρW 1 + 1 − ρ 2 W ⊥ , where W ⊥ is another standard Brownian motion, orthogonal to W 1 . The obtained process W = (W 1 , W ⊥ ) is a bi-dimensional Brownian motion with independent components. Notice that here P t is the only state variable. Hence in this section, with an abuse of notation, v(t, p, z; q) will replace v(t, x, z; q) and all its partial derivatives will have subscript p instead of x.
The coefficients µ F , µ P , σ F , σ P are real valued functions defined on [0, T ] × R. We assume that µ F (t, p) and σ F (t, p) are continuous in (t, p), while µ P (t, p) and σ P (t, p) are Lipschitz continuous in p (uniformly in t). Notice that this class of models includes the linear dynamics model in Example 2.5. We suppose that all the assumptions of the previous section are in force, so that we will able to use the general results in Theorem 3.5.
Inspired by the results in Oberman and Zariphopoulou [33], which in turn extend El Karoui and Rouge [17] to American options, we obtain a representation of the UIP of our structured product C T as the value function of an auxiliary optimization problem with respect to the control u only, under a suitable equivalent martingale measure involving the derivative J 0 p of the log-value function of the problem with no claim, and where γ is replaced by a modified risk aversionγ = γ(1 − ρ 2 ).
Let us consider the measure Q 0 defined as where W = (W 1 , W ⊥ ) * and θ is given by Notice that the stochastic exponential is well defined, since P t has continuous paths and µ F and σ F are continuous, so that the stochastic integral t 0 θ 1 u dW 1 u is well-defined for every t. Moreover, the second integral t 0 θ ⊥ u dW ⊥ u is also well-defined thanks to the continuity of σ P (t, P t ) and the linear growth of J 0 p (cf. proof of Lemma A.1). Finally, in order for the equation (4.2) to define a probability measure, we need to impose that E[D 0 T ] = 1. Remark 4.1. In the case when the coefficients of F do not depend on the state variable P , as in the standard Black-Scholes model with constant correlation, we have that J 0 p ≡ 0, and Q 0 coincides with the minimal entropy martingale measure. Therefore the measure Q 0 can be viewed as a perturbation of the minimal entropy martingale measure where the correction involves the log-value function J 0 of the optimal pure investment problem.
In what follows we will need the following lemma, stating the dynamics of the spot price under the martingale measure Q 0 . Its proof is based on a standard application of Girsanov's theorem, and is therefore omitted.
T ] = 1. Then, the dynamics of the spot price P under Q 0 is given by where The following proposition extends to our setting the characterisation in Oberman and Zariphopoulou [33,Prop. 10]. Recall that when u ∈ U t the (controlled) payoff C u t,T also starts from time t. with w(t, p, z; q) := sup u∈Ut E 0 t,p,z −e −γqC u t,T .
The value function w above solves the following Cauchy problem in a viscosity sense w t (t, p, z; q) + sup [L u w(t, p, z; q) −γqL(p, z, u)w(t, p, z; q)] = 0 w(T, p, z; q) = − exp(−γqΦ(p, z)) The corresponding Cauchy problem forṽ is immediately obtained: L uṽ (t, p, z; q) + qL(p, z, u) = 0 v(T, p, z; q) = qΦ(p, z), which is a particular case of Equation (3.11) in this case. To identifyṽ with the UIP v, we need a uniqueness result for the PDE above.
Since J 0 p is assumed to be uniformly Lipschitz, we can apply verbatim the same arguments as in the uniqueness step of the proof of our Theorem 3.5 applied to the PDE for v to get the existence of a unique continuous viscosity solution with quadratic growth to the Cauchy problem (4.8). Finally, the boundedness of the payoff C u t,T clearly implies that the value functionṽ(t, p, z) has quadratic growth. Thus the proof is complete.
The previous proposition suggests the following approach to compute the UIP and the corresponding (partial) hedging strategy of a given structured product: • solve the pure optimal investment problem V (t, y, x; 0) with no claim; • compute the x-derivative of the log-value function J 0 giving the new probability measure Q 0 as well as the corresponding dynamics of P ; • solve the maximisation problem in (4.6), which is now computed with respect to the control u only; its value function gives the UIP while its derivative with respect to x gives the hedging strategy via (3.22).

Examples
In this section we derive the PDEs for the log-value function J and for v in Examples 2.5 and 2.6.

The linear dynamics model
We focus here on Example 2.5. As already pointed out, this model is a slight generalization of Carmona-Ludkovski model [11]. In this setting we have m = n = 1, d = 2 and the dynamics of the state variable X is characterized by b(t, x) = δ(θ − x) and Σ * (t, x) = ρσ P 1 − ρ 2 σ P . Furthermore, the coefficients in the evolution of F are: µ F (t, x) = (a − kx) and σ * F (t, x) = (σ 0). Here Equation (3.10) becomes: Then, in analogy with [9], one guesses that the solution J 0 has the general form such that J 0 (T, x) ≡ log γ γ . This ansatz, by collecting terms in x and x 2 , produces the system of ODEs (apexes denoting the derivative in t) with final condition α(T ) = log γ γ , β(T ) = 0, Γ(T ) = 0.
The above system is solvable in closed-form, as the third equation is a Riccati equation in Γ, the second one is a linear equation in β, which can be solved once that Γ is known, and, finally, the first one can be solved in α just by integration. Notice that, if the parameter k in µ F is equal to zero (as in [10]), then the dynamics of the forward contract does not depend on X, so that J 0 does not depend on x, thus leading to β ≡ Γ ≡ 0 on [t, T ]. Finally, Equation (3.11) is given in this case by with terminal condition v(T, x, z; q) = q Φ(e x , z).

The Cartea-Villaplana model
In the remaining part of this section we will focus on Example 2.6. We will deal separately with two different cases (recall that here d = 2): the incomplete market setting, in which only one forward contract is traded and the complete one, characterized by the presence of two forward contracts.

The case of one forward contract
The Cartea-Villaplana model reduces to our setting taking m = 2, i.e., X = (X C , X D ) * and d = 2 and setting: so that we can keep our convention that the bi-dimensional Brownian motion W has independent components. Also, notice that Σ has full rank unless ρ = ±1, as also Moreover, in the case n = 1, let us consider a generic forward contract F with maturity T .
Here σ F (t, X t ) only depends on t, so that, with an abuse of notation, we will use σ F (t): First of all we notice that the correlation between the (logarithms of) spot and forward prices is not constant, thus the results of Section 4 cannot be directly applied here. Indeed, we have where the instantaneous (log-) covariance and variances are given by Notice that, as expected, when T → t the correlation tends to 1, while when T → +∞ the correlation goes to We can see, then, that the 2 × 2 matrix B, apart from its analytic form, has rank equal to one in the case when one uses only one forward contract for hedging. In fact, first of all in this case one has (recall Equation (3.8)) Define now x = Σ −1 σ F . Then x = 0 but we have For this reason, working on the image of B in Equation (3.16) is fully justified here, as rank B = 1.
We now come to the PDE satisfied by the log-value functions J 0 . Due to the fact that the coefficients µ F and σ F do not depend on X, as already pointed out in Remark 3.2, here J 0 satisfies the simplified Equation (3.13), which here becomes Of course here J 0 x ≡ 0, and Equation (3.11) for the utility indifference price becomes exactly the same as in Equation (3.14): Finally, once we have computed the UIP v, in order to obtain the candidate optimal hedging strategyπ in Equation (3.22), one has to compute which is the vector multiplier for the gradient v x .

The case of two forward contracts
Assume now that we can hedge our structured product with two forward contracts F 1 and F 2 having, respectively, maturity T 1 and T 2 , with T ≤ T 1 < T 2 . Then, we have (notice that here we do not insert T 1 and T 2 in the independent variables' set) Of course, in this situation the matrix B = 0, since σ F is invertible. As before in subsection 5.2.1, we now explicitly find J 0 , given that it satisfies the simplified Equation (3.13). This leads to Here again J 0 x ≡ 0 and Equation (3.11) for the utility indifference price becomes Finally, given the UIP v, the candidate optimal hedging strategyπ is obtained as in Equation (3.22)

Numerical results
We now show a numerical implementation of the pricing of a structured contract. 2 More precisely, we compare our approach, giving the UIP through a PDE with a quadratic term (the template being Equation (3.11)), with the standard approach in the literature (e.g. [4,10,15,19,36]), which gives the price in terms of a PDE which is essentially linear apart from the first derivative in z, which is the only one appearing in a nonlinear way, and has the same form as Equation (3.20).
For the numerical implementation, we choose to price a swing contract for two reasons: it is rather straightforward to implement, since, e.g., a virtual storage would have required a reparameterization as in Remark 2.10; secondly, its numerical solution has already been studied in [10], so that we have a benchmark to compare with. In order to make the comparison meaningful, we choose a special case of the linear dynamics model of Example 2.5 with k = 0. We recall that in this case, the relevant dynamics for pricing purposes is the one under the minimal entropy martingale measure Q 0 and it is given by which follows from Equation Here the first three coefficients are chosen equal to those in [10] for the spot price P for consistency reason. The last three coefficients have realistic values and are relative to the dynamics of the forward contract F , which does not appear in [10], and to the correlation between (the logarithms of) P and F . Regarding the swing contract, we choose as in [10] an intermediate payoff L(p, z, u) = u(p − K), with K = 0 and u ∈ [0, 1], i.e. we chooseū = 1, a maturity of T = 1 and risk-free interest rate r = 0. Moreover, in order to approximate the fact that Benth et al. [10] have a strict constraint on Z u , namely Z u T ≤ M = 0.5, here we use the terminal condition Φ(p, z) = min(0, −C(z − 0.5)).
Indeed, in [4] is proved that, when C → ∞, the price of a contract with penalty Φ converges to the price of a contract with strict constraints, which is the kind that was priced in [10]. For this numerical experiment, we set C = 100. Finally, as risk-aversion parameter we take γ = 1.
In Figure 1 we plot the prices of the swing contract with two different methodologies. In more detail, in Figure 1(a), we compute the swing price with the classical approach in the literature, as in, e.g., [10]. On the other hand, in Figure 1(b), we compute the swing UIP by solving Equation (3.11). As we can see, the two price surfaces have similar shapes, which shows that the approach in the literature is quite robust on the pricing side.
In order to show the difference between the two prices, in Figure 2 we plot the two price surfaces, where the surface above is the "classical" price and the one below is ours.
We can thus see that the "classical" procedure slightly overprices contracts, in comparison to the utility indifference pricing approach presented here. In more detail, the point  Figure 2: Difference between the "classical" price (above) and the UIP (below): the two price surfaces are the same as in Figure 1, with an axis rotation to highlight the prices' difference.
where the difference between the prices is maximum is (log p, z) = (4.5, 0), where the linear price ("classical" approach) is 42.175 while the UIP is 29.499. Of course, this difference is basically due to our choice of risk aversion parameter γ. A dependence of the UIP on γ can be seen in Table 1.  Table 1: Dependence of the price on γ It can be clearly seen that, as γ → 0, the UIP converges to the "classical" price. This is not a surprise, as for γ = 0 Equation (3.11), which gives the UIP, simplifies to Equation (3.20), which gives the linear price. The convergence of the solutions here is implied by robustness properties of viscosity solutions. A rigorous analysis of this convergence is beyond the scope of this paper.

Conclusions
In this paper, we studied the price of structured products in energy markets from a buyer's perspective using the utility indifference pricing approach. In our setting the agent has the possibility to invest in the forward market and his utility function is of exponential form. We showed that the price is characterized in terms of continuous viscosity solutions of suitable non-linear PDEs. As a consequence, this gave us both an optimal exercise strategy for the structured product as well as a portfolio strategy to partially hedge the financial position.
Moreover, in a setting with two assets and constant correlation, the UIP was found to be the value function of an auxiliary simpler optimization problem under a risk neutral probability, that can be interestingly interpreted as a perturbation of the minimal entropy martingale measure. To our knowledge, this particular change of measure has never been used before in the literature. We also checked in the numerical experiments that, in the case of swing options, utility indifference prices are lower than the ones currently present in the literature, as expected.
We intend to develop this work in several directions in the future: compute asymptotic expansions for the UIP for small risk aversion; extend our numerical results, by including the analysis of the optimal exercise curves and the candidate optimal hedging strategies; enlarge our class of models to include jumps that would generate spikes in prices. This latter feature would be particularly relevant in electricity markets.
A Regularity properties of the log-value function Lemma A.1. Let q ≥ 0. Under Assumptions 2.3 and 3.3, the log-value function J(t, x, z; q) defined as in (3.3) has quadratic growth in (x, z) uniformly in t.
Proof. Since the claim C u t,T is bounded in (x, z) uniformly in the controls u, it suffices to prove that J 0 (t, x), the log-value function of the pure investment problem, has quadratic growth in x uniformly in t. To do so, we follow closely the approach in Pham [30]. We will only sketch the proof, pointing out the main differences.
First of all, repeating exactly the same arguments as in the proof of Theorem 3.1 in [30], we get that if the PDE (3.10) with terminal condition J 0 (T, x) = log γ γ admits a unique solution belonging to C 1,2 ([0, T ) × R m ) ∩ C 0 ([0, T ] × R m ), whose x-derivative has linear growth, then such a solution coincides with J 0 (t, x).
To conclude the proof, we need to show that the PDE (3.10) has a unique smooth solution as above, whose x-derivative has linear growth. We will adapt to our setting the arguments in the proof of [30,Th. 4.1] under his Assumptions (H3a), which corresponds to our Assumptions (3.3)(iv) and (v).
First, consider the PDE (3.17) in the case q = 0, with F (w) replaced by with terminal condition J 0,k (T, x) = log γ γ . Notice that the function L appearing in the definition of F k (w) in Equation (A.1) can take the value −∞, which is not a problem here since this value does not contribute to the infimum over α.
The next step consists, as in [30], in using a stochastic control representation of the solution J 0,k to derive a uniform bound on the derivative, independently of the approximation. Indeed, from standard verification arguments we get that where B k is the set of R m -valued adapted processes α bounded by k, and the controlled dynamics of X under Q is given by where W Q is a d-dimensional Brownian motion under Q. Notice that, sinceL takes the value −∞ outside the image of B, then the optimal Markov control evaluated along the optimal pathα(s,X s ) will lie on Im B a.s. for every s ∈ [t, T ]. We can use Lemma 11.4 in [22] and the same estimates as in [30,Lemma 4.1] to obtain for some positive constant C, which does not depend on k. Now we argue as in the proof of [30,Th. 4.1], Case (H3a), to deduce that |α k (t, x)| ≤ C for all t ∈ [0, T ] and |x| ≤ M for some positive constant C (independent of k) and an arbitrarily large M > 0. Therefore, we get that, for k ≤ C, F k (J 0,k x ) = F (J 0,k x ) for all (t, x) ∈ [0, T ] × B M . Letting M tend to +∞, we finally get that J 0,k is a smooth solution with linear growth on derivative to the PDE 3.17 (with q = 0). To conclude, we have that J 0 = J 0,k for k sufficiently large, giving, in particular, that J 0 has quadratic growth in x uniformly in t. Therefore the proof is complete.