power-market-trading-docs/primers/newsvendor_en.md

60 lines
9.1 KiB
Markdown
Raw Normal View History

# The Newsvendor Problem: A Compact Primer for Electricity Markets
## 1. The Model in One Paragraph
A vendor must decide how many newspapers `q` to stock before knowing the day's demand `D`, a random variable with distribution `F`. Each unit of unmet demand costs `c_u` (the underage cost: lost margin, penalty, or replacement at a higher price); each unit of unsold stock costs `c_o` (the overage cost: purchase price minus salvage). The vendor minimizes expected cost:
```
minimize over q : E[ c_u · (D q)⁺ + c_o · (q D)⁺ ]
```
This is the smallest interesting stochastic optimization problem: one decision, one random variable, one period, and — crucially — a closed-form solution that carries the central lesson of the entire field.
## 2. The Critical Ratio: Why the Answer Is a Quantile, Not a Forecast
Take the derivative of expected cost in `q` (or argue marginally: the last unit stocked is worth it if the expected underage it avoids exceeds the expected overage it risks). At the optimum, the marginal benefit `c_u · P(D > q)` equals the marginal cost `c_o · P(D ≤ q)`, giving the **critical ratio** (also called the critical fractile):
```
F(q*) = c_u / (c_u + c_o) ⟹ q* = F⁻¹( c_u / (c_u + c_o) )
```
Three things to notice. First, the optimal decision is a **quantile** of the demand distribution — the mean appears nowhere. If underage is three times as painful as overage, stock at the 75th percentile; if overage dominates, stock below the median. Second, the deterministic habit of "plan against the forecast" is optimal only in the knife-edge case `c_u = c_o` *and* a symmetric distribution — asymmetric costs or a skewed distribution make the point forecast systematically the wrong answer. Third, the solution needs the whole distribution (or at least the right quantile of it), not a point estimate: this is the precise sense in which uncertainty quantification has decision value.
The expected cost at the optimum also has a clean interpretation: it grows with the *spread* of `D` around the chosen quantile. Forecast improvement (variance reduction) and decision improvement (choosing the right quantile) are complementary but distinct levers — a lesson organizations routinely blur.
## 3. The Newsvendor in Electricity, Usually Unnamed
Electricity markets are full of one-shot quantity decisions made before uncertainty resolves and settled asymmetrically afterward. Each is a newsvendor once you identify `q`, `D`, `c_u`, and `c_o`.
**Renewable day-ahead offering.** A wind or solar producer offers quantity `q` into the day-ahead market at price `π_DA`, then settles the deviation between actual production `D` and the offer at imbalance prices. In a dual-price balancing market, under-delivery is bought back at a price above `π_DA` (unit underage cost `c_u` = buy-back premium) and over-delivery is sold at a price below it (`c_o` = sell-down discount). The optimal offer is exactly the critical-ratio quantile of the production distribution — a producer facing harsh shortfall penalties should offer conservatively (a low quantile), and vice versa. This result, due to the trading literature of the 2000s (Bremnes; Pinson, Chevallier, and Kariniotakis), is why quantile forecasts, not point forecasts, are the deliverable that matters for renewable traders, and it is the entry point for the richer multi-market offering models in the stochastic optimization primer.
**Reserve sizing.** How many MW of operating reserve should the system hold against net-load forecast error and outages? Holding an unused MW costs the reserve procurement price (overage); being a MW short costs expected load shedding at the value of lost load, or expensive emergency actions (underage). With `c_u` in the thousands of $/MWh (VOLL) and `c_o` in the tens, the critical ratio sits far in the right tail — which is exactly why reserve requirements correspond to high quantiles (e.g., 95th99.9th percentile) of the net-load error distribution. Probabilistic reserve methodologies and ramping-product demand curves in modern ISOs are institutionalized newsvendor logic.
**Operating reserve demand curves (ORDCs).** Run the logic in reverse: instead of fixing a quantity, price each increment of reserve at its expected marginal value, `VOLL × LOLP(r)` — the value of lost load times the probability of losing load given reserve level `r`. ERCOT's ORDC is the canonical implementation. The demand curve *is* the newsvendor first-order condition traced out over quantities.
**Retail and fuel procurement.** A retailer contracting energy forward for uncertain customer load faces spot-price exposure on the shortfall and resale losses on the surplus; a gas-fired generator nominating day-ahead pipeline capacity against uncertain dispatch faces imbalance penalties both ways. Both reduce to critical fractiles of load or dispatch distributions, complicated in practice by the correlation between quantity and price (you tend to be short exactly when prices are high), which shifts the effective quantile — a first taste of why joint distributions matter.
## 4. The Forecasting Connection: Pinball Loss Is Newsvendor Loss
The link between this decision problem and modern probabilistic forecasting is exact, not analogical. The **pinball (quantile) loss** used to train and evaluate quantile forecasts,
```
L_τ(q, d) = τ·(d q)⁺ + (1 τ)·(q d)⁺ ,
```
is the newsvendor cost function with `c_u = τ` and `c_o = 1 τ`; minimizing its expectation yields the τ-quantile. So a forecaster minimizing pinball loss at `τ = c_u/(c_u + c_o)` is *directly* solving the trader's or operator's decision problem — forecasting and optimization collapse into one step. This observation underlies the current "decision-focused" or "predict-then-optimize" research agenda: rather than fitting a distribution and optimizing against it, train the forecast on the loss the decision actually incurs. The newsvendor is the one case where this program has a complete, closed-form answer.
## 5. Risk Aversion and Other Extensions
The classical model is risk-neutral. Real participants care about tails, and the standard fix is to replace expected cost with a **CVaR** or meanCVaR objective. The elegant result: for the newsvendor, CVaR optimization again yields a quantile decision, just at a *shifted* critical ratio — risk aversion tilts the offer toward whichever side has the worse tail. Under the RockafellarUryasev formulation the problem remains a small LP given scenarios, previewing how risk enters the larger models in the stochastic primer without breaking tractability.
Other standard extensions each add one ingredient and point toward a larger literature: **price-dependent demand** (the price-setting newsvendor) toward joint pricing/quantity decisions; **quantityprice correlation** toward portfolio and hedging models; **multi-period inventory with carryover** toward base-stock policies and, in electricity, storage arbitrage (a battery's charge decision against uncertain future prices is a newsvendor chained through time); **unknown distribution** toward the distributionally robust newsvendor — Scarf's 1958 closed-form solution for the worst distribution matching a given mean and variance is one of the earliest DRO results and still a touchstone.
## 6. The Bridge to Two-Stage Stochastic Programming
Formally, the newsvendor *is* a two-stage stochastic program: `q` is the here-and-now decision, and the recourse problem is trivial — buy the shortfall at `c_u` or salvage the surplus at `c_o`, with the recourse cost `Q(q, D) = c_u(D q)⁺ + c_o(q D)⁺` available in closed form. Everything in the full stochastic optimization toolkit is this structure with the trivialities removed: replace the scalar `q` with a vector of unit commitments, replace the closed-form recourse with a dispatch LP per scenario, and the closed-form quantile solution disappears — but the *economics* survives intact. Stochastic unit commitment is, at heart, the system operator asking the newsvendor question in a thousand coupled dimensions: how much slow, cheap capacity to commit now, given asymmetric costs of being long (startup and no-load costs wasted) versus short (peakers, scarcity prices, load shedding) against the net-load distribution. Whenever a stochastic model's output seems opaque, the newsvendor is the right sanity check: identify the implicit `c_u/c_o` ratio, and ask whether the model is choosing a sensible quantile.
## 7. Suggested Reading
The model traces to Edgeworth's 1888 bank-reserve analysis and Arrow, Harris, and Marschak (1951) in its modern form; Porteus's *Foundations of Stochastic Inventory Theory* and the survey by Qin et al. (2011) cover the classical theory and extensions. Scarf (1958) is the distribution-free origin. For electricity: Bremnes (2004) and Pinson, Chevallier, and Kariniotakis (2007) establish the quantile-offering result for wind; Morales, Conejo, Madsen, Pinson, and Zugno, *Integrating Renewables in Electricity Markets*, chapter 7, gives the full trading treatment; Hogan's ORDC papers develop the scarcity-pricing incarnation; Rockafellar and Uryasev (2000) supply the CVaR machinery reused throughout.