                                   Relational Conformal Prediction for Correlated Time Series



or                                                                     Xie and Ermon (2019) paired with a straight-through gradi-

                       i,1−α/2+βi     i,α/2+β                          ent estimator (Bengio et al., 2013) to obtain discrete samples.

     β̂i = arg min   q̂t          − q̂t                    (15)

             βi                                                        Optionally, we sparsify the gradients by backpropagating

       h

                   i,α/2+β̂i              i,1−α/2+β̂i

                                                      i                only through a random subset of the zero entries of A (more

   α

 C

 bi,t = x̂it+H + q̂t         , x̂it+H + qbt             , (16)         details are provided in App. D). As already mentioned, dif-

                                                                       ferent parametrizations and gradient estimators for subset

where C b α indicates the estimated PI. While both Eq. 14

          i,t                                                          samplers exist and can be considered. Furthermore, if the

and Eq. 16 correspond to the same confidence level, the PI             sparsity assumption is deemed unrealistic for the problem at

in Eq. 16 can be narrower, at the expense of the additional            hand, other distributions (e.g., based on Bernoulli random

computation needed to obtain β̂ (Xu and Xie, 2023a). In                variables) can be considered (Cini et al., 2023c).

practice, one can choose between the two approaches given

computational constraints and the difference in performance            3.3. Theoretical Analysis and Further Discussion

observed on a validation set. Note that C     b α can provide

                                                i,t

only approximate coverage, as it is subject to approximation           We start the discussion by providing an intuitive bound on

errors of the true quantile function. Sec. 3.3 will discuss            the approximate coverage provided by C O R EL.

this aspect in detail. A potential drawback of C O R EL is that        Proposition 3.1. Let Pt+H c

                                                                                                     (xit+H ) = pt+H (xit+H |

residuals cannot be assumed exchangeable in most practi-                                  c   i

                                                                       X<t , U<t ) and Pψ (xt+H ) = pψ (xt+H | X<t , U<t ) be

cal scenarios. The error distribution can be non-stationary,           the true conditional data-generating distribution at the test

making it difficult to obtain any coverage guarantee. To               point t + H and the probability distribution associated with

mitigate the problem, Sec. 3.4 discusses an efficient and              the learned quantile function Qψ , respectively. Then

scalable approach to make the framework adaptive by updat-

ing local components of the architecture over time. Finally,            c

                                                                                                

                                                                                      b α (X

                                                                              xit+H ∈ C    ct+h ) ≥ 1 − α − T V P c , P c

                                                                                                                           

                                                                       Pt+H            i,t                       ψ     t+H

it is worth noting that the use of relational components in

C O R EL relies on the actual presence of the associated depen-

dencies in the data. In practical applications, the presence of        where T V ( · ) denotes the total variation function.

spatiotemporal correlations in the residuals can be verified

through ad-hoc statistical tests (Zambon and Alippi, 2022;             The proof relies on the properties of the total variation of

2023), whose outcome can support the adoption of C O R EL.             probability measures and can be found in App. A. Here,

                                                                       differently from the problem settings introduced in Sec. 2.1,

                                                                       we do not assume the process to be time-invariant. Prop. 3.1

3.2. Learning the Relational Structure

                                                                       links the conditional coverage gap to the approximation er-

Assuming the dependency structure across time series to be             ror in estimating the quantile function of the residuals. The

unknown, we integrate a graph learning module into the ar-             bound provided in Prop. 3.1 shares similarities with the one

chitecture to derive the operational graph topology directly           in (Barber et al., 2023), which bounds the miscoverage gap

from the residuals. To do so, we adopt a probabilistic struc-          for CP from weighted empirical quantiles. Prop. 3.1 can

ture learning framework (Niculae et al., 2023; Cini et al.,            be seen as an analogous result that holds when estimates

2023c; Manenti et al., 2024). In particular, we associate each         obtained from empirical quantiles are replaced with a para-

edge with a score ϕij and learn a distribution over K-NN               metric function approximation. By making assumptions

graphs parametrized by the matrix Φ ∈ RN ×N (Cini et al.,              on the expressivity of the quantile regressor in Eq. 13 and

2023c; Kazi et al., 2022). Notably, we consider graphs ob-             on the stationarity process (e.g., by assuming a strongly

tained by sampling, for each i-th node, K elements without             mixing process), we can expect the total variation between

replacement from the categorical distribution                          the learned and true distribution to shrink asymptotically as

                                                                       the size of the calibration set increases. Moreover, in this

 Φ = Eξ (R<t , V , . . . )                                 (17)

                                                           !           case, monitoring the coverage gap on a validation set offers

                          exp{ϕik }                                    an estimate of the actual miscoverage on test data. Simi-

Mi = Categorical        PN             ; k ∈ {1, . . . , N } ,         lar analyses have been carried out for recently introduced

                                    ij

                         j=1 exp{ϕ }

                                                                       CP methods for time series (Xu and Xie, 2023b; Lee et al.,

                                                            (18)

                                                                       2025); we refer the reader to these related works. If we

where Eξ (·) is a generic trainable encoder with parameters ξ.         instead expect the process to be non-stationary, Qψ has to

In practice, sampling can be done efficiently by exploiting            be updated over time to keep the coverage gap contained.

the GumbelTopK trick (Kool et al., 2019) and scores Φ can              Within this context, the next section discusses a simple and

be parametrized directly as Φ = ξ.                                     sample-efficient approach to make C O R EL adaptive. Fi-

                                                                       nally, the computational complexity of C O R EL will depend

End-to-end learning To propagate gradients through the                 on the STGNN used to implement the RelQP and the num-

sampling, we rely on the continuous relations introduced by            ber of edges sampled while learning the relational structure.



                                                                   5

