5 forecasting engines, multi-factor regression, backtested. Server-side, sub-second. In your Excel cell or Python script.
Real forecasting problems that energy analysts face every week.
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)
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")
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")
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.
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")
Strong seasonal pattern — builds in winter, draws in summer driving season. Prophet captures this automatically. US holidays (July 4th, Memorial Day) built in.
=ES.Prophet("PET.WGTSTUS1.W", 4, "US")
Textbook seasonal — injection season (Apr–Oct), withdrawal (Nov–Mar). Prophet handles the asymmetric cycle natively. Currently in late withdrawal, stocks at 1,883 Bcf.
=ES.Prophet("NG.NW2_EPG0_SWO_R48_BCF.W", 4, "US")
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.
=ES.ARIMA("PET.WCRFPUS2.W", 8)
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", , "2018-01-01", , 5)
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)
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")
Different strengths for different data. Run all, compare, decide.
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.
Trend
Piecewise linear or logistic growth. Changepoints detected automatically.
Seasonality
Yearly, weekly, daily patterns modelled as Fourier series.
Holidays
US federal holidays, EIA release schedule gaps handled natively.
Forecast
Sum of components + uncertainty intervals. Bands widen naturally.
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.
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")
3-2-1, gasoline, diesel refining margins. Defaults to WTI / Gulf gasoline / NY heating oil. Series tables of historical crack.
=ES.CrackSpread("321")
Track regime shifts in co-movement. Configurable window, min/max/current correlation.
=ES.RollingCorr(A, B, 90)
Significant period-over-period changes, ranked by z-score, flags outliers against recent history.
=ES.Changes(series_range)
Supply & Demand model with Theta forecasts, pinned scenarios, implied stock change.
=ES.SndBalance(supply, demand)
Regime change detection with dates, shift magnitudes, segment means. Pelt algorithm, configurable sensitivity.
=ES.Breakpoints("PET.RWTC.D")
Rolling + GARCH(1,1) conditional volatility, annualised. Risk metrics, VaR inputs.
=ES.Volatility("PET.RWTC.D", 20)
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.
All forecasting functions accept optional start/end dates to control the fitting window.
| Function | Parameters | Returns |
|---|---|---|
ES.Forecast |
series, target, horizon, method, engine, start, endmethod: 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, endholidays: 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, methodmethod: 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, methodmethod: bk (Baxter-King) or cf (Christiano-Fitzgerald) |
Cycle + trend at specified frequency band. |
Real WTI data. Real predictors. 11 engine combinations tested across daily, weekly, and monthly frequencies — in both stable and crisis markets.
| Frequency | Stable Market | Crisis (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. |
| Rank | Engine | Oct | Nov | Dec | RMSE | MAPE |
|---|---|---|---|---|---|---|
| Actual | $72.0 | $70.0 | $70.1 | |||
| 1 | Theta | $70.4 | $70.6 | $70.8 | $1.05 | 1.4% |
| 2 | ARIMA | $68.8 | $68.8 | $68.8 | $2.07 | 2.6% |
| 3 | XGBoost+Prophet | $79.7 | $80.9 | $79.5 | $9.45 | 13.3% |
| 4 | XGBoost+ARIMA | $80.3 | $80.1 | $80.0 | $9.46 | 13.4% |
| 7 | Prophet | $86.7 | $83.9 | $82.3 | $13.66 | 19.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.
| Engine | Jan | Feb | Mar (Iran) | Notes |
|---|---|---|---|---|
| Actual | $60.04 | $64.51 | $90.84 | Iran spike in March |
| Theta | $59.97 | $60.32 | $59.48 | Jan: 7 cents off! Missed Iran. |
| ARIMA | $57.37 | $57.37 | $57.37 | Flat. Missed everything. |
| Prophet | $80.32 | $81.39 | $81.23 | Overshot 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.
ES.Forecast(xgboost) with crude stocks, gasoline, production. Best all-rounder: RMSE $2.7 in crisis, $3.7 in stable.
ES.Prophet("US") for seasonal inputs (stocks, demand). ES.ARIMA() for trends (production). Feed into your S&D balance.
ES.Theta() — hardest to beat at monthly. $1.05 RMSE (1.4%). If you can't beat Theta, simplify your model.
Sign up, get an API key, and run your first forecast in Excel or Python. All 77 functions included.
Sign Up Free