Part V: Uncertainty, Online, and Adaptive Learning
Chapter 19: Probabilistic Forecasting and Uncertainty Quantification

Probabilistic Forecasting and Uncertainty Quantification

From point predictions to honest distributions: scoring rules, quantiles, Bayesian and conformal intervals, and decision-aware evaluation.

"For eighteen chapters they trained me to be precise, and I learned to be precise the way a liar learns to be fluent. Ask me for tomorrow's demand and I say 4,217, exactly, every time, with the flat unwavering confidence of a machine that has never once been asked how sure it is. And nobody ever did ask, until the day a planner ordered against my 4,217 and the real number came in at 5,900, and the shelves emptied, and the question finally arrived: not what is your forecast, but how wide is the cloud your forecast sits inside, and where, honestly, would you bet. I had no answer. I had spent eighteen chapters learning to name the center of a distribution while pretending the distribution did not exist. Now they want the whole shape, the spread, the tails, and a number that gets worse, not better, when I am confidently wrong. They want me to be calibrated, which is a polite way of saying they want me to stop lying."

A Mildly Overfit Forecaster, Confident About Next Tuesday

Chapter Overview

Every forecaster in this book so far has handed you a single number, a point: the predicted value at the next step, the most likely demand, the expected price. That number is, almost always, wrong, and the only honest question is by how much and in which direction. A point forecast that arrives without a measure of its own uncertainty is not a humble forecast, it is a dangerous one, because the decision made downstream of it, how much inventory to stock, how much capital to hedge, whether to admit the patient, treats the point as if it were certain. The cost of being wrong is rarely symmetric and rarely small, and a model that cannot say "the true value is very likely between 5,200 and 6,400" while pointing at 4,217 has withheld exactly the information the decision needed. This chapter, which opens Part V, is about replacing the point with a distribution: forecasting not a number but the full shape of plausible futures, and grading that distribution by how honest it turns out to be.

The shift from point to distribution brings its own toolkit, and the chapter builds it piece by piece. It begins by distinguishing a point forecast from a probabilistic one and asking the deceptively hard question of how you even score a predicted distribution against a single realized outcome, which leads to proper scoring rules, the continuous ranked probability score (CRPS) and the logarithmic score chief among them, rules constructed so that a model cannot improve its score by hedging or lying about its own uncertainty. Scoring in hand, the chapter separates the two virtues a probabilistic forecast must have: calibration, that the stated probabilities match observed frequencies, and sharpness, that the intervals are as tight as calibration permits, the principle that you should "maximize sharpness subject to calibration." It then surveys the machinery for producing distributions: quantile and distributional regression heads that learn the spread directly, including the pinball loss and the distributional output of deep forecasters like DeepAR; Bayesian methods, deep ensembles, and Monte Carlo dropout that turn model uncertainty into predictive uncertainty; and Gaussian processes, which give a closed-form posterior over functions and have been a workhorse of principled time-series uncertainty for decades.

The chapter then reaches its distribution-free highlight, conformal prediction, which deserves special billing. Where Bayesian and quantile methods produce intervals whose validity rests on the model being roughly right, conformal prediction produces intervals with a finite-sample coverage guarantee that holds no matter what model you wrap it around, requiring only an exchangeability assumption, and the chapter treats the variants engineered specifically for the temporal setting where that assumption is strained: EnbPI, adaptive conformal inference, and their relatives that keep coverage honest under distribution shift. It is the rare technique that hands you a guarantee rather than a hope.

The closing movement delivers the chapter's punchline: a forecast distribution is not an end in itself but an input to a decision, and the right way to grade forecasts is by the quality of the decisions they enable. A model with a slightly worse CRPS that leads to a much cheaper inventory policy is the better model for that use, and decision-aware evaluation makes this explicit, scoring the realized cost of acting on the forecast rather than the forecast's distance from the truth in the abstract. The running finance thread of the book returns here as a returns or volatility series whose tail risk is exactly what a point forecast hides and a calibrated predictive distribution reveals. The lesson of the chapter, and of the part it opens, is that a temporal prediction is worth precisely as much as the uncertainty you can honestly attach to it, and not one decision more.

