Energy Market Forecasts

5 forecasting engines, multi-factor regression, backtested. Server-side, sub-second. In your Excel cell or Python script.

Facebook Prophet Auto ARIMA Theta (M3 winner) XGBoost ES.Forecast (multi-factor) Holt-Winters ETS ES.Run (your models) Confidence Intervals

Use cases

Real forecasting problems that energy analysts face every week.

XGBOOST + ARIMA

Multi-Factor WTI Forecast

XGBoost captures non-linear relationships between crude stocks, production, and gasoline — R² = 0.97 vs 0.47 for linear regression. ARIMA forecasts each predictor forward. The combination was top 3 in both stable and crisis markets in our backtest.

Fundamentals say $59–$66. Market is at $104 (Iran premium). The $40 gap between model and market is the geopolitical risk premium — quantified.

=ES.Forecast("PET.RWTC.D, PET.WCESTUS1.W, PET.WGTSTUS1.W, PET.WCRFPUS2.W", "PET.RWTC.D", 12)
// ES.Forecast with XGBoost — WTI from fundamentals
R² = 0.973   method: xgboost   obs: 314

Feature importances:
  PET.WCESTUS1.W  57.0%  crude stocks (dominant)
  PET.WCRFPUS2.W  29.2%  refinery production
  PET.WGTSTUS1.W  13.8%  gasoline stocks

Backtest RMSE:
  Stable (2025)  $3.7  #2 overall
  Crisis (2026)  $2.7  #1 overall

// Only engine in top 3 of both periods.
PROPHET FORECAST

Weekly Inventory Forecast

Every Wednesday, EIA publishes US crude oil stocks. The market moves on the surprise — the difference between expected and actual. Prophet forecasts next week's number on Monday, before the data is released. US holidays built in.

Backtest over 2 years of history. Track accuracy: RMSE, MAPE, directional accuracy. See where the model nailed it — and where the market surprised everyone.

=ES.Prophet("PET.WCESTUS1.W", 4, "US")
// ES.Prophet — US Crude Oil Stocks (thousand barrels), 4-week forecast
Period        Actual         Forecast     CI Low     CI High
2026-03-13   449,259
2026-03-20   456,185
2026-03-27   461,636
2026-03-29               434,828     399,214    472,435
2026-04-05               436,346     401,415    473,413
2026-04-12               437,660     404,370    475,019
2026-04-19               439,008     402,513    472,234

// Prophet + US holidays. Seasonal patterns + trend decomposition.
XGBOOST FORECAST

WTI During Iran Crisis

Iran tensions + Strait of Hormuz concerns pushed WTI from $67 to $104 in weeks. Standalone ARIMA just extrapolated $103 (useless). XGBoost sees the fundamentals: stocks rising, production steady — forecasts $93.72 with tighter bands.

Backtested RMSE $2.7 in crisis vs ARIMA's $4.6. XGBoost captures non-linear interactions between supply factors that linear models miss entirely.

=ES.Forecast("PET.RWTC.D, PET.WCESTUS1.W, PET.WGTSTUS1.W, PET.WCRFPUS2.W", "PET.RWTC.D", 12, "xgboost", , "2020-01-01")
// ES.Forecast(xgboost) — WTI from stocks + production, Iran crisis
R² = 0.973   method: xgboost

Observed:
2026-03-06   $90.77
2026-03-13   $98.48
2026-03-20   $98.71
2026-03-27   $101.26

Forecast:
2026-04-03   $93.72   [$87.67 – $99.77]
2026-04-10   $93.72   [$87.37 – $100.07]
2026-04-17   $93.72   [$87.09 – $100.35]
2026-04-24   $93.72   [$86.82 – $100.62]

// Fundamentals pull price down from $104 → $93.
// ARIMA would just say $103. XGBoost sees the supply data.
BACKTESTED

Prophet vs ARIMA vs XGBoost vs Theta

