Energy Portfolio (Robust)

Stochastic / Robust QP

Contract Mix · Spot Exposure · Price-Risk Hedging

An electricity retailer, large industrial consumer, or vertically integrated utility faces a continuous choice: lock in price through long-term contracts, or ride the spot market? Contracts are cheaper per MWh on average but lock in price; spot purchases exploit low-price periods but leave the buyer fully exposed to volatility. The robust energy portfolio problem builds a mix of Power Purchase Agreements (PPAs), futures contracts, storage, and spot exposure that minimizes expected cost while bounding the worst-case outcome at an acceptable level. Two-stage stochastic and budget-robust formulations are the standard OR tools.

The problem

Contract mix, spot exposure, and storage under price uncertainty

Electricity prices are the most volatile of any major commodity: day-to-day spot prices can swing by a factor of 5–10, and during scarcity events (Texas freeze, European 2022 energy crisis) by a factor of 50+. A retailer serving a fixed 100-MW load who fails to hedge properly can see a single week's spot prices wipe out an entire year's retail margin. Conversely, over-hedging (buying more forward than needed) locks in price above expected spot and sacrifices the upside of low-price hours.

The core OR problem: given an expected load profile, a menu of contract products (block forwards at different strike prices, peak/off-peak PPAs, baseload PPAs), storage capacity, and a spot market, decide how much of each to procure. Constraints: coverage of expected demand, bounds on maximum spot exposure, optional renewable-portfolio standard. Objective: minimize expected cost with a risk penalty (standard deviation, CVaR, or budget-robust worst case).

Historical note
Markowitz (1952) is the original mean-variance portfolio paper — still the foundation. Application to electricity retailing dates to the post-1990 deregulation era. Conejo, Carrión & Morales (2010) Decision Making Under Uncertainty in Electricity Markets is the canonical textbook: two-stage stochastic programming, robust optimization, CVaR applied to electricity portfolio problems. Pozo, Contreras & Sauma (2014) extended to storage-integrated portfolios. Kettunen, Salo & Bunn (2010) applied real-options theory to electricity contracts. Industrial practice has caught up: Octopus Energy, Ørsted, RWE, and dozens of traders run optimization systems descended from this literature daily.

Modern variants integrate storage as a flexibility asset: a battery hedges price volatility by charging during low-spot hours and substituting for high-spot hours. Storage-integrated portfolios solve jointly for contract mix and storage schedule, adding complexity but typically 20–40% additional value over contract-only hedging. Distributionally robust variants relax Gaussian assumptions on price distributions, replacing them with Wasserstein or moment ambiguity sets.

Mathematical formulation

Two-stage stochastic + budget-robust variant

Notation

SymbolMeaningUnits
$\mathcal{K}$Contract products (forwards, PPAs)
$\mathcal{T}$Delivery periods
$\mathcal{S}$Spot-price scenarios
$\pi_s$Probability of scenario $s$pu
$P_k$Strike price of contract $k$$/MWh
$V_k^{\max}$Max volume of contract $k$MW
$D_t$Expected demand in period $t$MW
$\tilde{\pi}_{t,s}$Spot price in period $t$, scenario $s$$/MWh
$x_k$Contract volume (1st stage)MW
$y_{t,s}$Spot purchase (2nd stage)MW
$\beta, \lambda$Risk-aversion parameters

Two-stage stochastic portfolioConejo-Carrion-Morales (2010)

First-stage: choose contract volumes $x_k$ before price uncertainty resolves. Second-stage: buy any residual on the spot market in each scenario.

$$\min \; \sum_{k} P_k \, x_k + \sum_{s \in \mathcal{S}} \pi_s \sum_{t} \tilde{\pi}_{t,s} \, y_{t,s} + \lambda \cdot \mathrm{Risk} \qquad \text{(1)}$$

where $\mathrm{Risk}$ is typically Variance, CVaR, or a robust worst-case term.

Constraints

Coverage of demand in every scenario:

$$\sum_{k: t \in \mathcal{T}_k} x_k + y_{t,s} \ge D_t \qquad \forall t, s \qquad \text{(2)}$$

Contract volume limits:

$$0 \le x_k \le V_k^{\max} \qquad \forall k \qquad \text{(3)}$$

Maximum spot exposure (risk limit):

