Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Intervals that stretch and adapt
A forecast range should be wide when the situation is uncertain and narrow when it is calm. Plain conformal intervals use the same margin everywhere, so they are right on average but wrong in both places. One fix is to measure errors relative to how uncertain the model thinks it is, or to start from a model that already predicts a range and only correct it. Time series bring a second problem: the future may not look like the past. Adaptive conformal inference keeps a running score: after a miss it widens the intervals a little, after a hit it narrows them. The demo shows a series whose noise suddenly triples.
Battery state-of-charge and orbit-prediction errors grow with time since the last update and change when the operating regime changes. Adaptive conformal intervals keep their promised miss rate over a long mission even when the error behaviour drifts.
- 1. Plain split conformal regression intervals have…
- 2. Time series break conformal guarantees because…
- 3. After a miss, ACI makes the next interval…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Normalised (locally weighted) scores: s = |y − f(x)| / σ̂(x), with σ̂ a model of the error size; interval f(x) ± q σ̂(x) (Papadopoulos et al., 2008; Lei et al., 2018).
- CQR (Romano, Patterson and Candès, 2019): fit lower and upper quantile models l(x), h(x); score s = max(l(x) − y, y − h(x)); interval [l(x) − q, h(x) + q]. If the quantile models are good, q ≈ 0.
- Jackknife+ and CV+ (Barber, Candès, Ramdas and Tibshirani, 2021): use leave-one-out or K-fold models; coverage at least 1 − 2α in the worst case, about 1 − α in practice, without a separate calibration split.
- Not exchangeable: time series, covariate shift or drift. Weighted conformal (Tibshirani et al., 2019; Barber et al., 2023) gives calibration points weights, for example decaying with age; the coverage loss is bounded by how far the weighted data are from exchangeable.
- ACI (Gibbs and Candès, 2021): α_(t+1) = α_t + γ(α − err_t). The long-run miss rate satisfies |(1/T) Σ err_t − α| ≤ (max(α_1, 1 − α_1) + γ)/(γT) for any sequence, even adversarial. Variants: DtACI (several γ at once), conformal PID control (Angelopoulos, Candès and Tibshirani, 2023), EnbPI (Xu and Xie, 2021), SPCI.
- Scoring intervals: report coverage and width, or the interval (Winkler) score, which adds 2/α times any miss distance to the width.
- 1. CQR's score is…
- 2. ACI's guarantee is on…
- 3. Jackknife+'s worst-case coverage is…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Adaptive conformal intervals
Exercise 1.
- CQR intervals.
- Normalised (locally weighted) intervals.
- The ACI update.
- A weighted conformal quantile with mass at infinity for the test point.
Practice.
- For heteroscedastic regression, start with CQR on top of quantile gradient boosting or a quantile network; use normalised scores if you already have an error model.
- Check coverage in slices (by input region, by time), not only overall.
- For time series: recalibrate on a rolling window and wrap it in ACI; choose γ around 0.005 to 0.05 (larger reacts faster but gives jumpier intervals and occasional infinite ones).
- Report coverage, width and the interval score; plot rolling coverage.
- Libraries: MAPIE has CQR, jackknife+ and time-series classes (EnbPI, ACI), and crepes has normalised and Mondrian regressors. The snippet below does CQR by hand with scikit-learn.
import numpy as np
from sklearn.ensemble import HistGradientBoostingRegressor as HGB
alpha = 0.1
lo = HGB(loss="quantile", quantile=alpha / 2).fit(X_tr, y_tr)
hi = HGB(loss="quantile", quantile=1 - alpha / 2).fit(X_tr, y_tr)
s = np.maximum(lo.predict(X_cal) - y_cal, y_cal - hi.predict(X_cal)) # CQR scores
q = np.quantile(s, np.ceil((len(s) + 1) * (1 - alpha)) / len(s), method="higher")
interval = lo.predict(X_new) - q, hi.predict(X_new) + q- 1. A typical ACI step size γ is…
- 2. Coverage should be checked…
- 3. Quantile gradient boosting in scikit-learn uses…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why adaptive scores help. Split conformal guarantees P(Y ∈ C(X)) ≥ 1 − α averaged over X. With a constant-width interval, the miss rate is low where noise is small and high where it is large; they average to α. A normalised score |y − f(x)|/σ(x) is identically distributed across x when σ is the true error scale. Its single quantile then gives about 1 − α coverage in every region. CQR achieves the same when the quantile models are accurate.
ACI’s guarantee. Let α_(t+1) = α_t + γ(α − err_t). Summing over t gives α_(T+1) − α_1 = γ Σ (α − err_t), so the average miss rate differs from α by (α_1 − α_(T+1))/(γT). The iterate stays in [−γ, 1 + γ]: when α_t < 0 the set is infinite, so it cannot miss and α_t rises; when α_t > 1 the set is empty, so it misses and α_t falls. Hence the gap is at most (max(α_1, 1 − α_1) + γ)/(γT), whatever the data. It holds for any sequence, but it is about the long-run average only, and small γ makes the bound slow to bite.
Weighted conformal. If test and calibration points are not exchangeable, giving calibration point i weight w_i and putting the test point’s weight on +∞ bounds the coverage loss by Σ w_i d_TV(Z, Z^i)/(1 + Σ w_i). Here Z^i swaps the test point with point i (Barber et al., 2023). Recent points with large weights are close to exchangeable with the test point.
- 1. Normalised scores give equal coverage across x when…
- 2. ACI's α_t stays within…
- 3. Weighted conformal's coverage loss depends on…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.Do adaptive scores fix local coverage, and can ACI keep 90% coverage through a regime change?
History.
- H. Papadopoulos et al. (2008) normalised nonconformity; Y. Romano, E. Patterson and E. Candès (2019) CQR; R. F. Barber et al. (2021) jackknife+.
- I. Gibbs and E. Candès (2021) “Adaptive conformal inference under distribution shift”; C. Xu and Y. Xie (2021) EnbPI.
- R. F. Barber, E. Candès, A. Ramdas and R. Tibshirani (2023) “Conformal prediction beyond exchangeability”; A. Angelopoulos, E. Candès and R. Tibshirani (2023) conformal PID control.
Exercise 2. Two experiments at α = 0.1.
- Regression: y = 2 sin x + x/2 + noise with sd 0.1 + 0.4x, x ~ U(0, 5); 1000 training, 1000 calibration and 5000 test points. The base model is k-nearest neighbours (k = 60), which gives the mean, the mean absolute deviation σ̂ and the 5% and 95% quantiles. Calm region: x < 1.5; noisy region: x > 3.5.
- Time series: AR(1) y_t = 0.8 y_(t−1) + e_t with one-step forecasts 0.8 y_(t−1). The noise sd jumps from 1 to 3 at t = 1000, after which a slow drift appears. Intervals come from the first 300 residuals (fixed), the last 200 residuals (rolling), or ACI on the rolling window with γ = 0.005, all evaluated from t = 300 to 2000.
| regression | coverage | mean width | calm region | noisy region |
|---|---|---|---|---|
| split, absolute residual | 0.888 | 4.10 | 0.999 | 0.731 |
| normalised | 0.906 | 3.72 | 0.924 | 0.893 |
| CQR | 0.905 | 3.71 | 0.918 | 0.894 |
| time series | coverage | coverage in 200 steps after the change | median width |
|---|---|---|---|
| fixed calibration | 0.632 | 0.455 | 3.33 |
| rolling window | 0.878 | 0.730 | 9.22 |
| ACI on rolling window | 0.898 | 0.870 | 9.53 |
- Constant width failed locally: split conformal covered calm inputs 99.9% of the time and noisy ones 73.1%. Normalised and CQR intervals brought both near 90% and were about 10% narrower. Split’s overall 0.888 is ordinary calibration-set noise (the guarantee is on average).
- Stale calibration failed badly: intervals fitted before the change covered only 45.5% just after it.
- ACI helped most at the change: 87.0% just after it against 73.0% for the rolling window alone, and 89.8% overall. The cost was slightly wider intervals. The formal bound for γ = 0.005 over 1700 steps is only ±0.106, so the closeness to 0.90 came from the data rather than the worst-case guarantee.
- Seeds 1 and 2: split noisy-region coverage 0.782 and 0.773; CQR 0.870 and 0.867; ACI overall 0.901 and 0.902 and after the change 0.855 and 0.840; rolling 0.881 and 0.878.
Conformal regression and forecasting in AI, robotics and aerospace
- Motion planning: conformal bounds on predicted pedestrian or vehicle trajectories, with ACI to cope with changing behaviour, give planners guaranteed long-run collision-risk budgets.
- Space weather and orbit prediction: forecast intervals for drag and conjunction screening must widen after solar storms; ACI on rolling residuals does this automatically.
- Energy and load forecasting: conformalised quantile forecasts are standard in competitions and grid operation.
References
- Y. Romano, E. Patterson and E. Candès (2019). “Conformalized quantile regression.” NeurIPS.
- R. F. Barber, E. Candès, A. Ramdas and R. J. Tibshirani (2021). “Predictive inference with the jackknife+.” Annals of Statistics.
- I. Gibbs and E. Candès (2021). “Adaptive conformal inference under distribution shift.” NeurIPS.
- R. F. Barber, E. Candès, A. Ramdas and R. J. Tibshirani (2023). “Conformal prediction beyond exchangeability.” Annals of Statistics.
- A. Angelopoulos, E. Candès and R. Tibshirani (2023). “Conformal PID control for time series prediction.” NeurIPS.