Interval forecasters from the series alone: naive changes, CP-TSD, Laplace¶
Three one-step interval forecasters that read only the series: no features, no separate model to train.
| Use it when | You forecast one series one step at a time and want a strong reference, or a decomposition-based interval. |
| Guarantee | None in finite samples. CPTSD: each part's interval is split-conformal, but the sum of three intervals has no guarantee. NaiveDiffInterval and LaplaceSkater are references, not conformal methods. |
| In the library | NaiveDiffInterval, CPTSD, LaplaceSkater |
| Source | Naive forecast; Prinzhorn, Nijdam, van der Linden and Timans (2024); Cotton, skaters (MIT licence) |
| Example needs | pyconformal (LaplaceSkater also needs pip install skaters) |
Why these are here¶
The study of conformal prediction for time-series forecasting
(Manokhin, Nurmatov, Sreenivas and Liang 2026, doi:10.5281/zenodo.24715782)
ranked 66 configurations on 50,143 series. These three are in its places 21 to 30, next to split conformal
prediction (22nd, rcWIS 1 by definition): NaiveDiffInterval (21st, rcWIS 0.998), Laplace_skaters (24th, 1.065) and
CP_TSD (30th, 1.218). Each was checked against
the study's code on 13 series at 11 levels with outcomes revealed in batches of 10: the same intervals to 1e-12
(NaiveDiffInterval, LaplaceSkater) and 4e-11 (CPTSD, STL and ridge rounding).
The study's original code for CP_TSD had one fault (since corrected): inside a batch, each step rebuilt its
history from that row's own lag columns, so on series with fewer than 10 lags (quarterly, business-day, daily and short
series) the last steps of a batch decomposed a history with values missing. CPTSD always used every value before the
step, and gives the corrected code's intervals to 4e-11. The study's published CP_TSD score (30th) predates the fix.
The protocol, for all three¶
fit(history); predict_interval(alpha) for the next value; update(new_values); and
run(future, alpha, batch_size), which issues each interval before its value is seen. In a batch, each forecast uses
every value before it, while what the method learns from its errors is updated when the batch is revealed.
Minimal examples¶
Copy, paste, run.
import numpy as np
rng = np.random.default_rng(0)
t = np.arange(1500)
y = 10 + 2 * np.sin(2 * np.pi * t / 24) + np.cumsum(rng.normal(0, 0.05, t.size)) + rng.normal(0, 0.5, t.size)
history, future = y[:1200], y[1200:]
The naive forecast with an interval from past one-step changes:
from pyconformal import NaiveDiffInterval
m = NaiveDiffInterval(alpha=0.1).fit(history)
print("next value", m.predict(), "interval", m.predict_interval())
res = NaiveDiffInterval(alpha=0.1).fit(history).run(future, batch_size=10)
print("coverage", round(res.coverage, 3), res.intervals.shape) # (300, 2)
Conformal prediction with time-series decomposition, at several levels at once:
from pyconformal import CPTSD
m = CPTSD().fit(history)
res = m.run(future, alpha=[0.05, 0.1, 0.2], batch_size=10)
print("season found", m.period_, "coverage", np.round(res.coverage, 3), res.intervals.shape) # (300, 2, 3)
Peter Cotton's laplace forecaster under the same protocol:
from importlib.util import find_spec
if find_spec("skaters"): # pip install skaters
from pyconformal import LaplaceSkater
res = LaplaceSkater(alpha=0.1).fit(history[-400:]).run(future[:50], batch_size=10)
print("Laplace coverage", round(res.coverage, 3))
Speed¶
Full protocol (11 levels, batches of 10), the study's code against pyconformal, same intervals; see the speed table for all ten methods of places 21 to 30.
More¶
- Methods ranked 31st to 66th in the study: places 31 to 66
- The study's protocol and scoring: evaluation
- STL itself: STL and MSTL
- Full argument list: API reference