Abstract
Cross-sectional prediction is common in many domains such as healthcare, including forecasting tasks using electronic health records, where different patients form a cross-section. We focus on the task of constructing valid prediction intervals (PIs) in time series regression with a cross-section. A prediction interval is considered valid if it covers the true response with (a pre-specified) high probability. We first distinguish between two notions of validity in such a setting: cross-sectional and longitudinal. Cross-sectional validity is concerned with validity across the cross-section of the time series data, while longitudinal validity accounts for the temporal dimension. Coverage guarantees along both these dimensions are ideally desirable; however, we show that distribution-free longitudinal validity is theoretically impossible. Despite this limitation, we propose Conformal Prediction with Temporal Dependence (CPTD), a procedure that is able to maintain strict cross-sectional validity while improving longitudinal coverage. CPTD is post-hoc and light-weight, and can easily be used in conjunction with any prediction model as long as a calibration set is available. We focus on neural networks due to their ability to model complicated data such as diagnosis codes for time series regression, and perform extensive experimental validation to verify the efficacy of our approach. We find that CPTD outperforms baselines on a variety of datasets by improving longitudinal coverage and often providing more efficient (narrower) PIs.
Introduction
When machine learning models make predictions—like forecasting a patient's white blood cell count or predicting electricity demand—we don't just want a single number; we want a prediction interval (PI). We want to be able to say, "I'm 90% sure the value will fall between X and Y."
The gold standard for this is Conformal Prediction (CP), which provides mathematical guarantees for these intervals without assuming the data follows a specific distribution. However, standard CP relies on "exchangeability"—the idea that data points are essentially interchangeable. Time series data breaks this rule because today’s value depends on yesterday’s.
Defining Validity in Time Series
In a "cross-sectional" setting (like monitoring thousands of patients), standard CP might be "valid" on average across all patients, but it might be consistently wrong for a specific individual. The authors distinguish between two critical notions of validity:
- Cross-sectional validity: The intervals are correct on average across the whole population.
- Longitudinal validity: The intervals are correct for a specific individual over time.
Existing methods often ignore the temporal dimension, leading to "unbalanced coverage" where some individuals are consistently under-covered (the model is too confident) while others are over-covered (the model is too cautious).
Methodology: Conformal Prediction with Temporal Dependence (CPTD)
The authors propose CPTD, a post-hoc, light-weight procedure that can be wrapped around any existing time series model (like an LSTM or RNN). The core innovation is the use of temporally-informed nonconformity scores. Instead of using a fixed error threshold for everyone, CPTD "normalizes" the error based on how the model has performed on that specific time series in the past.
They introduce two main variants:
- CPTD-M (MAD-normalization): This variant adjusts the prediction interval based on the Mean Absolute Difference (MAD) of past errors for that specific series. If the model has been struggling with a particular patient, it widens the interval for them.
- CPTD-R (Ratio-to-Median-Residual): A more robust version that uses the ranks of errors and cross-sectional medians to handle outliers and "noisy" time steps more effectively.
Crucially, they prove that even though they are using past information to adjust the intervals, the method remains mathematically guaranteed to be valid across the entire cross-section.
Key Insights and Theoretical Limits
- The Impossibility Theorem: The authors provide a sobering theoretical proof (Theorem 3.1): it is mathematically impossible to achieve finite-sample, distribution-free longitudinal validity. You cannot guarantee a perfect 90% interval for every individual over time without making strong assumptions about the data.
- Heuristic Improvement vs. Formal Guarantee: Since perfect longitudinal validity is impossible, the goal shifts to improving it as much as possible while keeping the formal cross-sectional guarantee.
- Normalization is Key: By looking at a specific individual's "error scale," the model can adapt. If a patient’s physiology is naturally more volatile than the "average" patient, the model learns to issue wider, more honest intervals for them specifically.
Experimental Evaluation
The authors evaluated CPTD against several state-of-the-art baselines (like CFRNN and CQRNN) across five diverse real-world datasets: MIMIC (healthcare), Insurance claims, COVID19 regional cases, EEG brain activity, and Electricity Load forecasting.
Key results include:
- Better "Tail Coverage": CPTD consistently outperformed baselines in "tail coverage"—the accuracy for the 10% of individuals who are hardest to predict. This significantly reduced the number of "consistently missed" individuals.
- Efficiency: CPTD-R often produced narrower (more efficient) intervals than standard methods while maintaining the same level of accuracy.
- Model Agnostic: The experiments showed CPTD works well whether the underlying model is a complex Neural Network (LSTM) or a simple Linear Regression.
Conclusion
While CPTD makes the intervals much better for individuals, it can't promise they will be perfect for every individual in every scenario due to the fundamental limits of distribution-free longitudinal validity. Future work may explore designing these temporally adjusted scores for quantile regression and optimizing normalization functions for specific high-stakes domains.
Summary updated