The UK Gas–Electricity Relationship Broke in 2019. Nobody Noticed Until 2021.
A regime-switching cointegration analysis of UK wholesale prices, 2010–2026
The UK Gas–Electricity Relationship Broke in 2019. Nobody Noticed Until 2021.
A regime-switching cointegration analysis of UK wholesale prices, 2010–2026
When wholesale gas prices spiked in late 2021, the story wrote itself: the energy crisis disrupted everything, including the long-standing equilibrium between gas and electricity prices.
That story is half right. The relationship did break, but it broke two years earlier than anyone seems to have noticed, and for reasons that have nothing to do with the visible crisis. The new equilibrium that emerged after the crisis is materially different from the one that preceded it, with implications for anyone forecasting UK energy prices, calibrating retail tariff models, or designing market interventions.
This piece walks through the analysis. It’s longer than a typical Medium post because the methodology matters; the conclusions only hold if the testing is rigorous.

Why this question matters
UK wholesale electricity is priced at the marginal cost of generation. Most hours of most days, gas-fired plants are the marginal source; they’re the price-setter. In a market that works as designed, gas and electricity prices should be tied together over the long run, even though they fluctuate day to day. Specifically, they should be cointegrated: each one wanders, but the relationship between them should be stable enough that deviations correct over time.
The 2021–2023 energy crisis was a natural experiment in whether that tie held. Headline prices reached levels several times their historical norms. Industrial customers shut down operations. The default tariff price cap rose to politically unprecedented levels. By the end of 2023, prices had partially corrected, but to a clearly higher base than before.
Two questions follow:
- Did the long-run gas–electricity equilibrium genuinely break, or did it just shift to a new level?
- If it broke, when, and is the post-crisis market converging on a new equilibrium?
These aren’t academic. The wholesale electricity allowance in Ofgem’s default tariff price cap is calibrated against the gas–electricity relationship. Energy retailers’ pricing models rest on it. Industrial hedging strategies depend on it. EU and UK proposals to “decouple” gas from electricity are arguments about whether and how this relationship should be modified by policy. Anyone making those calls needs to know what the relationship actually looks like now.
The data
I used monthly wholesale price data from Ofgem’s Wholesale Market Indicators:
- Gas: NBP day-ahead contracts, monthly average (£/MWh equivalent)
- Electricity: GB baseload day-ahead contracts, monthly average (£/MWh)
Both series are publicly available, free, and authoritative. The modelling sample is the common overlap: June 2010 to January 2026, n = 188 monthly observations.

The series visibly co-move throughout the sample, but the 2021–2023 episode is dramatic. Gas peaked at roughly six times its pre-crisis range; electricity followed with a similar magnitude and an apparent four-month lag. Prices then partially corrected through 2023, settling at levels still well above the 2010–2020 norm.
That’s the visual story. The question is what formal econometrics says.
Method: A five-layer cointegration analysis
I ran the analysis in five stages, each addressing a specific question.
Stage 1: Are the series themselves non-stationary? Cointegration testing only makes sense if both series are I(1), non-stationary in levels, and stationary in first differences. I tested this with ADF and KPSS (which have opposite null hypotheses, so finding agreement is genuinely informative) and Zivot-Andrews, which allows for one endogenous structural break in the unit root null.
Both log series passed the standard tests as I(1). Zivot-Andrews additionally identified clear break dates: February 2021 for gas, June 2021 for electricity. The four-month lag is itself informative — gas market stress emerged first, and electricity responded with a delay, consistent with the marginal pricing mechanism.
Stage 2: Full-sample cointegration tests. I ran Engle-Granger and Johansen tests across the full 2010–2026 sample. Both failed to reject the null of no cointegration. The Engle-Granger Durbin-Watson statistic of 0.25 is a clear marker of severe residual persistence — the regression captures a shared trend rather than a stable equilibrium.
Stage 3: Cointegration with a structural break. A natural next question: Does the relationship cointegrate if you allow for a one-time break? This is what the Gregory-Hansen (1996) test does. I implemented it manually because there’s no clean Python library: for each candidate break date in the middle 70% of the sample, you estimate a regime-shift regression and compute the ADF statistic on residuals. The minimum ADF across all candidates is the test statistic.
Critical values for Gregory-Hansen are more negative than standard ADF because the break date is chosen endogenously; you’re effectively cherry-picking the best break. The 10% critical value is approximately -4.68.
My result: a test statistic of -4.60 at an optimal break in November 2021. That’s less negative than the 10% threshold. Even allowing for an endogenously-selected break, cointegration cannot be recovered from the full sample.
That’s a striking finding. It rules out the simplest interpretation (“the relationship shifted to a new level in 2021”) and forces the analysis to a higher resolution: multiple regimes, each with its own dynamics.
Stage 4: Structural break detection. I applied Bai-Perron-style multiple breakpoint detection to the cointegrating residuals using the ruptures Python library, with both PELT and Binary Segmentation algorithms. Both algorithms, run independently, converged on the same three break dates: October 2015, February 2019, and September 2023.
The 2019 break was the surprise. I’d initially expected the meaningful break to be in early 2021, when prices started visibly rising. Instead, the algorithm was telling me the relationship had already shifted two years earlier in a period where nothing dramatic was happening at the headline-price level.
I cross-checked with an RBF cost specification (which detects distributional changes, including in variance, not just mean shifts) and got identical break dates. The crisis period of 2021–2023 doesn’t appear as a new break, meaning the crisis is a high-variance episode within a longer regime, not a regime change in its own right.
Stage 5: Regime-specific cointegration. With the break structure established, I estimated the long-run relationship separately within each regime, including error-correction dynamics and the half-life of deviations.
This is where the substantive story emerged.

