EN only for now; Chinese versions pending. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
105 lines
20 KiB
Markdown
105 lines
20 KiB
Markdown
# A Primer on Stochastic Optimization in Electricity Markets
|
||
|
||
## 1. Why Uncertainty Is the Central Problem in Power Systems
|
||
|
||
Electricity is unusual among commodities: it must be produced at nearly the same instant it is consumed, storage remains expensive relative to demand, and the physics of the network constrain how power flows. Market operators must therefore commit resources — deciding which power plants to turn on, how much reserve to hold, how to schedule hydro reservoirs — *before* they know exactly what conditions will materialize. The gap between when decisions are made and when uncertainty resolves is what makes electricity markets a natural home for stochastic optimization.
|
||
|
||
The principal sources of uncertainty are load (demand fluctuates with weather, behavior, and increasingly with distributed resources behind the meter), renewable generation (wind and solar output can swing by large fractions of installed capacity within hours), equipment availability (generators and transmission lines fail unexpectedly), fuel and electricity prices (relevant for market participants making offering and hedging decisions), and inflows (for hydro-dominated systems, reservoir inflows over weeks to years). Historically, load uncertainty was modest and manageable with deterministic forecasts plus reserve margins. The rapid growth of wind and solar changed that calculus: net load (demand minus renewable output) is far more volatile and harder to forecast, which has pushed both system operators and market participants toward decision-making frameworks that represent uncertainty explicitly rather than papering over it with heuristic margins.
|
||
|
||
## 2. From Deterministic to Stochastic Formulations
|
||
|
||
The workhorse problems of electricity markets — economic dispatch, unit commitment, market clearing — are traditionally posed as deterministic optimization problems. Economic dispatch minimizes generation cost subject to a power balance constraint and generator limits, typically as a linear or quadratic program. Unit commitment adds binary on/off decisions, minimum up/down times, startup costs, and ramping limits, making it a mixed-integer program (MIP). Both take a single forecast of demand and renewable output as given.
|
||
|
||
A stochastic formulation replaces the single forecast with a probability distribution, usually approximated by a finite set of scenarios, and restructures the problem around the timing of decisions relative to the resolution of uncertainty. The key conceptual device is the distinction between *here-and-now* decisions, which must be made before uncertainty resolves and are therefore identical across all scenarios, and *wait-and-see* (recourse) decisions, which can adapt once the outcome is observed. In unit commitment, the commitment of slow-start thermal units is here-and-now: a coal or combined-cycle plant needing several hours to start must be committed the day before. Dispatch levels, fast-start unit commitments, and reserve deployment are recourse: they adjust in real time to the realized net load.
|
||
|
||
## 3. Two-Stage Stochastic Programming and Stochastic Unit Commitment
|
||
|
||
The canonical model is the two-stage stochastic program with recourse:
|
||
|
||
```
|
||
minimize c'x + E_ω[ Q(x, ω) ]
|
||
subject to x ∈ X
|
||
|
||
where Q(x, ω) = min { q(ω)'y : W y = h(ω) − T(ω) x, y ≥ 0 }
|
||
```
|
||
|
||
Here `x` collects first-stage decisions (unit commitments), `Q(x, ω)` is the optimal recourse cost in scenario `ω` (the dispatch cost given the commitment), and the objective minimizes first-stage cost plus *expected* second-stage cost. With a finite scenario set {ω₁, …, ω_S} with probabilities p_s, the expectation becomes a weighted sum and the whole problem is one large "extensive form" MIP: a copy of the dispatch problem for each scenario, all coupled through the shared commitment variables and *nonanticipativity* constraints (first-stage decisions cannot depend on which scenario occurs).
|
||
|
||
**Stochastic unit commitment (SUC)** applies exactly this template. The day-ahead commitment of slow units is chosen to minimize expected total cost across scenarios of net load, where each scenario's dispatch respects transmission limits, ramping, and reserves. The value of doing this rather than committing against a point forecast is quantified by two standard metrics. The **Value of the Stochastic Solution (VSS)** compares the expected cost of the stochastic solution against the expected cost of implementing the deterministic (expected-value) solution — it measures what representing uncertainty is worth. The **Expected Value of Perfect Information (EVPI)** compares the stochastic solution against a clairvoyant who solves each scenario separately — it bounds what better forecasting could be worth. Studies on realistic systems typically find VSS on the order of a fraction of a percent to a few percent of production cost, which sounds small until multiplied by the billions of dollars flowing through a large market annually.
|
||
|
||
A closely related operational use is **reserve determination**: instead of fixing reserve requirements exogenously (e.g., "3% of load plus the largest contingency"), a stochastic model determines reserves endogenously — the model holds back exactly as much flexible capacity as the scenario set makes economical, and it holds it in the right locations relative to transmission constraints.
|
||
|
||
## 4. Multi-Stage Problems and Stochastic Dual Dynamic Programming
|
||
|
||
Many electricity problems are inherently multi-stage: uncertainty unfolds gradually and decisions interleave with observations. The paradigm example is **hydrothermal scheduling** in reservoir-dominated systems such as Brazil, Norway, Colombia, and New Zealand. Water stored today can displace expensive thermal generation later, but inflows over the coming months are uncertain. Releasing too much risks scarcity if inflows disappoint; hoarding wastes free energy through spill if inflows are strong. The problem spans months to years, with a decision each week or month after observing that period's inflow.
|
||
|
||
A scenario tree for such a problem explodes combinatorially — with even ten inflow outcomes per stage and 60 monthly stages, the tree is astronomically large. **Stochastic Dual Dynamic Programming (SDDP)**, developed by Pereira and Pinto in 1991 precisely for the Brazilian system, tames this by exploiting stage-wise independence (or Markovian structure) of the randomness. SDDP approximates the future cost function of dynamic programming — the expected cost-to-go as a function of reservoir storage — with an outer envelope of linear cuts (Benders cuts), refined iteratively through forward simulation passes and backward cut-generation passes. Because the cost-to-go function is convex in storage under linear dispatch models, the cuts converge to the true function. SDDP and its descendants are in production use for national hydro scheduling in several countries, and the marginal water values it produces feed directly into market prices in hydro systems.
|
||
|
||
## 5. Scenario Generation and Reduction
|
||
|
||
A stochastic program is only as good as its scenarios. Scenario generation is the modeling step where statistical craft matters most, and it has several requirements: scenarios must capture the marginal distributions of each uncertain quantity, the temporal autocorrelation (a windy hour tends to be followed by a windy hour), the spatial correlation across sites (weather systems are large), and the dependence between variables (cold snaps raise load and can affect both wind output and thermal plant availability).
|
||
|
||
Common approaches include time-series models (ARMA/GARCH on forecast errors), Gaussian copula methods that impose realistic dependence structure on marginal forecast distributions, sampling from ensemble numerical weather predictions (each ensemble member is a physically consistent scenario), and, increasingly, machine-learning generative models. For discrete events such as generator outages, Monte Carlo draws from Markov availability models are standard.
|
||
|
||
Because solver effort grows with the number of scenarios, practitioners generate a large scenario set and then apply **scenario reduction** — selecting a small representative subset and reweighting it to stay close (in a probability metric such as the Wasserstein distance) to the original set. The Heitsch–Römisch forward-selection and backward-reduction algorithms are the classical tools. A practical warning: aggressive reduction tends to discard exactly the extreme scenarios that drive reserve and commitment decisions, so reduction criteria are often modified to preserve tails.
|
||
|
||
## 6. Alternatives and Cousins: Robust, Chance-Constrained, and Distributionally Robust Optimization
|
||
|
||
Stochastic programming optimizes an expectation, which requires a credible probability distribution and accepts poor outcomes in bad scenarios if they are improbable. Several alternative frameworks address different attitudes toward uncertainty, and all have found electricity applications.
|
||
|
||
**Robust optimization (RO)** dispenses with probabilities entirely: uncertainty lives in a set (e.g., net load within a polyhedral band with a "budget of uncertainty" limiting how many hours can be simultaneously extreme), and the model minimizes cost under the *worst case* in that set. Two-stage adaptive robust unit commitment became prominent in the early 2010s, with ISO New England among the first system operators to study it seriously. RO's appeal is that it needs no distribution and yields strong reliability guarantees; its drawback is conservatism — the worst case may be wildly expensive to hedge. The budget parameter gives the operator a dial between economy and security.
|
||
|
||
**Chance-constrained optimization** requires constraints to hold with at least a specified probability — for example, "transmission line flows remain within limits with probability 0.99 given wind forecast errors." Under Gaussian error assumptions, many chance constraints reformulate into tractable second-order cone constraints, which made chance-constrained DC optimal power flow a popular research vehicle. It offers a transparent reliability knob but inherits sensitivity to the assumed distribution.
|
||
|
||
**Distributionally robust optimization (DRO)** hedges between the two: it optimizes against the worst distribution within an ambiguity set (distributions matching observed moments, or within a Wasserstein ball around the empirical distribution). DRO has become an active research direction for reserve procurement and OPF because it acknowledges that the distribution itself is estimated from limited data.
|
||
|
||
A rough practical taxonomy: use stochastic programming when you trust your scenarios and care about expected cost; robust optimization when failure is unacceptable and distributions are unreliable; chance constraints when reliability targets are naturally probabilistic; DRO when you have data but not enough to trust it fully.
|
||
|
||
## 7. Stochastic Market Clearing and the Pricing Problem
|
||
|
||
Using stochastic optimization inside the *market clearing* itself — not merely as an operator's advisory tool — raises deep economic questions. In a stochastic market clearing, the day-ahead and real-time (balancing) stages are co-optimized: day-ahead schedules are chosen to minimize expected total cost across scenarios, anticipating balancing actions. Research consistently shows this improves expected system cost relative to sequential, deterministic clearing, especially at high renewable penetration, because day-ahead schedules pre-position flexibility where scenarios say it will be needed.
|
||
|
||
The difficulties are institutional and economic rather than computational:
|
||
|
||
**Pricing and cost recovery.** In a deterministic convex market, locational marginal prices (LMPs) from the dual variables support the dispatch — every scheduled resource at least breaks even at the price. In stochastic market clearing, no single set of day-ahead prices generally supports the solution scenario-by-scenario: prices that guarantee cost recovery *in expectation* may leave participants losing money in particular realized outcomes, which strains acceptability. Research on "equilibrium-supporting" pricing schemes and revenue-adequacy properties of stochastic clearing remains active, but no major market has adopted full stochastic clearing, in part for this reason.
|
||
|
||
**Fairness and transparency.** Scenario choices directly shape who gets scheduled and paid. A market operator would have to defend its scenario-generation methodology as a quasi-regulatory matter.
|
||
|
||
**What markets actually do.** Real markets have adopted uncertainty-aware elements incrementally rather than wholesale: probabilistic reserve requirements and new ramping products (CAISO's flexible ramping product, MISO's ramp capability product) that are sized using distributions of net-load forecast error; robust look-ahead commitment tools running alongside deterministic market engines; and out-of-market operator actions informed by probabilistic forecasts. Stochastic optimization thus influences markets today mostly through *requirement-setting* and *advisory tools* rather than through the clearing engine itself.
|
||
|
||
## 8. The Participant's Side: Offering, Trading, and Asset Optimization
|
||
|
||
Market participants face their own stochastic problems, and here adoption has been faster because no institutional consensus is required — a firm simply uses better models to make more money.
|
||
|
||
**Renewable offering.** A wind producer selling into a day-ahead market must offer a quantity before knowing its output, then settle deviations at imbalance prices. This is a newsvendor-type problem: the optimal day-ahead offer is a quantile of the production distribution determined by the ratio of penalties for under- and over-delivery. Richer versions co-optimize offers across day-ahead, intraday, and balancing markets as multi-stage stochastic programs.
|
||
|
||
**Storage and hydro valuation.** A battery or pumped-hydro operator arbitraging uncertain prices solves a stochastic dynamic program over the state of charge; the resulting marginal value of stored energy ("opportunity cost curve") is exactly what the asset should bid. For seasonal hydro, SDDP-derived water values serve the same role.
|
||
|
||
**Virtual bidding and financial trading.** Traders placing virtual (purely financial) bids between day-ahead and real-time markets are effectively trading the distribution of the DA–RT spread, and portfolio construction over such positions is a classic stochastic optimization with risk constraints.
|
||
|
||
**Risk measures.** Because market participants are rarely risk-neutral, expected cost is usually replaced or augmented by risk measures, most commonly **Conditional Value-at-Risk (CVaR)** — the expected loss in the worst α-fraction of scenarios. CVaR is coherent and, crucially, preserves linearity: it adds only linear constraints and variables to a scenario-based LP/MIP (Rockafellar–Uryasev formulation), so risk-averse stochastic programs remain tractable. A weighted combination of expectation and CVaR is the de facto standard objective in trading and asset-optimization models.
|
||
|
||
## 9. Computation: Decomposition and Practical Tactics
|
||
|
||
Extensive-form stochastic MIPs get large fast: a unit commitment with 1,000 units, 36 hours, and 50 scenarios has tens of millions of variables. Three decomposition families dominate:
|
||
|
||
**Benders decomposition (the L-shaped method)** splits the problem into a master over first-stage variables and scenario subproblems whose duals generate optimality and feasibility cuts. It is natural when the second stage is a continuous LP (dispatch given commitment) and parallelizes trivially across scenarios. SDDP is its multi-stage, sampled cousin.
|
||
|
||
**Lagrangian relaxation** dualizes coupling constraints — either the nonanticipativity constraints or the system-wide balance constraints — so the problem separates by scenario or by unit. It was the workhorse of unit commitment for decades and provides strong bounds, though recovering primal-feasible solutions requires heuristics.
|
||
|
||
**Progressive Hedging (PH)** (Rockafellar and Wets) relaxes nonanticipativity with an augmented-Lagrangian penalty: each scenario subproblem is solved independently with a penalty pulling its first-stage decisions toward the scenario-weighted average, iterating to consensus. PH is a heuristic without convergence guarantees in the mixed-integer case but works well in practice on SUC and is embarrassingly parallel.
|
||
|
||
Beyond decomposition, practitioners rely on **sample average approximation (SAA)** with out-of-sample validation to choose scenario counts, warm-starting from deterministic solutions, tightened MIP formulations of unit constraints (which matter as much as decomposition), and generous parallel hardware. Open-source tooling has lowered the barrier considerably: PySP/mpi-sppy and StochasticPrograms.jl for general stochastic programming, SDDP.jl for multi-stage problems, and power-system-specific platforms such as PowerSimulations.jl, PLEXOS, and PSR's SDDP implementation.
|
||
|
||
## 10. A Worked Miniature: Two-Scenario Commitment Intuition
|
||
|
||
To make the recourse logic concrete, consider one hour, two units, and two equally likely net-load scenarios of 400 MW and 700 MW. Unit A is a slow unit: 500 MW capacity, $40/MWh, $10,000 startup, must be committed now. Unit B is a fast peaker: 300 MW, $120/MWh, committable in real time. The deterministic model sees the expected load of 550 MW, commits A, and plans 550 MW from it — but in the high scenario A alone cannot serve 700 MW, so the peaker runs 200 MW at high cost, and in the low scenario A runs part-loaded. The stochastic model evaluates the *actual* expected cost of each commitment plan against both scenarios, correctly weighing A's startup cost against the probability-weighted peaker usage, and would also detect cases where the deterministic plan is infeasible in the tail (e.g., if the high scenario were 900 MW, expected-value commitment would leave the system short). The general lesson generalizes: deterministic models are systematically blind to asymmetries between scenarios, and the cost of that blindness grows with net-load variance — which is exactly what renewable growth delivers.
|
||
|
||
## 11. Open Frontiers
|
||
|
||
Several directions define current research and near-term practice. First, **learning-augmented optimization**: using machine learning to warm-start commitments, predict active constraints, or learn cost-to-go functions, cutting solve times enough to make stochastic clearing computationally routine. Second, **distributionally robust and data-driven formulations** that connect the scenario-generation step and the optimization step into one statistically principled pipeline. Third, **pricing theory for non-convex, stochastic markets** — extending convex-hull and extended-LMP ideas to settings with scenarios, so that stochastic clearing could produce defensible settlement prices. Fourth, **multi-stage market designs** (continuous intraday trading, shorter gate closures) that reduce the here-and-now burden by letting more decisions become recourse. And fifth, **demand-side and storage recourse**: as flexible demand and batteries proliferate, the cheapest hedge against uncertainty increasingly sits on the consumption side, and models are evolving to co-optimize it.
|
||
|
||
## 12. Suggested Reading
|
||
|
||
For foundations, Birge and Louveaux, *Introduction to Stochastic Programming*, and Shapiro, Dentcheva, and Ruszczyński, *Lectures on Stochastic Programming*. For electricity applications, Conejo, Carrión, and Morales, *Decision Making Under Uncertainty in Electricity Markets*, is the standard reference; Morales, Conejo, Madsen, Pinson, and Zugno, *Integrating Renewables in Electricity Markets*, covers stochastic clearing and renewable offering in depth. Pereira and Pinto's 1991 paper "Multi-stage stochastic optimization applied to energy planning" introduces SDDP; Bertsimas et al.'s "Adaptive robust optimization for the security constrained unit commitment problem" (2013) is the touchstone for the robust alternative; and Rockafellar and Uryasev's "Optimization of conditional value-at-risk" (2000) underpins the risk-averse formulations used throughout the industry.
|