We backtested 11 combinations — 4 regression methods (ElasticNet, Ridge, OLS, XGBoost) × 2 predictor engines (ARIMA, Prophet) plus 3 univariate (ARIMA, Prophet, Theta) — on WTI with crude stocks, gasoline, and production as predictors.

  • Stable market (Jan–Feb 2025): Theta wins RMSE $3.5, then XGBoost+ARIMA $3.7
  • Crisis (Jan 2026): XGBoost+ARIMA wins RMSE $2.7, then Prophet $2.9
  • XGBoost+ARIMA is the only engine in the top 3 of both periods
  • Linear regression methods (ElasticNet/Ridge/OLS) all overshot by $12–15 in crisis
  • Theta — the M3 competition winner — is the best pure benchmark: $3.5 stable, $4.5 crisis
// STABLE: train 2020–2024, test Jan–Feb 2025
// Actual: mean $74.53

 1. Theta                RMSE $3.5  MAPE 3.5%  M3 winner
 2. XGBoost+ARIMA       RMSE $3.7  MAPE 4.1%
 3. ARIMA                RMSE $3.7  MAPE 3.6%
 4. Prophet              RMSE $4.5  MAPE 4.9%
 ...ElasticNet+ARIMA    RMSE $10.0 (linear overshoot)

────────────────────────────────────────

// CRISIS: train 2020–2025, test Jan 2026 (Iran)
// Actual: mean $61.20

 1. XGBoost+ARIMA       RMSE $2.7  MAPE 3.5%  BEST
 2. Prophet              RMSE $2.9  MAPE 3.9%
 3. Theta                RMSE $4.5  MAPE 6.1%
 4. ARIMA                RMSE $4.6  MAPE 6.2%
 ...ElasticNet+ARIMA    RMSE $12.6 (linear overshoot)

// XGBoost+ARIMA: top 3 in BOTH periods. The all-rounder.
MULTI-FACTOR

ES.Forecast — Fundamentals-Based Price Forecast

A real analyst doesn't forecast WTI from WTI. They use crude stocks, refinery production, and gasoline stocks as predictors. ES.Forecast fits a regression, auto-forecasts each predictor with ARIMA, then projects the target.

ElasticNet R² = 0.47, XGBoost R² = 0.97. Non-linear models capture what linear ones miss. ES.Forecast runs both ARIMA and Prophet to forecast the predictors, giving two views. Prophet sees the seasonal stock drawdown — ARIMA misses it.

=ES.Forecast("PET.RWTC.D, PET.WCESTUS1.W, PET.WGTSTUS1.W, PET.WCRFPUS2.W", "PET.RWTC.D", 5, , , "2020-01-01")
// ES.Forecast — WTI from crude stocks + gasoline + production
R² = 0.467   method: elasticnet   obs: 314

Coefficients (standardised):
  PET.WCESTUS1.W  -11.86  crude stocks (more = lower price)
  PET.WCRFPUS2.W   -3.21  refinery production
  PET.WGTSTUS1.W   -3.03  gasoline stocks

Same model, two predictor engines:
ARIMA predictors    → WTI $58.65  flat trend extrapolation
Prophet predictors  → WTI $65.97  sees seasonal stock drawdown

$7 gap = Prophet sees summer demand pulling stocks down.
Both say fundamentals below $66. Market at $104 = Iran premium.

2026-04-03   $58.65 / $65.97
2026-04-10   $58.51 / $65.91
2026-04-17   $58.39 / $65.84
2026-04-24   $58.27 / $65.77
2026-05-01   $58.16 / $65.70
PROPHET — SEASONAL

Gasoline Stocks

Strong seasonal pattern — builds in winter, draws in summer driving season. Prophet captures this automatically. US holidays (July 4th, Memorial Day) built in.

