The Oil-Market SVAR
Python · R · Part 8 of the VAR arc — supply, demand & identification
Overview
Part 8 of the VAR arc — its first genuinely non-monetary structural application. For decades the oil price was treated as an exogenous supply shock (price up ⟹ recession, Hamilton 1983). But the oil price is a price, set by supply and demand, so "an oil price increase" is not one event: a rise because OPEC cut output is economically different from one driven by a global boom pulling up demand for all industrial commodities, which differs again from a precautionary response to feared future shortfalls. Kilian (2009) disentangles them inside a structural VAR, and the punchline reshaped the field — the source of an oil price change matters more than its size, and most big moves have been demand-driven, not supply disruptions. This example reuses the structural ideas of Part 2 and adds two tools not yet seen in the series — the forecast-error variance decomposition and the historical decomposition — in a new self-contained module (oilsvar.py). A monthly 3-variable VAR (, 1974–2019): oil-production growth, the Kilian index of global real activity (from ocean dry-cargo freight rates), and the real price of oil.
Two notebooks: identify, then stress-test the identification
8a — the recursive identification. A Cholesky ordering whose zeros are defensible within-the-month timing restrictions: crude production is near-vertical in the short run, so supply does not respond to demand within the month; global real activity reacts to a supply shock but not to oil-specific news within the month; and the real oil price is the fast, forward-looking variable that absorbs all three shocks on impact. The three structural shocks are thus a supply disruption, an aggregate-demand expansion, and an oil-specific (precautionary) demand shock — each sign-normalised to raise the real oil price, with Bayesian bands from a diffuse Normal-inverse-Wishart posterior. 8b — the identification debate. That single supply-does-not-respond zero is an economic claim: the short-run price elasticity of oil supply is exactly zero. Notebook 8b relaxes it three less-dogmatic ways over Haar-uniform rotations — sign restrictions (Uhlig; Rubio-Ramírez–Waggoner–Zha), a hard elasticity bound (Kilian–Murphy), and an explicit Bayesian elasticity prior (Baumeister–Hamilton) — and asks how much Kilian's conclusion depends on the assumption.
Results
8a — the big oil episodes, decomposed. The three "oil price increases" have completely different dynamic signatures: a supply disruption raises the price only modestly and slowly (+0.5 on impact), an aggregate-demand expansion builds a hump over a year (~+4 by 12 months), and an oil-specific demand shock jumps immediately (+6.5) and persists. The variance decomposition is the result that overturned the old view: supply explains ~2% of the real oil price at 18 months, vs ~17% aggregate demand and ~81% oil-specific (precautionary) demand. The historical decomposition attributes the 2003–2008 super-spike almost entirely to demand (aggregate +432, precautionary +887, while supply subtracted −161) — the China-led boom, not an OPEC squeeze, drove oil to $140. 8b — the conclusion is only as strong as the elasticity belief. Once the timing zeros go, flat sign restrictions let the supply share of the oil-price variance jump from 2% to ~31% (they admit an implausibly elastic supply); disciplining the elasticity to the near-inelastic range everyone agrees on pulls it back — Kilian–Murphy to ~10%, Baumeister–Hamilton's softer prior to ~26%. The honest lesson: neither the recursive zero (elasticity = 0) nor a "flat" sign-restriction prior is assumption-free — Kilian's demand story survives conditional on supply being inelastic, which is well supported, but the data alone don't pin the split. Each notebook is cross-checked in R (vars; an independent rotation search).
Notebooks
Downloads
oilsvar.py The from-scratch oil-SVAR module — recursive & set identification, IRFs, variance and historical decompositions (new self-contained module) oilsvar_data.csv World oil production (EIA), the Kilian real-activity index (Dallas Fed), and the real refiners' acquisition cost of imported crude, monthly 1974–2019 References
- Kilian, L. (2009). Not all oil price shocks are alike: disentangling demand and supply shocks in the crude oil market. American Economic Review 99(3), 1053–1069. — the recursive oil-market SVAR reproduced in 8a
- Kilian, L. (2009). Exogenous oil supply shocks: how big are they and how much do they matter for the U.S. economy? Review of Economics and Statistics 91(2), 216–240. — the real-activity index from dry-cargo freight rates
- Hamilton, J. D. (1983). Oil and the macroeconomy since World War II. Journal of Political Economy 91(2), 228–248. — the earlier exogenous-supply-shock view
- Kilian, L. & Murphy, D. P. (2012). Why agnostic sign restrictions are not enough: understanding the dynamics of oil market VAR models. Journal of the European Economic Association 10(5), 1166–1188. — the elasticity-bounded set identification in 8b
- Baumeister, C. & Hamilton, J. D. (2019). Structural interpretation of vector autoregressions with incomplete identification: revisiting the role of oil supply and demand shocks. American Economic Review 109(5), 1873–1910. — the explicit Bayesian elasticity prior in 8b
- Uhlig, H. (2005). What are the effects of monetary policy on output? Results from an agnostic identification procedure. Journal of Monetary Economics 52(2), 381–419. — the sign-restriction / Haar-rotation methodology
- Rubio-Ramírez, J. F., Waggoner, D. F. & Zha, T. (2010). Structural vector autoregressions: theory of identification and algorithms for inference. Review of Economic Studies 77(2), 665–696. — the rotation-based set-identification algorithm