Probabilistic Forecasting with Spline Quantile Function RNNs

Jan Gasthaus, Konstantinos Benidis, Yuyang Wang, Syama Sundar Rangapuram, David Salinas, Valentin Flunkert, Tim JanuschowskiAISTATS 2019

Abstract: In this paper, we propose a flexible method for probabilistic modeling with conditional quantile functions using monotonic regression splines. The shape of the spline is parameterized by a neural network, allowing for a non-parametric representation of the predictive distribution. We derive an analytical form for the Continuous Ranked Probability Score (CRPS) for these splines, enabling efficient training. Our approach, the Spline Quantile Function RNN (SQF-RNN), eliminates the quantile crossing problem and demonstrates superior performance on complex, irregular time series data.

Introduction

In time series forecasting, point forecasts are often insufficient for robust decision-making. Stakeholders require probabilistic forecasts to quantify uncertainty and manage risk. Current deep learning approaches generally fall into two categories: parametric models and discrete quantile regression. Parametric models assume a specific distribution (e.g., Gaussian), which fails when real-world data is skewed or multi-modal. Discrete quantile regression predicts a set of percentiles independently, often leading to "quantile crossing"—a mathematical inconsistency where a lower quantile is predicted to be higher than a larger one.

This paper introduces the Spline Quantile Function RNN (SQF-RNN), a novel architecture that models the entire conditional quantile function using monotonic regression splines, ensuring mathematical validity while maintaining high flexibility.

Methodology

The SQF-RNN combines the sequence modeling capabilities of Recurrent Neural Networks (RNNs) with a sophisticated mathematical representation of probability distributions.

Architecture

The backbone of the model is an autoregressive LSTM that processes past observations and external covariates. Instead of predicting distribution parameters like mean and variance, the network outputs the knots and slopes of a linear isotonic regression spline. This spline directly represents the quantile function (the inverse Cumulative Distribution Function). By construction, the spline is strictly non-decreasing, which inherently prevents the quantile crossing problem.

The training architecture of SQF-RNN, showing the flow from inputs through the LSTM to the spline-based quantile function and the CRPS loss.

Analytical CRPS Training

A key contribution of this work is the derivation of an analytical solution for the Continuous Ranked Probability Score (CRPS) integral specifically for piecewise-linear splines. CRPS is a proper scoring rule that measures the distance between the predicted distribution and the ground truth. By using an analytical form, the model can be trained efficiently via gradient descent without the computational overhead of numerical integration.

Experimental Evaluation

The model was evaluated across a variety of datasets, ranging from synthetic mixtures to large-scale real-world benchmarks:

  • Synthetic Data: A 3-component Gaussian Mixture Model designed to test the model's ability to recover multi-modal distributions.
  • Real-World Benchmarks: Hourly electricity consumption (elec), freeway occupancy (traffic), Wikipedia page hits (wiki), and supermarket gross margins (dom).
  • M4 Competition: A dataset of 100,000 diverse time series used to benchmark against state-of-the-art forecasting models.

Key Results

Distribution Recovery

On synthetic data, the SQF-RNN demonstrated remarkable flexibility. It successfully recovered the complex, three-peaked true distribution without any prior knowledge of the underlying mixture model. This highlights the advantage of the non-parametric spline approach over traditional parametric assumptions.

Comparison of predicted vs. actual Cumulative Distribution Function (left) and Quantile Function (right) on synthetic data, demonstrating the model's ability to fit complex distributions.

Performance on Irregular Data

While SQF-RNN matched the performance of established models like DeepAR on highly regular data (elec, traffic), it significantly outperformed them on irregular and intermittent data. For instance, on the wiki dataset, SQF-RNN achieved a Mean Scaled Interval Score (MSIS) of 15.68, a substantial improvement over DeepAR's 19.35.

M4 Competition Benchmarking

Without dataset-specific tuning, SQF-RNN achieved an Overall Weighted Average (OWA) of 0.885 in the M4 competition. This performance is highly competitive with the top-tier, heavily tuned models, and its MSIS score would have ranked second overall, proving the model's generalizability.

Conclusion and Future Work

SQF-RNN provides a robust framework for probabilistic forecasting by baking mathematical constraints directly into the neural network architecture. By parameterizing the quantile function as a monotonic spline, the model avoids quantile crossing and adapts to the true shape of the data distribution. Future research directions include exploring smoother spline types (e.g., sigmoidal splines), applying this technique to general robust regression, and developing quantile-weighted CRPS losses to better capture extreme tail events.

Summary updated

BibTeX
@inproceedings{gasthaus2019probabilistic,
  author = {Jan Gasthaus and Konstantinos Benidis and Yuyang Wang and Syama Sundar Rangapuram and David Salinas and Valentin Flunkert and Tim Januschowski},
  title = {{Probabilistic Forecasting with Spline Quantile Function RNNs}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2019},
  url = {https://openreview.net/forum?id=0Hr8Vs-r_kI},
}
Figure