2026-03-20  241,447
2026-03-27  240,861
2026-04-05  226,799  [212,817 – 240,005]
2026-04-12  225,484  [210,596 – 238,955]
2026-04-19  224,919  [210,406 – 239,814]
=ES.Prophet("PET.WGTSTUS1.W", 4, "US")
PROPHET — SEASONAL

Natural Gas Stocks

Textbook seasonal — injection season (Apr–Oct), withdrawal (Nov–Mar). Prophet handles the asymmetric cycle natively. Currently in late withdrawal, stocks at 1,883 Bcf.

2026-03-06  1,848 Bcf
2026-03-13  1,883 Bcf
2026-03-22  2,043 Bcf  [1,675 – 2,430]
2026-03-29  2,043 Bcf  [1,662 – 2,461]
2026-04-05  2,057 Bcf  [1,666 – 2,442]
=ES.Prophet("NG.NW2_EPG0_SWO_R48_BCF.W", 4, "US")
ARIMA — TREND

US Crude Production

Slow-moving trend, small weekly changes. ARIMA(2,1,1) catches the drift — production steady at 13.66M bbl/d. Narrow confidence bands reflect low volatility. This is what ARIMA is built for.

2026-03-20  13,657
2026-03-27  13,657
2026-04-03  13,661  [13,413 – 13,908]
2026-04-10  13,661  [13,353 – 13,969]
2026-04-17  13,661  [13,319 – 14,003]
=ES.ARIMA("PET.WCRFPUS2.W", 8)
REGIME

Price Regime Detection

One formula, one parameter. =ES.Breakpoints("PET.RWTC.D", , "2018-01-01", , 5) returns every significant regime change in WTI since 2018 — with exact dates, mean price before and after, and the size of the shift.

// ES.Breakpoints — PET.RWTC.D (WTI Cushing daily spot), min_shift=$5

2018-11-07  -7.4  OPEC overproduction fears
2019-05-24  -6.2  Trade war escalation
2020-03-12 -16.9  COVID crash ($41.9 → $24.9)
2020-05-15  +9.2  Recovery begins
2021-12-27  +5.5  Omicron fades, demand returns
2022-02-28 +17.7  Russia/Ukraine ($92.4 → $110.1)
2022-07-05  -7.9  Recession fears
2022-11-23  -6.8  China lockdowns
2023-04-28  -6.1  Banking crisis
2024-08-29  -5.5  China slowdown
... 14 breakpoints total, filtered by min_shift=$5
=ES.Breakpoints("PET.RWTC.D", , "2018-01-01", , 5)
RISK

Volatility Forecasting

GARCH estimates conditional volatility from daily returns. MIDAS uses daily data to forecast monthly vol. Combine with Prophet for a full risk picture — level forecast + volatility bands.

=ES.Volatility("PET.RWTC.D", 20)
CROSS-MARKET

Spread Forecasting

WTI-Brent spread, crack spreads, time spreads. Forecast each leg independently, or model the spread directly. Cointegration test tells you if the relationship is stable enough to forecast.

=ES.Cointegration("PET.RWTC.D, PET.RBRTE.D")

Five forecasting engines

Different strengths for different data. Run all, compare, decide.

Prophet

Facebook / Meta · Additive decomposition · Stan backend
  • Automatic trend changepoint detection
  • Yearly, weekly, daily seasonality
  • Holiday effects (US, UK, EU)
  • Robust to missing data and outliers
  • Interpretable components (trend + seasonal + holidays)
  • Best for: weekly/monthly series with strong seasonality

Auto ARIMA

statsmodels · 9 candidate models · AIC selection
  • Automatic order selection (p,d,q)
  • Reacts quickly to recent trends
  • Statistically rigorous confidence intervals
  • No external dependencies (pure statsmodels)
  • Lightweight — milliseconds per forecast
  • Best for: daily prices, short-term forecasts

Theta