Prerequisites

This chapter assumes you can already produce a point forecast and now want to put a distribution around it. From the classical forecasting of Part II, especially Chapter 5: Univariate Forecasting Models, you need the basic forecasting setup, the rolling-origin evaluation, and the notion of a forecast horizon, because every uncertainty method here wraps around or extends a point forecaster of the kind that chapter built. From the deep forecasting of Part III, especially Chapter 14: Deep Forecasting Architectures and its treatment of DeepAR, you need the idea of a probabilistic forecasting head that emits distribution parameters rather than a single value, since the quantile and distributional methods of this chapter are the principled version of what those architectures already gesture at. The mathematical spine of the chapter is probability: densities, quantiles, the exponential and Gaussian families, conditional distributions, and the hazard and coverage notions that scoring rules and conformal prediction are built on. Readers wanting to refresh any of this will find it in Appendix B: Probability and Statistics Refresher, reachable along with every chapter through the Table of Contents.

Remember the Chapter as One Sentence

If you keep one idea from this chapter, keep this: a forecast should be a calibrated probability distribution, not a point, and it should be graded by a proper scoring rule and ultimately by the quality of the decisions it enables, not by its distance from the truth alone. Proper scoring rules (CRPS, log score) make honesty about uncertainty the optimal strategy; the calibration-and-sharpness principle says maximize sharpness subject to calibration; quantile heads, Bayesian methods, ensembles, and Gaussian processes are different machines for producing the distribution; conformal prediction wraps any of them in a distribution-free finite-sample coverage guarantee; and decision-aware evaluation closes the loop by scoring the realized cost of acting on the forecast. The point forecast was only ever the center of a cloud the model refused to draw.

Chapter Roadmap

Once you have worked through the six sections, the Hands-On Lab below chains them into a single experiment on one forecasting task. Each lab step maps to a section, so the lab doubles as a review: by the time you finish you will have added quantile intervals from Section 19.3 and conformal intervals from Section 19.5 to a point forecaster, checked their calibration and sharpness with the tools of Section 19.2, and driven a decision and scored its realized cost in the spirit of Section 19.6, all from the point-versus-distribution starting line that Section 19.1 draws.

Hands-On Lab: Calibrated and Useful

Duration: about 90 to 120 minutes Difficulty: Intermediate

Objective

Take an ordinary point forecaster and make it honest, then make it useful, in that order. You will start from a trained point model on a forecasting task and add two kinds of predictive interval around it: a quantile interval learned directly with the pinball loss of Section 19.3, and a distribution-free conformal interval wrapped around the same point model using the split conformal and time-series methods of Section 19.5. You will then grade those intervals on the two axes that matter, calibration and sharpness, using the probability integral transform (PIT) and empirical coverage to check that the stated probabilities match observed frequencies, and CRPS and the pinball score to measure how tight the honest intervals are, exactly the scoring discipline of Section 19.2. Finally you will stop treating the forecast as the deliverable and treat it as an input: feed the predictive distribution into a newsvendor inventory decision with an asymmetric over/under cost, choose the order quantity that minimizes expected cost, and score the realized cost against the true outcome, the decision-aware move of Section 19.6. The single thread is that a forecast earns its keep not by being close to the truth but by being calibrated enough to trust and sharp enough to act on.

What You'll Practice

  • Distinguishing a point forecast from a probabilistic one and choosing the interval form a decision needs, following Section 19.1.
  • Adding quantile forecasts with the pinball loss and reading the predictive spread, following Section 19.3.
  • Wrapping a point forecaster in a distribution-free conformal interval that holds under distribution shift, following Section 19.5.
  • Checking calibration with PIT histograms and empirical coverage, and sharpness with CRPS and the pinball score, following Section 19.2.
  • Driving a newsvendor decision from a predictive distribution and scoring the realized asymmetric cost, following Section 19.6.