Three findings deserve close attention.
Finding 1: The pre-crisis era wasn’t one period; it was two
The 2015–2021 period appears to be a single stable era in the raw price charts. The data disagrees. There’s a sharp internal regime shift in February 2019 that splits it cleanly into two:
- 2015–2019 is the textbook stable equilibrium: β around 0.69, residuals mean-revert, and a half-life of about six weeks. This is what UK gas–electricity cointegration is “supposed” to look like.
- 2019–2021 still exhibits strong co-movement (R² = 0.83) but no stable equilibrium. The residuals drift instead of being corrected. Engle-Granger fails to reject the unit root in residuals (p > 0.6).
What was happening in early 2019 to cause this? Nothing dramatic at the headline level. But under the surface: accelerating coal-to-gas switching in UK generation, expanding renewable capacity, rising carbon prices (the UK Carbon Price Support rate), and changing capacity market dynamics. The conditions under which gas-fired plants set the marginal electricity price were shifting. The long-run statistical tie weakened first; the price-level consequences came two years later.
This matters because it changes what the crisis “did.” The crisis didn’t break a long-stable relationship. It hit a relationship that was already destabilising.
Finding 2: The crisis itself had the tightest gas–electricity relationship in the sample
Counterintuitively, the 2021–2023 crisis regime shows the strongest contemporaneous co-movement of any period: R² of 0.97. β rises sharply to 0.88, and the Durbin-Watson approaches 2 — meaning residuals are no longer persistent.
The mechanism is straightforward. During the crisis, gas-fired generation operated as the marginal price-setter at almost all hours, because renewables and other low-carbon sources couldn’t provide enough slack to ever displace gas at the margin. The marginal pricing mechanism transmitted gas prices to electricity prices more cleanly than in normal periods, when renewable surplus introduces slack into the relationship.
This is an interesting reframing. The crisis didn’t break the gas–electricity link. It intensified it. The damage to the long-run equilibrium happened before the crisis; the crisis itself made the contemporaneous transmission stronger, not weaker.
Finding 3: A new equilibrium has emerged at a fundamentally higher elasticity
The post-crisis regime (September 2023 onward) shows clean cointegration with β = 0.89, essentially the same as the crisis period. The half-life of deviations is roughly two weeks, the shortest in the sample.
A 1% rise in wholesale gas now produces approximately 0.9% rise in wholesale electricity. Pre-2019, the same rise would have produced about 0.5%. The long-run gas-to-electricity elasticity has nearly doubled across the sample.
With only 29 monthly observations in the post-crisis regime, this finding is provisional and should be revisited as more data accumulates. But the consistency between the crisis and post-crisis β values (0.88 vs 0.89) suggests the new equilibrium may be durable rather than transitional.