M3 competition winner · statsmodels · deseasonalised
  • Won the M3 forecasting competition — beat ARIMA, ETS, and neural nets
  • Simple: two theta lines (amplified + dampened trend), combined
  • Fast and robust — surprisingly hard to beat as a benchmark
  • Best for: benchmark — compare your other forecasts against this

XGBoost

Gradient boosted trees · scikit-learn · in ES.Forecast
  • Non-linear — captures feature interactions that linear models miss
  • R² = 0.97 on WTI vs 0.47 for ElasticNet — 2× more explanatory power
  • Feature importances: crude stocks 57%, production 29%, gasoline 14%
  • Best for: multi-factor models with complex relationships
Also available: ES.Smooth (Holt-Winters / ETS exponential smoothing) for simple, fast forecasts with automatic model selection.

How it works

Prophet decomposes your time series into interpretable components. The forecast is the sum of trend + seasonality + holiday effects. Uncertainty comes from trend changepoints and observation noise.

1

Trend
Piecewise linear or logistic growth. Changepoints detected automatically.

2

Seasonality
Yearly, weekly, daily patterns modelled as Fourier series.

3

Holidays
US federal holidays, EIA release schedule gaps handled natively.

4

Forecast
Sum of components + uncertainty intervals. Bands widen naturally.

Beyond forecasting

Forecasts are just one tool. EnergyScope runs the full analyst workflow server-side — spreads, crack margins, positioning, structural breaks — all returned as Arrow tables in under a second.

Spread analysis

Pair spread with z-score, percentile, half-life of mean reversion, rolling z. Built for pair trades and term structure.

=ES.Spread("PET.RWTC.D", "PET.RBRTE.D")

Crack spreads

3-2-1, gasoline, diesel refining margins. Defaults to WTI / Gulf gasoline / NY heating oil. Series tables of historical crack.

=ES.CrackSpread("321")

Rolling correlation

Track regime shifts in co-movement. Configurable window, min/max/current correlation.

=ES.RollingCorr(A, B, 90)

Change detection

Significant period-over-period changes, ranked by z-score, flags outliers against recent history.

=ES.Changes(series_range)

S&D balance

Supply & Demand model with Theta forecasts, pinned scenarios, implied stock change.

=ES.SndBalance(supply, demand)

Structural breaks

Regime change detection with dates, shift magnitudes, segment means. Pelt algorithm, configurable sensitivity.

=ES.Breakpoints("PET.RWTC.D")

Volatility

Rolling + GARCH(1,1) conditional volatility, annualised. Risk metrics, VaR inputs.

=ES.Volatility("PET.RWTC.D", 20)

Positioning & curves

CFTC Commitments of Traders (managed money net) + ICE Brent forward curve (M1–M12 constant maturity).

=ES.Get("ICE.BRENT.M1.D, CFTC.WTI.MM_Net")

Plus 25 more analytics tools — see the full catalog. All callable from Excel, Python, or AI agents via MCP.

In Excel and Python

Excel

// Multi-factor: WTI from stocks + production (XGBoost default)
=ES.Forecast("PET.RWTC.D, PET.WCESTUS1.W, PET.WCRFPUS2.W",
  "PET.RWTC.D", 12)

// Prophet with US holidays
=ES.Prophet("PET.WCESTUS1.W", 12, "US")

// Theta benchmark (M3 winner)
=ES.Theta("PET.RWTC.D", 30)

// ARIMA — fast, short-term
=ES.ARIMA("PET.RWTC.D", 30)

Python

# Prophet forecast via Flight action
import energyscope as es

client = es.Client("YOUR_API_KEY")

# 90-day WTI forecast
fc = client.action("prophet", {
  "series": "PET.RWTC.D",
  "horizon": 90,
})

print(fc["forecast"][:5])

Full parameters

All forecasting functions accept optional start/end dates to control the fitting window.