Setup

You need a trained point forecaster on a single series (the finance returns or volatility series of the book's running thread works well, as does any of the standard forecasting benchmarks), a held-out calibration split kept strictly later in time than the training data, and a small set of libraries: any forecasting library for the base point model, MAPIE for the conformal intervals of Section 19.5, and the proper-scoring utilities of a probabilistic forecasting toolkit such as GluonTS for the CRPS and pinball scores of Section 19.2. The one discipline that governs the whole lab is that the calibration set must come after the training set in time and must never be touched while fitting the point model, because conformal coverage and PIT calibration both assume the calibration residuals were not seen during training; leak the calibration window and every guarantee in the chapter quietly evaporates while the numbers still look fine. The code below wraps an already-fitted point regressor in a split-conformal interval with a target coverage in a few lines, the distribution-free contestant the lab builds alongside the quantile intervals.

from mapie.regression import MapieRegressor   # distribution-free intervals (Section 19.5)

# point_model is already fitted; X_cal, y_cal are a LATER-in-time calibration split.
mapie = MapieRegressor(estimator=point_model, cv="prefit")   # wrap the fitted point model
mapie.fit(X_cal, y_cal)                                        # calibrate on held-out residuals
y_pred, y_pis = mapie.predict(X_test, alpha=0.1)              # 90% coverage interval per point
# y_pis[:, 0, 0] and y_pis[:, 1, 0] are the lower and upper bounds of a guaranteed interval.
Setup: wrapping a prefitted point forecaster in a 90 percent split-conformal interval, the distribution-free contestant the lab builds alongside the quantile intervals and then grades on calibration and sharpness.

Steps

Step 1: Start from a point forecast and name what it hides

Load the trained point forecaster and generate its predictions on the test window, then plot the point forecast against the realized series, the bare point view of Section 19.1. Inspect the residuals and confirm they are neither tiny nor symmetric, making concrete the information the single number throws away and the decision downstream of it cannot recover.

Step 2: Add a quantile interval with the pinball loss

Fit quantile forecasts at a low and high quantile (for example the 5th and 95th percentiles) with the pinball loss of Section 19.3, producing a 90 percent prediction interval learned directly from data. Check for quantile crossing and read the width of the interval as the model's own statement of how uncertain it is.

Step 3: Add a conformal interval with a coverage guarantee

Wrap the same point model in a split-conformal interval at 90 percent target coverage using the setup code above, then switch to a time-series conformal method (EnbPI or adaptive conformal inference) from Section 19.5 and observe how it keeps coverage when the series drifts, exactly where the plain split-conformal exchangeability assumption begins to strain.

Step 4: Grade both intervals on calibration and sharpness

Compute the empirical coverage of each interval against its nominal 90 percent and draw a PIT histogram to check calibration, then compute CRPS and the pinball score to measure sharpness, the full scoring discipline of Section 19.2. Judge each interval by the principle of maximizing sharpness subject to calibration: the tightest interval that still covers what it promises wins.

Step 5: Drive a decision and score its realized cost

Pose a newsvendor decision with an explicit asymmetric cost (overstock cheap, understock expensive, or the reverse), choose the order quantity that minimizes expected cost under each predictive distribution, and score the realized cost against the true outcome, the decision-aware evaluation of Section 19.6. Compare which forecast led to the cheaper decision, not which had the best scoring rule.

Expected Output

The lab produces a point forecast dressed in two different kinds of honest interval and then graded twice, once on truthfulness and once on usefulness, which is the point. The quantile and conformal intervals of Steps 2 and 3 give two 90 percent prediction bands around the same point forecast, and on a drifting series the time-series conformal band of Step 3 holds its coverage where the plain split-conformal band slips, demonstrating concretely why the temporal variants exist. The calibration check of Step 4 yields empirical coverage close to the nominal 90 percent for a well-built interval and a roughly flat PIT histogram, with CRPS and pinball scores that let you rank the methods by sharpness among the calibrated ones, making the maximize-sharpness-subject-to-calibration principle a number rather than a slogan. The decision of Step 5 yields a realized cost per method, and the result that often surprises readers is that the forecast with the best CRPS is not always the one that drove the cheapest decision, because the asymmetric cost weights the tails the way the scoring rule does not, which is the entire argument for decision-aware evaluation. The reader finishes able to take any point forecaster and make it both honest and useful: calibrated enough to trust, sharp enough to be worth trusting, and graded by the decision it actually serves.

Right Tool: Honest Intervals in a Handful of Lines

Each movement of this chapter has a mature library that collapses the from-scratch derivation into a few calls. The split-conformal and time-series conformal intervals that Section 19.5 derives, calibration residuals, conformity scores, and the coverage proof, are a single MAPIE wrapper around an already-fitted model as shown above; the proper scoring rules that Section 19.2 builds by hand, CRPS and the pinball loss with their PIT and coverage diagnostics, are ready-made evaluators in GluonTS; and the distributional forecasting heads of Section 19.3 are a configured output distribution in a probabilistic deep forecaster rather than a hand-rolled quantile loss. The discipline the chapter teaches still governs the libraries: a conformal interval calibrated on leaked or mis-ordered data, a CRPS computed on samples that secretly saw the test window, or a decision scored against a forecast the decision itself helped fit will each return a confident and wrong number in exactly the same few lines. The library makes the interval free; it does not make the calibration honest.

Stretch Goals

  • Replace the quantile head of Step 2 with a full distributional output (a Gaussian or a richer parametric or flow-based density) from Section 19.3 and compare its CRPS against the quantile intervals, testing whether modeling the whole density beats modeling a few quantiles.
  • Add a Bayesian or deep-ensemble predictive distribution from Section 19.4 and separate its aleatoric from its epistemic uncertainty, then check whether its intervals are calibrated without the conformal correction or need it.
  • Fit a Gaussian process from Section 19.4 to a short, smooth segment of the series and compare its closed-form posterior interval against the conformal interval, learning where the kernel-based uncertainty earns its cubic cost and where the model-free conformal wrap is the better deal.

What's Next?

This chapter opens Part V: Uncertainty, Online, and Adaptive Learning, and it has changed what a forecast is. Every model in the book so far handed you a point, and this chapter taught you to hand back a calibrated distribution instead, graded by proper scoring rules and ultimately by the decisions it enables, with conformal prediction supplying a distribution-free guarantee that survives the non-stationarity real temporal data is full of. But calibration was measured on a fixed window, as if the world that generated the data would hold still. It does not. Chapter 20: Online and Continual Learning confronts the temporal model with a world that drifts beneath it, where the distribution shifts, concepts change, and a model trained once and frozen grows stale and miscalibrated no matter how honest it was on the day it was built, and it develops the machinery to learn continually, detect drift, and adapt without forgetting. The honest intervals you learned to draw in this chapter become, in the next, intervals you must keep honest as the ground moves. The full path through Part V and the rest of the book is laid out in the Table of Contents.

Bibliography & Further Reading

Scoring Rules and Calibration

Gneiting, T., Raftery, A. E. "Strictly Proper Scoring Rules, Prediction, and Estimation." Journal of the American Statistical Association, 102(477), 359-378, 2007. doi.org/10.1198/016214506000001437

The definitive treatment of proper scoring rules, including the continuous ranked probability score and the logarithmic score, and the reason honesty about uncertainty is the score-optimal strategy, the foundation of Section 19.2.

📄 Paper

Gneiting, T., Balabdaoui, F., Raftery, A. E. "Probabilistic Forecasts, Calibration and Sharpness." Journal of the Royal Statistical Society: Series B, 69(2), 243-268, 2007. doi.org/10.1111/j.1467-9868.2007.00587.x

The paper that framed probabilistic forecasting as maximizing sharpness subject to calibration and introduced the PIT-histogram diagnostic, the organizing principle of Section 19.2.

📄 Paper

Quantile and Distributional Forecasting

Koenker, R., Bassett, G. "Regression Quantiles." Econometrica, 46(1), 33-50, 1978. doi.org/10.2307/1913643

The founding paper of quantile regression and the pinball (check) loss, the classical basis for the quantile forecasting heads of Section 19.3.

📄 Paper

Bayesian, Ensemble, and Gaussian-Process Uncertainty

Rasmussen, C. E., Williams, C. K. I. "Gaussian Processes for Machine Learning." MIT Press, 2006. gaussianprocess.org/gpml

The standard reference on Gaussian processes, giving the closed-form posterior over functions and the kernel-based predictive uncertainty for time series in Section 19.4.

📚 Book

Lakshminarayanan, B., Pritzel, A., Blundell, C. "Simple and Scalable Predictive Uncertainty Estimation Using Deep Ensembles." NeurIPS, 2017. arXiv:1612.01474. arxiv.org/abs/1612.01474

Deep ensembles, a simple and strong baseline for predictive uncertainty that often outperforms more elaborate Bayesian methods, a central tool of Section 19.4.

📄 Paper

Gal, Y., Ghahramani, Z. "Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning." ICML, 2016. arXiv:1506.02142. arxiv.org/abs/1506.02142

Monte Carlo dropout, casting test-time dropout as approximate Bayesian inference to extract epistemic uncertainty from an ordinary network, the cheap Bayesian approximation of Section 19.4.

📄 Paper

Conformal Prediction

Vovk, V., Gammerman, A., Shafer, G. "Algorithmic Learning in a Random World." Springer, 2005. link.springer.com/book/10.1007/b106715

The founding monograph of conformal prediction, establishing the distribution-free finite-sample coverage guarantee under exchangeability, the theoretical bedrock of Section 19.5.

📚 Book

Angelopoulos, A. N., Bates, S. "A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification." 2021. arXiv:2107.07511. arxiv.org/abs/2107.07511

The accessible modern tutorial on conformal prediction and distribution-free uncertainty quantification, the recommended entry point to Section 19.5.

📄 Paper

Xu, C., Xie, Y. "Conformal Prediction Interval for Dynamic Time-Series (EnbPI)." ICML, 2021. arXiv:2010.09107. arxiv.org/abs/2010.09107

EnbPI, an ensemble batch prediction-interval method that brings conformal coverage to dynamic time series without requiring exchangeability, a temporal conformal method of Section 19.5 and the lab.

📄 Paper

Gibbs, I., Candes, E. "Adaptive Conformal Inference Under Distribution Shift." NeurIPS, 2021. arXiv:2106.00170. arxiv.org/abs/2106.00170

Adaptive conformal inference, which adjusts the coverage level online to keep intervals valid as the distribution shifts, the drift-robust conformal method of Section 19.5 and the lab.

📄 Paper

Tools and Libraries

Taieb, S. B., et al. "MAPIE: Model-Agnostic Prediction Interval Estimator." scikit-learn-contrib. github.com/scikit-learn-contrib/MAPIE

The reference Python library for model-agnostic conformal prediction intervals, wrapping any fitted regressor in a distribution-free interval, the engine behind the conformal step of the lab.

🔧 Tool

Alexandrov, A., et al. "GluonTS: Probabilistic and Neural Time Series Modeling in Python." Amazon Web Services. ts.gluon.ai

The reference library for probabilistic time-series forecasting, supplying distributional models like DeepAR and proper-scoring evaluators (CRPS, pinball) out of the box, the engine behind the scoring step of the lab.

🔧 Tool