Why this matters in practice
These aren’t methodological curiosities. Each finding has direct implications.
For energy retailers and price forecasters. Pricing models calibrated on 2015–2020 data are using a β of roughly 0.6. The current value is closer to 0.9. A retailer’s hedge model is systematically underpricing the wholesale electricity response to gas movements by about a third. Over a 12-month horizon with realistic gas volatility, this is a material under-hedge.
For Ofgem’s default tariff cap. The wholesale electricity allowance in the cap depends on a forward-looking view of wholesale electricity prices, which in turn depends on the gas–electricity relationship. Calibrating against pre-2019 data will produce caps that systematically lag actual wholesale electricity outcomes when gas moves. Post-crisis calibration would produce more accurate caps.
For consumers. Gas market volatility now transmits to electricity bills almost twice as sharply as it did pre-2019. When gas spikes (or falls), electricity follows more aggressively. The buffer that renewables once provided — by occasionally displacing gas as the marginal price-setter — has narrowed in its damping effect on the long-run elasticity.
For policy analysts evaluating gas–electricity decoupling. Proposals to break or modify the gas–electricity link (such as those debated at the EU level during 2022–2023) start from an empirical baseline. That baseline has changed. The β-doubling means any intervention faces a tighter link than the analysis underpinning many of those proposals assumed.
For anyone forecasting UK energy prices. The shift in the relationship means historical-average models will systematically misforecast the response of electricity prices to gas movements. Regime-aware models that distinguish pre-2019, the transition period, and the post-crisis era will outperform single-equation models calibrated on a long history.
Methodological reflections
Two things I took away from the work, beyond the findings.
The most interesting result was the one I didn’t expect. I went into Notebook 05 expecting a clean “pre-crisis stable / crisis disrupted / post-crisis recovering” story. The first regime-specific test broke that narrative; the 2015–2021 “stable era” failed to cointegrate. Most of the value of the analysis came from investigating why, not from confirming what I expected. The Bai-Perron February 2019 break I’d initially absorbed into a broader regime turned out to be the entry point to the real story.
This is a methodological principle worth internalising. When the data refuses your priors, that’s where the project’s actual value lives. The investigation matters more than the original hypothesis.
Multiple testing methods earn their keep when they disagree. I ran five different testing approaches (Engle-Granger, Johansen, Zivot-Andrews, Gregory-Hansen, and Bai-Perron ), and they didn’t all agree. Zivot-Andrews said the break was in early to mid-2021. Gregory-Hansen identified November 2021. Bai-Perron said October 2015, February 2019 and September 2023.
For a moment, this looked like noise. It isn’t. Each test measures something different: Zivot-Andrews detects breaks in the data-generating process of individual series; Gregory-Hansen detects breaks in the cointegrating relationship; Bai-Perron detects mean shifts in residuals. The disagreement is informative; it tells you that the system has multiple kinds of structural change happening at different times, and each test is correctly identifying its own kind. Reconciling them is what produces the regime structure underneath.
Limitations
This analysis has clear limits, and any conclusions should be read with them in mind:
- Two-variable specification. The model treats gas and electricity prices in isolation. The actual relationship is conditioned by carbon prices, renewable generation share, capacity market payments, interconnector flows, and weather. A multivariate framework would partition variation more finely.
- Monthly frequency. Monthly data is appropriate for cointegration analysis but obscures within-month dynamics that matter for retail price-cap mechanics and high-frequency trading.
- GB-only scope. Continental European prices (TTF for gas, EEX for electricity) and interconnector dynamics aren’t modelled.
- Post-crisis sample. Regime 4 contains 29 monthly observations. Any conclusion about post-crisis equilibrium is provisional pending additional data.
These aren’t reasons to discount the findings — they’re the boundaries within which the findings hold.
Open project
The full analysis is on GitHub: **github.com/Nath-Mag/uk-energy-cointegration**
Nathaniel Magit is a data analyst based in Nottingham, UK. MSc Artificial Intelligence & Data Science (Hull). MSc Statistics (Ilorin). LinkedIn • GitHub • nathanielmagit@gmail.com
메타데이터
- post_id
- d6ca0033d28a
- slug
- the-uk-gas-electricity-relationship-broke-in-2019-nobody-noticed-until-2021-d6ca0033d28a
- url
- https://medium.com/@nathanielmagit/the-uk-gas-electricity-relationship-broke-in-2019-nobody-noticed-until-2021-d6ca0033d28a
- canonical_url
- https://medium.com/@nathanielmagit/the-uk-gas-electricity-relationship-broke-in-2019-nobody-noticed-until-2021-d6ca0033d28a
- author_url
- https://medium.com/@nathanielmagit
- status
- ok
- fetched_at
- 2026-06-09 15:37:30