$$y_{t,s} \le \alpha \cdot D_t \qquad \forall t, s \qquad \text{(4)}$$

where $\alpha$ is the max allowed fraction from spot. Renewable portfolio standard:

$$\sum_{k \in \mathcal{K}^{\mathrm{RE}}} x_k \ge \gamma \sum_t D_t \qquad \text{(5)}$$

CVaR as risk measureRockafellar & Uryasev (2002)

Conditional Value-at-Risk at level $\beta$ is the expected cost conditional on exceeding the $\beta$-quantile. For portfolio problems:

$$\mathrm{CVaR}_\beta(\mathrm{cost}) = \eta + \frac{1}{1-\beta} \mathbb{E}[(\mathrm{cost} - \eta)^+] $$

Rockafellar-Uryasev's linearization makes this a linear objective: introduce $\eta$ and $z_s = \max(0, \mathrm{cost}_s - \eta)$, minimize $\eta + \frac{1}{(1-\beta)|S|} \sum_s z_s$. CVaR has become the industry-standard risk measure for electricity portfolios.

Budget-robust variantBertsimas & Sim (2004)

Instead of scenarios, constrain prices to a polyhedral uncertainty set:

$$|\tilde{\pi}_t - \bar{\pi}_t| \le \Gamma \cdot \hat{\pi}_t, \quad \sum_t \mathbb{I}(|\tilde{\pi}_t - \bar{\pi}_t| > 0) \le \Gamma^{\mathrm{budget}} $$

Budget-robust optimization minimizes the worst-case cost inside this set. LP duality makes the problem tractable; the robustness parameter $\Gamma$ controls conservatism. Less sensitive to scenario-probability assumptions.

Complexity

Pure stochastic portfolio (no binaries) is a quadratic program with CVaR, or a large LP with linear CVaR. Scenario-based: size scales with $|\mathcal{S}|$; 1000 scenarios = 10s to minutes in Gurobi. Budget-robust is a compact LP once dualized. Storage-integrated adds SOC variables but stays convex.

Real-world data

EPEX Spot & Nord Pool historical prices

EPEX Spot (Continental Europe) and Nord Pool (Scandinavia, Baltics, UK) publish historical hourly day-ahead prices. Standard input for European portfolio optimization research.

CME Electricity Futures

CME Electricity Futures lists PJM, NYISO, and ERCOT electricity futures and options. Real contract strike prices for US-hub portfolio optimization.

Illustrative portfolio (this page)

The interactive solver handles 4 contract products (baseload PPA, peak PPA, wind PPA, solar PPA) plus spot exposure and optional battery over 24 hours with 30 price scenarios. Visualizes the efficient frontier (expected cost vs CVaR) and optimal portfolio composition.

Interactive solver

CVaR-constrained energy portfolio with scenario prices

Portfolio parameters

150
1.0
0.7
30%
Adjust parameters and press Optimize.

Efficient frontier & composition

Efficient frontier: expected cost vs CVaR. Each point is a different risk-aversion setting. Current point highlighted in gold.
Optimal contract portfolio by product (MW per contract + residual spot exposure)

Solution interpretation

The efficient frontier is the core object. X-axis: expected cost; y-axis: CVaR (worst-case cost in the top-5% scenarios). Each point is the optimal portfolio for a different risk-aversion $\lambda$. The leftmost point (lowest expected cost) is the risk-neutral solution — all spot exposure, minimal contracting. The rightmost (lowest CVaR) is maximally hedged — all contracts, no spot. Real portfolios sit somewhere in between; the trader's job is to pick the point matching shareholder risk tolerance.

Portfolio composition shifts predictably with risk aversion. Risk-neutral ($\lambda = 0$): minimal contracts, maximum spot exposure, lowest expected cost but fattest right tail. Risk-averse ($\lambda$ high): large baseload PPA lock-in, minimal spot, moderate cost and tight distribution. RE contracts (wind/solar PPAs) play a special role: they're cheaper per MWh than thermal baseload PPAs but have quantity uncertainty (wind doesn't blow, sun doesn't shine). The solver balances this.

Battery co-optimization — if enabled — adds a third lever: the battery charges during low-spot hours and substitutes for high-spot purchases, effectively flattening the net spot exposure. This typically reduces CVaR by 20–40% at similar expected cost, making storage a first-class hedging instrument alongside contracts.

