Commodity Pricing, Part 2: Price Models#
A forward curve gives today’s prices. An option, a storage contract or a plant depends on how the curve will move, and that needs a model. Commodity models share a few features that equity models lack: prices revert to a level set by the cost of production, volatility is high for the near delivery dates and low for the far ones, and for power prices spike and fall back. This page sets out the two-factor model of Schwartz and Smith, the standard for commodity curves, the volatility it implies for every delivery date, the way spikes are modelled for power, and what the curve and the volatilities can and cannot say about the parameters. It is the second of four pages on how commodities are priced.
One factor with mean reversion#
Let \(S_t\) be the spot price and \(X_t = \ln S_t\). A model with mean reversion has
so that \(X\) is pulled toward a long-run level \(\alpha\) at the speed \(\kappa\). The futures price for delivery at \(T\) is the expectation of the spot price under the pricing measure. Because the expectation of a lognormal variable is \(e^{\text{mean} + \frac12\text{variance}}\), the curve follows from the mean and the variance of \(X_T\), and the futures price moves with the spot price with a sensitivity that falls with the time to delivery, as \(e^{-\kappa T}\):
The volatility of a futures price is therefore \(\sigma e^{-\kappa (T - t)}\), high near delivery and falling as the delivery date is further away. It is the Samuelson effect, and it is visible in every commodity market: the front month is much more volatile than the contract for two years ahead. The model has no way to move the far end of the curve independently, since a single shock moves all the maturities together, and the long-run volatility goes to zero.
The two-factor model of Schwartz and Smith#
Schwartz and Smith split the log price into a short-term and a long-term part, \(\ln S_t = \chi_t + \xi_t\), with
The short-term factor \(\chi\) is the deviation from the equilibrium price: it reverts to zero, and it stands for the shortages, the weather and the stocks. The long-term factor \(\xi\) is the equilibrium level, with a drift and a volatility, and it stands for the cost of production and the long-term balance of supply and demand. Under the pricing measure, with a risk premium \(\lambda_\chi\) on the short-term factor and the equilibrium drift \(m\), the log of the futures price is
with the variance of the log price
The curve starts at the spot price with the short-term factor, and for long maturities it grows only with the equilibrium drift. The futures price is a martingale, and moves by
so the volatility of the futures price with \(\tau = T - t\) left to delivery is
It starts at the combined volatility of the two factors, and falls to the volatility of the long-term factor \(\sigma_\xi\), which is not zero. That is why the model fits the term structure of commodity volatility, and the one-factor model, with a long-term volatility of zero, does not.
Seasonality and spikes#
Commodities with a regular annual pattern, such as gas and power, multiply the price by a seasonal factor \(s(T)\), or add a seasonal term to the log price, so that
The seasonal factor carries the shape of Commodity Pricing, Part 1: Forward Curves & Swaps, and the volatilities can carry a seasonal pattern as well: a winter month in a gas market is more volatile than a summer month.
For power, the spot price spikes. A Gaussian mean-reverting model does not produce the tail. The usual remedy is to add jumps to the log price, which decay with the same fast reversion as the short-term factor,
with a Poisson process \(N\) of intensity \(\lambda\) and positive jumps \(J\), for example exponential. The model gives a skewed, heavy-tailed distribution, and the price can recover to its normal level in days. A spike is a feature of the spot price in a single hour, and averages away in a forward for a month, so the forward is much less volatile than the spot. If the price can be negative, as for power with a surplus of wind, the log is not defined, and the model is written for the price itself, in the arithmetic form that is the analogue of Interest Rate Volatility, Part 2: The Bachelier (Normal) Model.
Calibration and what it determines#
The model is calibrated to two kinds of data. The futures curve gives the level and the shape: \(\chi_0\), \(\xi_0\), \(m\) and \(\kappa\). The volatilities of futures options by delivery date give the term structure \(\sigma_F(\tau)\), and with it \(\kappa\), \(\sigma_\chi\), \(\sigma_\xi\) and \(\rho\). Two things limit what the curve says.
The curve depends on the volatilities only through the convexity term \(\tfrac12 V(T)\), which is small and can be absorbed by the drift. A curve fits equally well with very different volatilities.
The curve depends on \(\chi_0\) and on the risk premium \(\lambda_\chi\) in one combination, \(\chi_0 + \lambda_\chi/\kappa\), so the premium and the short-term factor cannot be separated by the curve. The premium is the difference between the drift of the real price and the drift under the pricing measure, and it is not observable from the prices.
The effect is the same as in the calibration of Calibration: a model that fits all the quotes can still say little about the quantities that it is used for. Here the quantity is the volatility of the far curve, which prices the long-dated options and the storage and plant contracts.
Worked example#
The example uses the model with a speed of 1.5, volatilities of 45% and 15% for the two factors and a correlation of 0.3. It computes the volatility of the futures price against the time to delivery, and the curve, and then checks by simulation that the simulated futures prices are martingales with the volatility that the formula gives. It then compares a Gaussian log price with one with jumps, scaled to the same standard deviation. Finally it fits the curve to ten futures with noise under three different settings of the volatilities, and fits the volatility term structure to six noisy option volatilities, with standard errors from the Jacobian (The Jacobian).
Python code
"""Price models: the Schwartz-Smith curve, the volatility term structure, a spike model for power, and what a curve alone can identify."""
import numpy as np
from scipy.optimize import least_squares
from commodity_common import curve_shocks, ss_future_vol, ss_log_futures, ss_variance
KAPPA, SX, SXI, RHO = 1.5, 0.45, 0.15, 0.30
TRUE_CURVE = dict(chi0=0.20, xi0=np.log(3.40), m=0.02, lam=0.0)
MATURITIES = np.array([1 / 12, 2 / 12, 3 / 12, 6 / 12, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0])
VOL_TIMES = np.array([1 / 12, 0.25, 0.5, 1.0, 2.0, 3.0])
def jump_spot(rng, paths, days, spikes, kappa=25.0, sigma=0.9, intensity=7.0, jump_mean=0.8, burn=200):
"""Daily log price deviation: mean-reverting noise, with Poisson jumps that decay at the same fast rate."""
a = np.exp(-kappa / 365)
sd = sigma * np.sqrt((1 - a**2) / (2 * kappa))
x = np.zeros(paths)
out = []
for d in range(days + burn):
x = a * x + sd * rng.standard_normal(paths)
if spikes:
hit = rng.random(paths) < intensity / 365
x = x + hit * rng.exponential(jump_mean, paths)
if d >= burn:
out.append(x.copy())
return np.array(out).ravel()
if __name__ == "__main__":
print(f"Schwartz-Smith parameters: kappa {KAPPA}, short-term vol {SX:.0%}, long-term vol {SXI:.0%}, correlation {RHO}")
print("\n1. Volatility of the futures price against the time to delivery")
print(f" {'Years':>6} " + " ".join(f"{t:7.3f}" for t in (1 / 12, 0.25, 0.5, 1, 2, 3, 5, 10)))
print(f" {'Vol':>6} " + " ".join(f"{ss_future_vol(t, KAPPA, SX, SXI, RHO):7.1%}" for t in (1 / 12, 0.25, 0.5, 1, 2, 3, 5, 10)))
print("\n2. The futures curve, and a simulation check that simulated futures prices are martingales")
print(f" {'Delivery (years)':>17} {'F(0,T)':>8}")
for t in (0.25, 1.0, 2.0, 5.0):
print(f" {t:17.2f} {np.exp(ss_log_futures(t, **TRUE_CURVE, kappa=KAPPA, sx=SX, sxi=SXI, rho=RHO)):8.4f}")
rng = np.random.default_rng(2)
times, delivery = np.array([0.25, 0.5, 1.0]), np.array([1.0, 2.0])
shocks = curve_shocks(times, delivery, KAPPA, SX, SXI, RHO, 400_000, rng)
print(f" {'Date':>6} {'Delivery':>9} {'mean of F(t,T)/F(0,T)':>22} {'std dev of ln F(t,T)':>21} {'theory':>8}")
for i, t in enumerate(times):
for j, d in enumerate(delivery):
if d <= t:
continue
w = np.exp(-KAPPA * (d - t))
var = w**2 * SX**2 * (1 - np.exp(-2 * KAPPA * t)) / (2 * KAPPA) + SXI**2 * t + 2 * w * RHO * SX * SXI * (1 - np.exp(-KAPPA * t)) / KAPPA
print(f" {t:6.2f} {d:9.1f} {np.mean(np.exp(shocks[:, i, j])):22.4f} {np.std(shocks[:, i, j]):21.4f} {np.sqrt(var):8.4f}")
print("\n3. Spikes: 400 paths of 800 days, a Gaussian mean-reverting log price and one with jumps, scaled to the same standard deviation")
rng = np.random.default_rng(4)
gauss = jump_spot(rng, 400, 800, False)
jumpy = jump_spot(rng, 400, 800, True)
gauss = gauss * jumpy.std() / gauss.std()
for name, x in (("Gaussian", gauss), ("With jumps", jumpy)):
z = x - np.median(x)
kurt = np.mean((x - x.mean()) ** 4) / x.var() ** 2 - 3
print(f" {name:<11} std dev {x.std():.3f}, skewness {np.mean((x - x.mean()) ** 3) / x.std() ** 3:+.2f}, excess kurtosis {kurt:5.2f}, "
f"days above 2x the median {np.mean(z > np.log(2)):.2%}, above 3x {np.mean(z > np.log(3)):.3%}")
print("\n4. What the curve alone determines: 10 futures with 0.3% noise, fitted with three different volatility settings")
rng = np.random.default_rng(6)
ln_f = ss_log_futures(MATURITIES, **TRUE_CURVE, kappa=KAPPA, sx=SX, sxi=SXI, rho=RHO) + rng.normal(0, 0.003, MATURITIES.size)
print(f" {'Volatility setting (sx, sxi, rho)':<36} {'fit RMSE':>9} {'kappa':>7} {'F(7y)':>7} {'vol at 1y':>10} {'vol at 3y':>10}")
for sx, sxi, rho in ((0.20, 0.08, 0.0), (0.45, 0.15, 0.3), (0.80, 0.25, 0.5)):
def resid(p):
chi0, xi0, m, kappa = p
return ss_log_futures(MATURITIES, chi0, xi0, m, 0.0, kappa, sx, sxi, rho) - ln_f
fit = least_squares(resid, [0.1, np.log(3.5), 0.0, 1.0], bounds=([-2, 0, -0.5, 0.05], [2, 3, 0.5, 10]))
chi0, xi0, m, kappa = fit.x
f7 = np.exp(ss_log_futures(7.0, chi0, xi0, m, 0.0, kappa, sx, sxi, rho))
print(f" ({sx:.2f}, {sxi:.2f}, {rho:.1f}){'':<22} {np.sqrt(np.mean(fit.fun**2)):9.4f} {kappa:7.2f} {f7:7.3f} "
f"{ss_future_vol(1.0, kappa, sx, sxi, rho):10.1%} {ss_future_vol(3.0, kappa, sx, sxi, rho):10.1%}")
print(f" True model: F(7y) {np.exp(ss_log_futures(7.0, **TRUE_CURVE, kappa=KAPPA, sx=SX, sxi=SXI, rho=RHO)):.3f}, "
f"vol at 1y {ss_future_vol(1.0, KAPPA, SX, SXI, RHO):.1%}, vol at 3y {ss_future_vol(3.0, KAPPA, SX, SXI, RHO):.1%}")
print("\n5. Fitting the volatility term structure: six futures volatilities with 1 volatility point of noise")
vols = ss_future_vol(VOL_TIMES, KAPPA, SX, SXI, RHO) + rng.normal(0, 0.01, VOL_TIMES.size)
fit = least_squares(lambda p: ss_future_vol(VOL_TIMES, p[0], p[1], p[2], p[3]) - vols, [1.0, 0.3, 0.2, 0.0], bounds=([0.05, 0.01, 0.01, -0.99], [10, 2, 1, 0.99]))
cov = np.sum(fit.fun**2) / (VOL_TIMES.size - 4) * np.linalg.inv(fit.jac.T @ fit.jac)
se = np.sqrt(np.diag(cov))
print(f" {'':<10} {'kappa':>8} {'sx':>8} {'sxi':>8} {'rho':>8}")
print(f" {'True':<10} {KAPPA:8.3f} {SX:8.3f} {SXI:8.3f} {RHO:8.3f}")
print(f" {'Fitted':<10} " + " ".join(f"{v:8.3f}" for v in fit.x))
print(f" {'Std error':<10} " + " ".join(f"{v:8.3f}" for v in se))
print(f" fitted vols at 1y and 3y: {ss_future_vol(1.0, *fit.x):.1%} and {ss_future_vol(3.0, *fit.x):.1%}, volatility RMSE {np.sqrt(np.mean(fit.fun**2)):.4f}")
The output is:
Schwartz-Smith parameters: kappa 1.5, short-term vol 45%, long-term vol 15%, correlation 0.3
1. Volatility of the futures price against the time to delivery
Years 0.083 0.250 0.500 1.000 2.000 3.000 5.000 10.000
Vol 46.5% 38.2% 29.5% 20.4% 15.8% 15.2% 15.0% 15.0%
2. The futures curve, and a simulation check that simulated futures prices are martingales
Delivery (years) F(0,T)
0.25 4.0192
1.00 3.8275
2.00 3.8295
5.00 4.1678
Date Delivery mean of F(t,T)/F(0,T) std dev of ln F(t,T) theory
0.25 1.0 1.0002 0.1101 0.1101
0.25 2.0 1.0002 0.0801 0.0801
0.50 1.0 1.0003 0.1720 0.1723
0.50 2.0 1.0002 0.1154 0.1155
1.00 2.0 1.0003 0.1741 0.1743
3. Spikes: 400 paths of 800 days, a Gaussian mean-reverting log price and one with jumps, scaled to the same standard deviation
Gaussian std dev 0.464, skewness +0.00, excess kurtosis 0.00, days above 2x the median 6.77%, above 3x 0.908%
With jumps std dev 0.464, skewness +3.39, excess kurtosis 18.44, days above 2x the median 8.54%, above 3x 4.286%
4. What the curve alone determines: 10 futures with 0.3% noise, fitted with three different volatility settings
Volatility setting (sx, sxi, rho) fit RMSE kappa F(7y) vol at 1y vol at 3y
(0.20, 0.08, 0.0) 0.0030 1.53 4.424 9.1% 8.0%
(0.45, 0.15, 0.3) 0.0031 1.71 4.417 19.1% 15.1%
(0.80, 0.25, 0.5) 0.0038 2.12 4.400 30.9% 25.1%
True model: F(7y) 4.436, vol at 1y 20.4%, vol at 3y 15.2%
5. Fitting the volatility term structure: six futures volatilities with 1 volatility point of noise
kappa sx sxi rho
True 1.500 0.450 0.150 0.300
Fitted 2.077 0.367 0.157 0.990
Std error 4.092 0.876 0.013 7.970
fitted vols at 1y and 3y: 20.3% and 15.8%, volatility RMSE 0.0056
Reading the output:
Volatility falls with the time to delivery and settles above zero. The futures volatility is 46.5% for delivery in a month, 29.5% at six months, 20.4% at a year, and 15.0% at five years and beyond, which is the long-term volatility \(\sigma_\xi\). A one-factor model would fall to zero.
The simulation reproduces the model. For the simulated curves, the mean of \(F(t, T)/F(0, T)\) is 1.0002 to 1.0003 in every case, and the standard deviation of the log price agrees with the formula to the third decimal place, for example 0.1720 against 0.1723 at six months for delivery at one year. This is the check that the curve simulation used in Commodity Pricing, Part 4: Storage, Swing & Plants is a martingale with the right volatility.
The curve has a shape that comes from the short-term factor. The one-year futures price is 3.83 and the two-year 3.83, below the three-month price of 4.02 and well below the five-year price of 4.17. The short-term factor starts above its mean, which gives the backwardation at the front, and the drift gives the contango beyond.
Jumps change the tails and leave the spread unchanged. Both series have a standard deviation of 0.464. The Gaussian log price has a skewness and excess kurtosis of zero and is more than three times its median on 0.9% of days. The jump model has a skewness of 3.4 and an excess kurtosis of 18, and prices are more than three times their median on 4.3% of days, nearly five times as often. An option or a plant that pays on the tails values them differently.
The curve cannot fix the volatilities. The three volatility settings, with a short-term volatility of 20%, 45% and 80%, fit ten futures prices equally well, with an RMSE of 0.30%, 0.31% and 0.38% against noise of 0.3%. They give the same seven-year price, 4.42, 4.42 and 4.40, against a true 4.44. They imply a one-year futures volatility of 9%, 19% and 31%, against a true 20.4%. The curve alone leaves the volatility of the far curve open by a factor of three.
The volatility term structure fixes the volatilities that matter, and not the parameters. The fit to the six volatilities has an RMSE of 0.56 volatility points and reproduces the one-year and three-year volatilities, 20.3% and 15.8%, for true values of 20.4% and 15.2%. The individual parameters are not determined: \(\kappa\) is 2.08 with a standard error of 4.1, the short-term volatility 0.37 with 0.88, and the correlation sits at its bound of 0.99. Only the long-term volatility is pinned down, 0.157 with a standard error of 0.013. The combination that the products depend on, the volatility by delivery date, is fixed, and the parameters that produce it are not.
A valuation control view#
Ask for the calibration data, not just the parameters: the futures that were fitted, the options whose volatilities were used, and how far in maturity they go. A model with volatilities fitted to the front of the curve and used for a storage contract of two years is extrapolating.
Test that the model reproduces the volatility term structure: the Samuelson decay is the main feature of the data, and a model that does not show it misprices every option away from the front.
Do not read the parameters one at a time: a good fit with a correlation at its bound or a mean reversion with a large standard error is the usual picture. Report the quantities that the products use, such as the volatility at each tenor, and their uncertainty.
Check the spike model against history: the intensity, the size and the speed of decay of the jumps decide the value of any product that pays on the tails. Compare the model’s frequency of high prices with the record, and with a different model.
Look at the risk premium: a model that is calibrated to the market prices and then used with real-world parameters, or the reverse, mixes the two measures. See Model Risk in Valuation.
Next, Commodity Pricing, Part 3: Options & Spreads prices options on the curve, from the Black-76 formula to Asian and spread options.