FunctionParametersReturns
ES.Forecast series, target, horizon, method, engine, start, end
method: xgboost (default)/elasticnet/ridge/ols · engine: both (default), arima, prophet
Multi-factor regression forecast. Fits target ~ predictors, auto-forecasts predictors with ARIMA and/or Prophet. Shows both engines side-by-side with coefficients and R².
ES.Prophet series, horizon, holidays, seasonality, changepoints, growth, start, end
holidays: US, UK, DE, FR · seasonality: additive/multiplicative · changepoints: 0-1 · growth: linear/logistic
Forecast + CI + trend/weekly/yearly components. Changepoint dates detected. Country holidays built in.
ES.Theta series, horizon, start, end Theta method (M3 winner). Deseasonalised, two theta lines combined. Fast, robust benchmark.
ES.ARIMA series, horizon, start, end Auto ARIMA forecast + CI. Reports model order (p,d,q) and AIC.
ES.Smooth series, horizon, method
method: single, double, holt-winters, ets
Smoothed historical values + forecast. AIC for model selection.
ES.Seasonality series, start, end Decomposition: observed, trend, seasonal, residual per period.
ES.Volatility series, window, start, end Rolling vol + GARCH(1,1) conditional vol, annualised.
ES.BandPass series, low, high, method
method: bk (Baxter-King) or cf (Christiano-Fitzgerald)
Cycle + trend at specified frequency band.

Backtest results

Real WTI data. Real predictors. 11 engine combinations tested across daily, weekly, and monthly frequencies — in both stable and crisis markets.

Best engine by frequency and market condition

FrequencyStable MarketCrisis (Iran/Hormuz)Recommendation
Daily
30 business days
Theta $3.5 XGBoost+ARIMA $2.7 XGBoost+ARIMA — only engine in top 3 of both periods
Weekly
12 weeks (≈3 months)
XGBoost+ARIMA $3.54 Prophet $13.39 Both — XGBoost for level, Prophet for trajectory
Monthly
3 months
Theta $1.05 Theta $0.07 (Jan!) Theta — simple beats complex. Nailed January to 7 cents.

Monthly WTI — Oct–Dec 2024 (stable)

RankEngineOctNovDecRMSEMAPE
Actual$72.0$70.0$70.1
1Theta$70.4$70.6$70.8$1.051.4%
2ARIMA$68.8$68.8$68.8$2.072.6%
3XGBoost+Prophet$79.7$80.9$79.5$9.4513.3%
4XGBoost+ARIMA$80.3$80.1$80.0$9.4613.4%
7Prophet$86.7$83.9$82.3$13.6619.3%

Theta: 1.4% error over 3 months. XGBoost overfit (R²=1.00 in training) and overshot by $10. At monthly frequency, simple beats complex.

Monthly WTI — Jan–Mar 2026 (Iran crisis)

EngineJanFebMar (Iran)Notes
Actual$60.04$64.51$90.84Iran spike in March
Theta$59.97$60.32$59.48Jan: 7 cents off! Missed Iran.
ARIMA$57.37$57.37$57.37Flat. Missed everything.
Prophet$80.32$81.39$81.23Overshot Jan/Feb. Closest to Mar ($9.61 err).

No model predicted the Iran spike ($90.84). Theta nailed month 1. Prophet was accidentally closest to month 3 because it was already high. The right strategy: Theta for months 1-2, monitor breakpoints, widen bands when geopolitics change.

Trading desk recommendations

Daily Risk

ES.Forecast(xgboost) with crude stocks, gasoline, production. Best all-rounder: RMSE $2.7 in crisis, $3.7 in stable.

Weekly S&D Inputs

ES.Prophet("US") for seasonal inputs (stocks, demand). ES.ARIMA() for trends (production). Feed into your S&D balance.

Monthly Budget

ES.Theta() — hardest to beat at monthly. $1.05 RMSE (1.4%). If you can't beat Theta, simplify your model.

Try it now

Sign up, get an API key, and run your first forecast in Excel or Python. All 77 functions included.

Sign Up Free

Excel Add-in · Data Coverage · Contact