The RE portfolio standard constraint shifts the entire frontier upward when the binding: even the risk-neutral point is forced to carry expensive renewable contracts. The cost of the constraint is the vertical distance between the unconstrained and constrained frontiers. Policymakers care about this number.

Extensions & variants

Storage-coupled portfolio

Co-optimize contract mix with battery storage schedule. Storage absorbs residual spot exposure, flattening the net-position distribution. 20–40% CVaR reduction at similar expected cost.

Refs: Pozo, Contreras & Sauma (2014); Singh & Khaparde (2020).

Distributionally robust portfolio

Worst-case over an ambiguity set (Wasserstein distance or moment conditions) rather than a fixed scenario distribution. Robust to misspecification of the price distribution. Active research frontier.

Refs: Esfahani & Kuhn (2018); Zhao & Guan (2018).

Real-options in contract choice

Contracts with optionality (cap/floor strike, swing contracts) priced as real options. Lattice methods or LSM regression for dynamic exercise; portfolio optimization over option mix.

Refs: Kettunen, Salo & Bunn (2010); Hull textbook on derivatives.

Multi-period stochastic SP

Three-stage or N-stage formulations where contract purchases can be revised as prices evolve. Nested Benders / SDDP methods. Used by large European utilities for quarterly re-hedging.

Refs: Morales et al. (2014); Wallace & Fleten (2003).

Producer-side portfolio

Mirror problem: generator decides how much of output to sell forward vs spot. Bi-level formulations include anticipated price impact of the producer's own offers. Strategic bidding extension.

Refs: Conejo, Nogales & Arroyo (2002); Kazempour & Conejo (2012).

Retail pricing under DR

Retailer chooses portfolio and retail tariff (ToU, CPP, RTP) to maximize margin net of demand response. Bi-level: portfolio at upper level, customer response at lower level. Fuses with DR optimization.

Refs: Zugno et al. (2013); Celebi & Fuller (2012).

Key references

[1]
Conejo, A. J., Carrión, M., & Morales, J. M. (2010).
Decision Making Under Uncertainty in Electricity Markets.
Springer, International Series in Operations Research & Management Science, 153. doi:10.1007/978-1-4419-7421-1
[2]
Markowitz, H. (1952).
“Portfolio selection.”
Journal of Finance, 7(1), 77–91. doi:10.2307/2975974
[3]
Rockafellar, R. T., & Uryasev, S. (2002).
“Conditional value-at-risk for general loss distributions.”
Journal of Banking & Finance, 26(7), 1443–1471. doi:10.1016/S0378-4266(02)00271-6
[4]
Bertsimas, D., & Sim, M. (2004).
“The price of robustness.”
Operations Research, 52(1), 35–53. doi:10.1287/opre.1030.0065
[5]
Pozo, D., Contreras, J., & Sauma, E. E. (2014).
“Unit commitment with ideal and generic energy storage units.”
IEEE Transactions on Power Systems, 29(6), 2974–2984. doi:10.1109/TPWRS.2014.2313513
[6]
Kettunen, J., Salo, A., & Bunn, D. W. (2010).
“Optimization of electricity retailer's contract portfolio subject to risk preferences.”
IEEE Transactions on Power Systems, 25(1), 117–128. doi:10.1109/TPWRS.2009.2032233
[7]
Esfahani, P. M., & Kuhn, D. (2018).
“Data-driven distributionally robust optimization using the Wasserstein metric.”
Mathematical Programming, 171(1–2), 115–166. doi:10.1007/s10107-017-1172-1
[8]
Wallace, S. W., & Fleten, S.-E. (2003).
“Stochastic programming models in energy.”
In Handbooks in Operations Research and Management Science, Vol. 10. Elsevier. doi:10.1016/S0927-0507(03)10010-2
[9]
Morales, J. M., Conejo, A. J., Madsen, H., Pinson, P., & Zugno, M. (2014).
Integrating Renewables in Electricity Markets: Operational Problems.
[10]
Celebi, E., & Fuller, J. D. (2012).
“Time-of-use pricing in electricity markets under different market structures.”
IEEE Transactions on Power Systems, 27(3), 1170–1181. doi:10.1109/TPWRS.2011.2180935
In-browser solver samples 30 price scenarios and enumerates points on the efficient frontier via risk-aversion sweep. Production systems use commercial QP/LP solvers on thousands of scenarios.