# Asymptotics for conformal inference

Ulysse Gazin

► To cite this version:

Ulysse Gazin. Asymptotics for conformal inference. 2024. hal-04701683

HAL Id: hal-04701683

https://hal.science/hal-04701683v1

Preprint submitted on 18 Sep 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Asymptotics for conformal inference

Ulysse Gazin¹

¹Université Paris Cité and Sorbonne Université, CNRS, Laboratoire de Probabilités, Statistique et Modélisation, F-75013 Paris, France. E-mail: ugazin@lpsm.paris

**Abstract:** Conformal inference is a versatile tool for building prediction sets in regression or classification. In this paper, we consider the false coverage proportion (FCP) in a transductive setting with a calibration sample of $n$ points and a test sample of $m$ points. We identify the exact, distribution-free, asymptotic distribution of the FCP when both $n$ and $m$ tend to infinity. This shows in particular that FCP control can be achieved by using the well-known Kolmogorov distribution, and puts forward that the asymptotic variance is decreasing in the ratio $n/m$. We then provide a number of extensions by considering the novelty detection problem, weighted conformal inference and distribution shift between the calibration sample and the test sample. In particular, our asymptotical results allow to accurately quantify the asymptotical behavior of the errors when weighted conformal inference is used.

## 1. Introduction

### 1.1. Background

In classical statistics, producing prediction sets for outcomes often relies on strong model assumptions. Recent advances involve complex data sets and sophisticated machine learning methods, for which such an approach is not appropriate. One recent solution is conformal prediction (Saunders et al., 1999; Vovk et al., 2005; Angelopoulos and Bates, 2021) which consists in calibrating the prediction set according to an appropriate quantile of a calibration/training sample. Strikingly, this method provides a finite-sample valid coverage (that is, for any size $n \ge 1$ of the calibration sample), for any underlying distribution of the data and for any underlying point-prediction machine learning algorithm. Similar techniques can be employed for the novelty detection task (Balasubramanian et al., 2014; Bates et al., 2023; Marandon et al., 2024).

### 1.2. Aim and contributions

We consider here the so-called transductive setting (Vovk, 2013), where it is given a calibration sample of $n$ points $(X_1, Y_1), \dots, (X_n, Y_n)$ and a test sample of $m$ points $(X_{n+1}, Y_{n+1}), \dots, (X_{n+m}, Y_{n+m})$. While the calibration sample is fully observed, the $Y_i$'s of the test points are not observed and a prediction set should be provided for each of them. The false coverage proportion (FCP) for the $m$ conformal prediction sets $C^\alpha(X_{n+1}), \dots, C^\alpha(X_{n+m})$ (see below for a formal definition) is given as the proportion of coverage errors among the test sample:

$$ \text{FCP}_{m}^{(n)}(\alpha) := \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{Y_{n+i} \notin C^{\alpha}(X_{n+i})}. $$

Under standard assumptions, the distribution of the process $FCP_m^{(n)}$ has been shown to be distribution-free, in the sense that it does only depend on $n$ and $m$ (Marques F., 2023; Huang et al., 2024; Gazin et al., 2024). Due to the dependence between the individual coverage errors, this distribution is particularly complex in $n$ and $m$ and combinatorial formulas have been derived in Marques F. (2023); Huang et al. (2024); Gazin et al. (2024). Nevertheless, focusing on the maximum absolute deviation

$$ \| \text{FCP}_m^{(n)} - I_n \|_{\infty} := \sup_{\alpha \in [0,1]} | \text{FCP}_m^{(n)}(\alpha) - I_n(\alpha) |, \quad (1) $$
with $I_n(\alpha) = \lfloor(n+1)\alpha\rfloor/(n+1)$, a DKW-type concentration inequality has been derived in Gazin et al. (2024), which is both simple and finite-sample valid. It explicitly involves a rate $\tau_{n,m}^{1/2}$ defined by

$$ \tau_{n,m} := \frac{nm}{n+m} \in \left[ \frac{n \wedge m}{2}, n \wedge m \right]. \qquad (2) $$

However, this DKW inequality is conservative in general (see Figure 1 below), which makes the corresponding FCP control conservative.

The aim of this paper is to complement the above studies by analyzing $FCP_m^{(n)}$ from an asymptotical point of view, where both $m$ and $n$ tend to infinity. Our contributions are as follows:

1. We show that $FCP_m^{(n)}$ converges uniformly to the nominal value at rate $\tau_{n,m}^{1/2}$ and that the asymptotic covariance process is a standard Brownian bridge (Theorem 3.1). Compared to the “oracle” case where $n = \infty$, it means that the variance is inflated by a factor asymptotically equivalent to $(n+m)/n$, for instance 2 in the case where $n \sim m$.

2. A direct corollary of this result is that $\tau_{n,m}^{1/2} \|FCP_m^{(n)} - I_n\|_{\infty}$ converges to the well known Kolmogorov distribution, that is, the distribution with c.d.f. $x \mapsto (1-2 \sum_{k \ge 1} (-1)^k e^{-2k^2 x^2}) \mathbf{1}_{x \ge 0}$. A comparison between the quantiles of this distribution and those given by empirical simulations or DKW is provided in Figure 1. As we can see, while the validity of the new quantile is only asymptotic with $n, m \to +\infty$, the asymptotic quantile is simple and more accurate than the quantile obtained from DKW. Hence, the new result allows to get simple, accurate and asymptotically-valid confidence bounds for the FCP process and more generally one can have an asymptotic approximation of all quantities related to the distribution of the FCP process.

3. We then extend this result to the case where the distribution of the calibration sample is not equal to the test sample, that is, under a distribution shift (Theorem 3.2). As expected, the convergence of the FCP is not towards the nominal level in this case but rather towards a new term $G$ that takes into account this shift. The asymptotic covariance process is also modified according to $G$ and an explicit formula is given.

4. To recover the appropriate nominal level in the limit, we adopt the weighted conformal approach (Tibshirani et al., 2019; Barber et al., 2023), with specific weights that rely on the data distribution, that we refer to as oracle weights. The central limit theorem shares similarities with the exchangeable case described above, with the essential difference that the asymptotic covariance process is not distribution free, and depends on the sample distributions (Theorem 3.4).

5. We also obtained a convergence result in case of non-oracle weights (Theorem 3.3), which is crucial to quantify the FCP asymptotic behavior in the difficult but realistic case where the user has not access to the true distribution shift. An illustration is displayed in Figure 2, where the asymptotical confidence interval of the FCP is given in function of an error $\Delta$, measuring how the used weights deviate from the oracle ones. This puts forward that the FCP gets significantly away from $\alpha$ when $\Delta$ is above $\approx 0.133$ or below $\approx -0.11$ in this framework.

6. Finally, we obtain similar results for the novelty detection task, by studying the asymptotical behavior of the false discovery proportion (FDP) of classical procedures (Bates et al., 2023; Jin and Candès, 2023), see Section 4. To our knowledge, using a weighted approach has not been considered before in the novelty detection case.

The proofs are based on specific decompositions of the processes that can be found in Section 5, while further details are postponed to appendices.

## 1.3. Relation to previous work

Conformal prediction is a general pipeline and we refer the reader to Vovk et al. (2005) or Angelopoulos and Bates (2021) for reviews. We focus here on the inductive/split conformal inference (Papadopoulos et al., 2002), where an independent training sample is used to build the predictors,
<figure><img src="image_2.png" /><figcaption>Fig 1: Comparison of the $(1 - \delta)$-quantile of different approximations of the distribution of $||FCP_m^{(n)} - I_n||_\infty$ in (1) for different values of $n, m$ and $\delta$. The approximations include Monte-Carlo (1000 replications), DKW (Gazin et al., 2024) and the new asymptotic one (see text).</figcaption></figure>

while a calibration sample is used to adjust the prediction sets. All our results can be thought of
holding conditionally on the training sample, that is, they hold once the point-predictions have
been computed.

The process $FCP_m^{(n)}$ coincides with the empirical cumulative distribution function (e.c.d.f.) of conformal $p$-values as introduced by Saunders et al. (1999). As recalled above, for a given nominal level $\alpha$, the non-asymptotic distribution of $FCP_m^{(n)}(\alpha)$ has been obtained in Marques F. (2023); Huang et al. (2024) and the full distribution of the process $FCP_m^{(n)}$ has been given in Gazin et al. (2024). In addition, Marques F. (2023) gives an asymptotic result for $FCP_m^{(n)}(\alpha)$ in the regime where $n$ tends to infinity only after having made $m$ tends to infinity, whereas here we make $n$ and $m$ grow to infinity independently. In addition, our results are uniform in $\alpha$. Next, in Nguyen et al. (2024), they study a more general risk and also obtained asymptotical results, but only as $m$ tends to infinity while $n$ is kept fixed.

Finally, we study here novelty detection procedures obtained by applying the Benjamini-Hochberg
procedure (BH, Benjamini and Hochberg, 1995) to the conformal $p$-values (Mary and Roquain,
2022; Bates et al., 2023; Marandon et al., 2024) or to the weighted conformal $p$-values (Tibshi-
rani et al., 2019; Barber et al., 2023; Jin and Candès, 2023). Asymptotics for the FDP of such
procedures have been extensively studied in the literature, see Genovese and Wasserman (2002);
Neuvial (2008) for iid uniform $p$-values and Delattre and Roquain (2011, 2016); Kluger and Owen
(2024) for several types of dependence structures. The present work is in this line of research
by seeing (weighted) conformal $p$-values as a particular case of dependent $p$-values, with a very
specific dependence structure, induced by the calibration sample. We obtain our results in the
novelty detection setting by using the techniques introduced in Neuvial (2008), that combine
functional central limit theorems with the functional delta method. In particular, this provides
the full asymptotic FDP distribution for the procedure of Jin and Candès (2023) (or a variant
thereof), for which only in-expectation results were known to our knowledge.
<figure><img src="image_3.png" /><figcaption>Fig 2: Plot of the asymptotical confidence interval for the FCP of the weighted conformal method (at level 80%) obtained in Theorem 3.3 versus an error parameter $\Delta$. The calibration sample and the test sample are distributed according to the exponential distribution with mean 1 and 1/3, respectively. The weight function used in the conformal method is $w_{\Delta}(x) = \exp(-(2+\Delta)x)1_{x>0}$, which corresponds to the oracle choice if $\Delta = 0$ (for which the asymptotic average of FCP($\alpha$) is equal to $\alpha$) and deviates from it if $\Delta \neq 0$.</figcaption></figure>

## 2. Preliminaries

### 2.1. Prediction setting

We consider the classical split/inductive conformal prediction (Papadopoulos et al., 2002). A calibration set $\{Z_k, k \in \llbracket n \rrbracket\}$ is observed with $Z_k = (X_k, Y_k)$ and, given a new point $Z_{n+1} = (X_{n+1}, Y_{n+1})$ for which only the covariate $X_{n+1} \in \mathcal{X}$ is observed, a prediction set should be inferred for the outcome $Y_{n+1} \in \mathcal{Y}^1$. A non-conformity score function $S: \mathcal{X} \times \mathcal{Y} \to \mathbb{R}$ is also given; $S(X, Y) \in \mathbb{R}$ measures the non-conformity of the response $Y \in \mathcal{Y}$ with the covariate $X \in \mathcal{X}$. The classical example in regression is the residual $S(X, Y) = |Y - \hat{\mu}(X)|$ where $\hat{\mu}: \mathcal{X} \to \mathcal{Y}$ is a regression function trained from an independent training sample (considered as fixed here). The (split) conformal prediction set at level $(1-\alpha)$ for $X_{n+1}$, denoted by $C^{\alpha}(X_{n+1})$, is defined as

$$C^{\alpha}(X_{n+1}) := \{y \in \mathcal{Y} : S(X_{n+1}, y) \le S_{(\llbracket(n+1)(1-\alpha)\rrbracket)}\}, \quad (3)$$

where $S_{(1)} \le S_{(2)} \le \dots \le S_{(n)} < S_{(n+1)} := +\infty$ correspond to the ordered calibration scores $D_{cal} = \{S_k : k \in \llbracket n \rrbracket\}$. The set $C^{\alpha}(X_{n+1})$ can be equivalently described as follows (this classical fact can be retrieved from Lemma F.1): $Y_{n+1} \notin C^{\alpha}(X_{n+1})$ if and only if $p_1^{(n)} \le \alpha$, where the

<footnote n="1">¹The regression and classification settings correspond to $\mathcal{Y} = \mathbb{R}$ and $\mathcal{Y}$ finite, respectively.</footnote>
conformal p-value is given by

$$p_1^{(n)} := (n+1)^{-1} \left( 1 + \sum_{k \in \llbracket n \rrbracket} 1_{S_k \ge T_1} \right),$$

where $T_1 = S(X_{n+1}, Y_{n+1})$.

In this paper, we consider a transductive setting (Vovk, 2013), where a decision should be made for a whole test sample of size $m$ for which only the covariates are observed. We denote $\mathcal{D}_{\text{test}} = (T_i, i \in \llbracket m \rrbracket)$ the set of the unobserved (since we only observed the covariates of the test points) scores of the test sample. Considering the conformal prediction sets $\mathcal{C}^{\alpha}(X_{n+i}), i \in \llbracket m \rrbracket$ — corresponding to (3) for all members of the test sample — gives rise to a family of $m$ conformal p-values $(p_i^{(n)})_{i \in \llbracket m \rrbracket}$ defined by

$$p_i^{(n)} := (n+1)^{-1} \left( 1 + \sum_{k \in \llbracket n \rrbracket} 1_{S_k \ge T_i} \right), \quad i \in \llbracket m \rrbracket. \quad (4)$$

The false coverage proportion FCP$_m^{(n)}(\alpha)$ of the prediction set family $(\mathcal{C}^{\alpha}(X_{n+i}))_{i \in \llbracket m \rrbracket}$ is defined by

$$\text{FCP}_m^{(n)}(\alpha) := \frac{1}{m} \sum_{i \in \llbracket m \rrbracket} 1_{Y_{n+i} \notin \mathcal{C}^{\alpha}(X_{n+i})} = \frac{1}{m} \sum_{i \in \llbracket m \rrbracket} 1_{p_i^{(n)} \le \alpha}. \quad (5)$$

Note that this corresponds to the empirical cumulative density function (e.c.d.f.) of the conformal p-values family $(p_i^{(n)})_{i \in \llbracket m \rrbracket}$. The following assumption will be considered throughout the paper for the (weighted or not) conformal prediction task.

**Assumption 1.** The set of calibration scores $(S_k)_{k \ge 1}$ and the set of test scores $(T_i)_{i \ge 1}$ are two independent families of real random variables. The $S_k, k \ge 1$, (resp. $T_i, i \ge 1$) are i.i.d. with distribution $P_{\text{cal}}$ (resp. $P_{\text{test}}$) and cumulative distribution function $F_{\text{cal}}$ (resp. $F_{\text{test}}$). Moreover, $F_{\text{cal}}$ and $F_{\text{test}}$ are continuous functions.

In the classical setting, the variables $Z_i, i \in \llbracket n+m \rrbracket$, are i.i.d., hence Assumption 1 is true with $P_{\text{cal}} = P_{\text{test}}$. Since the vector of scores $\mathcal{D}_{\text{cal}} \cup \mathcal{D}_{\text{test}}$ is exchangeable in this case, the conformal p-values are marginally super-uniform (Vovk et al., 2005; Romano and Wolf, 2005) which leads to non-asymptotically valid prediction sets. However, in case of a distribution shift between the distributions of the calibration and the test sample, that is $P_{\text{cal}} \neq P_{\text{test}}$, this property is lost. To solve this issue, Tibshirani et al. (2019); Barber et al. (2023) proposed in this case to use weighted conformal prediction. We follow this approach (with light formal variations for mathematical convenience) by introducing a nonnegative weight function $w: \mathbb{R} \to \mathbb{R}^+$ and $w(+\infty) \in \mathbb{R}^+$ and the prediction set

$$\mathcal{C}^{w,\alpha}(X_{n+1}) := \left\{ y \in \mathcal{Y} : S(X_{n+1}, y) \le Q_{1-\alpha} \left( \frac{w(+\infty)}{W} \delta_{+\infty} + \sum_{k \in \llbracket n \rrbracket} \frac{w(S_k)}{W} \delta_{S_k} \right) \right\},$$

where $Q_{\alpha}(\mu)$ denotes the $\alpha$-quantile of the probability measure $\mu$, $\delta_a$ denotes the Dirac measure in $a$ and $W := w(+\infty) + \sum_{k \in \llbracket n \rrbracket} w(S_k)$ is a normalization constant. The set $\mathcal{C}^{w,\alpha}(X_{n+1})$ can also be described with weighted conformal p-values thanks to Lemma F.1: $Y_{n+1} \notin \mathcal{C}^{w,\alpha}(X_{n+1})$ if and only if $p_1^{w,(n)} \le \alpha$, with

$$p_1^{w,(n)} := \frac{w(+\infty) + \sum_{k=1}^{n} w(S_k) 1_{S_k \ge T_i}}{w(+\infty) + \sum_{k=1}^{n} w(S_k)}.$$

Similarly, with a test sample of size $m$, we obtained the $m$ weighted conformal p-values,

$$p_i^{w,(n)} := \frac{w(+\infty) + \sum_{k=1}^{n} w(S_k) 1_{S_k \ge T_i}}{w(+\infty) + \sum_{k=1}^{n} w(S_k)}, \quad \text{for all } i \in \llbracket m \rrbracket, \quad (6)$$
The FCP of these weighted conformal prediction sets is in this case

$$ \mathrm{FCP}_m^{w,(n)}(\alpha) := \frac{1}{m} \sum_{i \in \llbracket m \rrbracket} 1_{Y_{n+i} \notin \mathcal{C}^{w,\alpha}(X_{n+i})} = \frac{1}{m} \sum_{i \in \llbracket m \rrbracket} 1_{p_i^{w,(n)} \le \alpha}, \quad (7) $$

which, similarly to (5), is the e.c.d.f. of the weighted conformal p-values family.

Finally, under Assumption 1 and if $P_{\text{test}}$ is absolutely continuous with respect to $P_{\text{cal}}$, a particularly interesting weight function, called the *oracle weight function*, is given by

$$ w^* := \frac{d P_{\text{test}}}{d P_{\text{cal}}}. \quad (8) $$

Clearly, if the calibration and test sample are exchangeable ($P_{\text{cal}} = P_{\text{test}}$), the function $w^*$ is constantly equal to 1. However, under a distribution shift ($P_{\text{cal}} \neq P_{\text{test}}$), the oracle weight function is different, and oracle-weighted conformal p-values $p_i^{w,(n)}$ (6) are different from the regular ones $p_i^{(n)}$ (4). They recover the marginally super-uniform property provided that $w^*(+\infty) \ge \sup_{u \in \mathbb{R}} w^*(u)$, see Tibshirani et al. (2019).

## 2.2. Novelty detection setting

In the novelty detection setting (see for instance Vovk et al., 2005; Bates et al., 2023), we observe a calibration set $\{Z_k, k \in \llbracket n \rrbracket\}$ of size n, with values in $\mathcal{Z}$ distributed according to an unknown “null” distribution $\mathbb{P}_0$ and a test sample $\{Z_{n+i}, i \in \llbracket m \rrbracket\}$ with $Z_{n+i} \in \mathcal{Z}$ either distributed as $\mathbb{P}_0$ or not. Formally, we introduce a subset $\mathcal{H}_0 \subset \{1, 2, \dots\}$ so that $Z_{n+i} \sim \mathbb{P}_0$ when $i \in \mathcal{H}_0$. We also denote $\mathcal{H}_1 = \{1, 2, \dots\} \setminus \mathcal{H}_0$. In addition, it is given a non-conformity score function $S: \mathcal{Z} \to \mathbb{R}$ such that $S(Z) \in \mathbb{R}$ measures the non-conformity of the variables Z with respect to $\mathbb{P}_0$ and we denote $\mathcal{D}_{\text{cal}} = \{S_k: k \in \llbracket n \rrbracket\}$ and $\mathcal{D}_{\text{test}} = \{T_i: i \in \llbracket m \rrbracket\}$ the set of the score from the calibration and test samples respectively. A novelty detection procedure decides, for each $i \in \llbracket m \rrbracket$, whether $Z_{n+i}$ is a novelty (that is, does not follow $\mathbb{P}_0$), or not. The procedure described by Bates et al. (2023) consists in computing the conformal p-values defined in (4) (by using the specific $S_k$'s and $T_i$'s of novelty detection), and then applying the Benjamini-Hochberg procedure (Benjamini and Hochberg, 1995) on this p-value family $(p_i^{(n)})_{i \in \llbracket m \rrbracket}$ (see Section 5.2.1 for more formal details). This gives a rejection set $\mathcal{R}_\alpha \subset \llbracket m \rrbracket$ corresponding to the indices of the declared novelties.

$$ \mathrm{FDP}_m^{(n)}(\mathcal{R}_\alpha) := \frac{|\mathcal{R}_\alpha \cap \mathcal{H}_0|}{|\mathcal{R}_\alpha| \vee 1}; \quad (9) $$

$$ \mathrm{TDP}_m^{(n)}(\mathcal{R}_\alpha) := \frac{|\mathcal{R}_\alpha \cap \mathcal{H}_1|}{|\mathcal{H}_1| \vee 1}. \quad (10) $$

The FDP corresponds to the proportion of errors among the declared novelties (related to a type I error notion), while the TDP corresponds to the proportion of correct decisions among the true novelties (related to a power notion). The following will be assumed throughout the paper for (weighted or not) novelty detection:

**Assumption 2.** The set of calibration scores $(S_k)_{k \ge 1}$ and the set of test scores $(T_i)_{i \ge 1}$ are two independent families of real random variables. The variables $S_k, k \ge 1$, are i.i.d. with distribution $P_{\text{cal}}$ and c.d.f. $F_{\text{cal}}$. The variables $T_i, i \ge 1$, are independent, the variables $T_i, i \in \mathcal{H}_0$, are identically distributed as a null score distribution $P_0$ and c.d.f. $F_0$, and the variables $T_i, i \in \mathcal{H}_1$, are identically distributed as an alternative score distribution $P_{\text{test}}$ (potentially different from $P_0$) with c.d.f. $F_{\text{test}}$. Moreover, $F_{\text{cal}}$, $F_0$ and $F_{\text{test}}$ are continuous.

We also consider the case of a distribution shift between the distribution of the calibration set $P_{\text{cal}}$ and the null distribution $P_0$, in which case we propose to use a weighted p-value approach (as for the prediction task). For some weight function $w: \mathbb{R} \to \mathbb{R}^+$ and $w(+\infty) \in \mathbb{R}^+$, the weighted conformal p-values are the ones from (6) (by using the specific $S_k$'s and $T_i$'s of novelty detection).
We introduce the weighted Bates et al. (2023) procedure as the one applying the BH procedure on this weighted p-value family and we denote its rejection set by $R_{\alpha}^{w} \subset \llbracket m \rrbracket$. We defined as above the FDP and TDP of this procedure.

Under Assumption 2 and if $P_0$ is absolutely continuous with respect to $P_{cal}$, a particular weight is the *oracle weight function* defined by

$$w^* := \frac{d P_0}{d P_{cal}}. \qquad (11)$$

The oracle weighted conformal p-values $p_i^{w^*,(n)}$, $i \in \mathcal{H}_0$, are marginally super-uniform provided that $w^*(+\infty) \ge \sup_{u \in \mathbb{R}} w^*(u)$, see Tibshirani et al. (2019).

### 2.3. Spaces for process convergence

We study the asymptotic convergence of random processes and we consider usual spaces defined in Billingsley (1999) and van der Vaart and Wellner (1996), denoted as usual $D[0, 1]$, $D(0, 1)$ and $\ell^{\infty}(0, 1)$, and which are briefly described below.

First, $D[0, 1]$ is the set of càdlàg function $f: [0, 1] \to \mathbb{R}$ with the usual Skorohod topology. Second, $D(0, 1)$ is the set of càdlàg function $f: (0, 1) \to \mathbb{R}$ with the extended Skorohod topology<fnref n="2" /> defined as follows: $(x_n)_n \in D(0, 1)^N$ converge to $x \in D(0, 1)$ if and only if, for all $(a, b) \in (0, 1)^2$ with $a < b$ such that $x$ is continuous at points $a$ and $b$, the sequence $(x_n)_n$ restricted to $[a, b]$ converges to $x$ restricted to $[a, b]$ in $D[a, b]$ with the usual Skorohod topology. Finally, $\ell^{\infty}(0, 1)$ is the space of locally bounded function $f: (0, 1) \to \mathbb{R}$ with the topology of the uniform convergence on all compact sets of $(0, 1)$: a sequence $(f_n)_n \in [\ell^{\infty}(0, 1)]^N$ converges to $f \in \ell^{\infty}(0, 1)$ if and only if for all $K$ compact subsets of $(0, 1)$, $\sup_{x \in K} |f_n(x) - f(x)| \to 0$. We also consider $D(\mathbb{R})$ the space of càdlàg function from $\mathbb{R}$ to $\mathbb{R}$ with the extended Skorohod topology and $\ell^{\infty}(\mathbb{R})$ the space of locally bounded function from $\mathbb{R}$ to $\mathbb{R}$ with the topology of the uniform convergence on all compact sets of $\mathbb{R}$.

## 3. Asymptotics for conformal prediction

The aim here is to study the asymptotic properties of the processes $FCP_m^{(n)}$ (5) and $FCP_m^{w,(n)}$ (7). We study each process in two scenarios: exchangeable or distribution shift.

### 3.1. Main result

Let us introduce the two following quantities:

$$I(t) := t, \ t \in [0, 1]; \qquad (12)$$

$$G(t) := 1 - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t), \ t \in (0, 1), \qquad (13)$$

where $F_{cal}^{-1}(u) = \inf \{x \in \mathbb{R} : F_{cal}(x) \ge u\}$ denotes the general inverse of $F_{cal}$. Formally, $I$ and $G$ correspond to the c.d.f. of the theoretical p-values $p^{(+\infty)} = 1 - F_{cal}(T)$ when $T \sim P_{cal}$ and $T \sim P_{test}$, respectively. We denote $G'$ denotes the derivative of $G$ when it is defined.

**Theorem 3.1.** Under Assumption 1 with $F_{cal} = F_{test}$, we have

$$\sqrt{\tau_{n,m}} (FCP_m^{(n)} - I) \xrightarrow[\tau_{n,m} \to +\infty]{L} \mathbb{U} \text{ on } D[0, 1],$$

where $\tau_{n,m}$ is defined by (2) and $\mathbb{U}$ is a standard Brownian bridge.

<footnote n="2">²This definition is similar to the convergence in $D[0, +\infty)$ considered in Billingsley (1999)</footnote>
**Theorem 3.1** is proved in Section 5.1.4. Note that Theorem 3.1 is true under slightly more general assumptions: namely, it is sufficient that all the scores are exchangeable without ties (Gazin et al., 2024). As a corollary, if $n/(n+m) \to \sigma^2 \in (0, 1]$, this result gives

$$ \sqrt{m} (\text{FCP}_m^{(n)} - I) \xrightarrow{\tau_{n,m} \to +\infty} \sigma^{-1} U. $$

The latter shows that if the ratio $\tau_{n,m} m^{-1}$ or $nm^{-1}$ is small (see Lemma F.2 for the equivalence), the FCP becomes asymptotically over-dispersed. This is markedly different from the case where we have $m$ i.i.d. $p$-values uniformly distributed on $(0, 1)$ (compare with the Donsker theorem, see Theorem E.3).

Let us now consider the case where we have potentially a covariate shift, that is, $F_{cal} \neq F_{test}$. For this, we consider the following additional assumptions<fnref n="3" /> on $F_{cal}$ and $F_{test}$.

**Assumption 3.** $F_{cal}$ is increasing on its support $(a, b) \subset \mathbb{R}$ with $-\infty \le a < b \le +\infty$ and is continuously differentiable. In addition, $F_{test}$ is continuously differentiable.

**Theorem 3.2.** Under Assumptions 1 and 3 and assuming that $n/(n+m)$ tends to $\sigma^2 \in [0, 1]$, we have

$$ \sqrt{\tau_{n,m}} (\text{FCP}_m^{(n)} - G) \xrightarrow{\tau_{n,m} \to +\infty} \sigma U \circ G + \sqrt{1 - \sigma^2 G'} V \text{ on } D(0,1), $$

where $U$ and $V$ are two independent Brownian bridges.

**Theorem 3.2** is proved in Section 5.1.3. When $F_{test} = F_{cal}$ it recovers Theorem 3.1 (under stronger assumptions). Otherwise, it shows that the FCP converges to $G \neq I$ which entails that $\text{FCP}_m^{(n)}(\alpha)$ is not provided to converge to $\alpha$ anymore.

## 3.2. Weighted case

Let $w: \mathbb{R} \cup \{\infty\} \to \mathbb{R}^+$ be a bounded and measurable weight function. To describe the asymptotic behavior of $\text{FCP}_m^{w,(n)}$, we need to introduce few additional quantities. First, we let

$$ F_{cal}^{w}(t) := \frac{\int_{-\infty}^{t} w(u) \, d P_{cal}(u)}{\int_{\mathbb{R}} w(u) \, d P_{cal}(u)}, \quad t \in \mathbb{R}, \qquad (14) $$

which corresponds to the c.d.f. of the distribution induced by weight function $w$ on the distribution $P_{cal}$. Note that when choosing the oracle weights (8), the latter is simply the c.d.f. of $P_{test}$. Second, let

$$ G^w(t) := 1 - F_{test} \circ (F_{cal}^w)^{-1}(1-t), \quad t \in (0,1), \qquad (15) $$

the c.d.f. of the theoretical $p$-values $p^{w,(+\infty)} = 1 - F_{cal}^w(T)$ with $T \sim P_{test}$, and we denote $(G^w)'$ its derivatives when it exists. Finally, we introduce quantities involved in the variance:

$$ \rho^w := \frac{\left(\int_{\mathbb{R}} w(u)^2 \, d P_{cal}(u)\right)^{1/2}}{\int_{\mathbb{R}} w(u) \, d P_{cal}(u)} \ge 1; \qquad (16) $$

$$ V_{cal}^{w}(t) := \frac{\int_{-\infty}^{t} w(u)^2 \, d P_{cal}(u)}{\int_{\mathbb{R}} w(u)^2 \, d P_{cal}(u)}, \quad t \in \mathbb{R}; \qquad (17) $$

$$ I^w(t) := 1 - V_{cal}^w \circ (F_{cal}^w)^{-1}(1-t), \quad t \in (0,1). \qquad (18) $$

**Assumption 4.** The weight function $w: \mathbb{R} \cup \{\infty\} \to \mathbb{R}^+$ is uniformly bounded by a constant and is measurable. Moreover, $F_{cal}^w$ is increasing on its support $(a^w, b^w) \subset \mathbb{R}$ with $-\infty \le a^w < b^w \le +\infty$ and is continuously differentiable.

<footnote n="3">³Assumption 3 can be slightly relaxed, by only assuming that $F_{test} \circ F_{cal}^{-1}$ is continuously differentiable on $(0, 1)$.</footnote>
Typically, Assumption 4 holds if {$t \in \mathbb{R}$, $w(t) > 0$} is a (possibly infinite) interval of $\mathbb{R}$ on which $w$ is bounded and continuous and $F_{cal}$ satisfies Assumption 3.

**Theorem 3.3.** Under Assumptions 1, 3, 4 and assuming that $n/(n+m)$ tends to $\sigma^2 \in [0, 1]$, we have

$$ \sqrt{\tau_{n,m}} (\text{FCP}_m^{w,(n)} - G^w) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \sigma \mathbb{U} \circ G^w + \sqrt{1 - \sigma^2} \rho^w (G^w)' (\mathbb{V}(I^w) + [I - I^w] N) \text{ on } D(0,1), $$

where $\mathbb{U}, \mathbb{V}$ are two independent standard Brownian bridges, $\rho^w$ is defined by (16), $I^w$ is defined by (18), $N$ is an independent standard Gaussian random variable and $(G^w)'$ denotes the derivative of $G^w$.

Theorem 3.3 is proved in Section 5.1.5. Note that Theorem 3.3 recovers Theorem 3.2 when $w \equiv 1$. The asymptotic expectation of $\text{FCP}_m^{w,(n)}(\alpha)$ is $G^w(\alpha)$ which is different from $\alpha$ in general, if $w$ is chosen arbitrarily. Interestingly, when choosing the oracle weight function $w^*$ given by (8), we have $G^w = I$ and the convergence in Theorem 3.3 reads as follows:

**Theorem 3.4.** Under Assumptions 1 and 3, assume that $P_{test}$ is absolutely continuous with respect to $P_{cal}$ and that the oracle weight function $w^*$ (8) satisfies Assumption 4. If the ratio $n/(n+m)$ tends to $\sigma^2 \in [0, 1]$, we have,

$$ \sqrt{\tau_{n,m}} (\text{FCP}_m^{w^*,(n)} - I) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \sigma \mathbb{U} + \sqrt{1 - \sigma^2} \rho^{w^*} (\mathbb{V}(I^{w^*}) + [I - I^{w^*}] N) \text{ on } D(0,1), $$

where $\mathbb{U}, \mathbb{V}$ are two independent standard Brownian bridge and $N$ is an independent standard Gaussian random variable.

This result means that we can recover a result close to Theorem 3.1 in case of a distribution shift if the oracle weight function is used in the prediction sets.

Finally, the covariance terms of Theorems 3.3 and 3.1 can be used to build confidence intervals for the FCP, as illustrated in Figure 2.

# 4. Asymptotics for novelty detection

Recall the novelty detection setting of Section 2.2. The aim here is to study the asymptotic properties of the process $\text{FDP}_m^{(n)}(\mathcal{R}_\alpha)$ (9) and of the process $\text{TDP}_m^{(n)}(\mathcal{R}_\alpha)$ (10).

## 4.1. Additional notation and assumptions

We denote, for all $m \ge 1$, $m_0(m) = |\mathcal{H}_0 \cap \llbracket m \rrbracket|$ and $\pi_0(m) = m_0(m)/m$ the number and the proportion of nulls (i.e. of non-novelties) among $m$ tested points, respectively. We introduce the following quantities:

$$ G_0(t) = 1 - F_0 \circ F_{cal}^{-1}(1-t), \quad t \in (0,1); \qquad (19) $$

$$ G_{\text{mixt}} = \pi_0 G_0 + (1 - \pi_0) G, \qquad (20) $$

that correspond to the (limiting) c.d.f. of the conformal $p$-values under the null and under the test sample mixture, respectively. For some weight function $w$, we also define their weighted counterparts:

$$ G_0^w(t) = 1 - F_0 \circ (F_{cal}^w)^{-1}(1-t), \quad t \in (0,1), \qquad (21) $$

$$ G_{\text{mixt}}^w = \pi_0 G_0^w + (1 - \pi_0) G^w. \qquad (22) $$

We denote $G'_{\text{mixt}}$ and $(G_{\text{mixt}}^w)'$ the derivatives of $G_{\text{mixt}}$ and $G_{\text{mixt}}^w$, respectively. Note that Assumption 2 with $F_0 = F_{cal}$ entails $G_0 = I$. If $F_0 \neq F_{cal}$, we still have $G_0^{w*} = I$ when $w^*$ is the oracle weight function.

The two following assumptions are classical when studying the asymptotic of multiple testing procedures (Genovese and Wasserman, 2002).
**Assumption 5.** $G_{\text{mixt}}$ is strictly concave on $(0, 1)$.

**Assumption 6.** $G_{\text{mixt}}^w$ is strictly concave on $(0, 1)$.

As shown in Chi (2007); Neuvial (2008) in the independent case, there is a critical value for the BH procedure given by $\alpha^* = [G'_{\text{mixt}}(0^+)]^{-1}$; the central limit theorem for the FDP/TDP of BH procedure at level $\alpha$ can only be obtained if $\alpha > \alpha^*$ (for $\alpha < \alpha^*$, the BH procedure at level $\alpha$ has asymptotically no power). We will show below that this quantity plays a similar role in the (dependent) conformal setting and prove results only if $\alpha > \alpha^*$.

Finally, as in Neuvial (2008), we consider also the following thresholds

$$ \mathcal{T}_{\alpha} = \sup \left\{ t \in (0, 1), G_{\text{mixt}}(t) \geq \frac{t}{\alpha} \right\}; \qquad (23) $$

$$ \mathcal{T}_{\alpha}^{w} = \sup \left\{ t \in (0, 1), G_{\text{mixt}}^{w}(t) \geq \frac{t}{\alpha} \right\}, \qquad (24) $$

which are well defined (and belong to $(0, 1)$) under Assumption 5 if $\alpha > [(G_{\text{mixt}})'(0^+)]^{-1}$ and Assumption 6 if $\alpha > [(G_{\text{mixt}})^{(0^+)}]^{-1}$, respectively.

## 4.2. Main results

When $P_0 = P_{\text{cal}}$ (no distribution shift), the following result holds for the regular Bates et al. (2023) procedure.

**Theorem 4.1.** Under Assumption 2 with $P_0 = P_{\text{cal}}$, Assumption 3 and Assumption 5, let us consider $\mathcal{R}_\alpha$ the BH procedure at level $\alpha$ applied to the conformal p-values (4), with a level $\alpha > [G'_{\text{mixt}}(0^+)]^{-1}$. If $n/(n+m) \to \sigma^2 \in [0, 1]$ and $\pi_0(m) \to \pi_0 \in (0, 1)$, we have

$$ \sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)}(\mathcal{R}_\alpha) - \pi_0 \alpha) \xrightarrow[\tau_{n,m} \to +\infty]{\mathcal{L}} \mathcal{N} \left( 0, \alpha^2 \pi_0 \left[ \sigma^2 + (1-\sigma^2)\pi_0 \right] \frac{1-\mathcal{T}_\alpha}{\mathcal{T}_\alpha} \right); \qquad (25) $$

$$ \sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)}(\mathcal{R}_\alpha) - G(\mathcal{T}^*)) \xrightarrow[\tau_{n,m} \to +\infty]{\mathcal{L}} \mathcal{N} \left( 0, \frac{\Sigma_\alpha}{(\alpha^{-1} - G'_{\text{mixt}}(\mathcal{T}_\alpha))^2} \right), \qquad (26) $$

$$ \text{with } \Sigma_\alpha = G'(\mathcal{T}_\alpha)^2 \mathcal{T}_\alpha (1 - \mathcal{T}_\alpha) [\pi_0 \sigma^2 + (1 - \sigma^2) \alpha^{-2}] + [\alpha^{-1} - \pi_0]^2 (1 - \pi_0)^{-1} G(\mathcal{T}_\alpha) (1 - G(\mathcal{T}_\alpha)) \sigma^2. $$

Theorem 4.1 is a direct corollary of Proposition 5.3, itself proved in Section 5.2.3. It relies on the pipeline introduced by Neuvial (2008), which consists in first deriving a functional central limit theorem for the e.c.d.f. of the p-values and then to use the functional delta method (van der Vaart, 1998).

Interestingly, under the assumptions of Theorem 4.1 and if $\sigma^2 > 0$, (25) yields

$$ \sqrt{m} (\text{FDP}_m^{(n)}(\mathcal{R}_\alpha) - \pi_0 \alpha) \xrightarrow[\tau_{n,m} \to +\infty]{\mathcal{L}} \mathcal{N} \left( 0, \alpha^2 \pi_0 \left[ 1 + (\sigma^2 - 1)\pi_0 \right] \frac{1 - \mathcal{T}_\alpha}{\mathcal{T}_\alpha} \right). $$

When $\sigma = 1$ (that is $n/m \to \infty$), we note that the FDP convergence is the same as when the p-values are independent (Neuvial, 2008). However, when $n/m$ is bounded, the asymptotic variance is affected by the dependence and gets larger when $\sigma$ decreases (that is, $n/m$ decreases). This is coherent with results on FDP convergence in literature dealing with dependency structure: the (positive) dependence is shown to increase the dispersion of the FDP, see Delattre and Roquain (2011, 2016) among others.

Under distribution shift, the following result holds.

**Theorem 4.2.** Under Assumptions 2 and 6, assume that $P_0$ is absolutely continuous with respect to $P_{\text{cal}}$ and that the oracle weight function $w^*$ (11) satisfies Assumptions 3 and 4. Consider the
BH procedure at level $\alpha$ applied to the oracle weighted p-values $(p_i^{w^*,(n)})_{i \in [m]}$ (6), with a level $\alpha > [(G_{mixt}^{w^*})'(0^+)]^{-1}$. Then if $n/(n+m) \to \sigma^2 \in [0,1]$ and $\pi_0(m) \to \pi_0 \in (0,1)$, we have

$$ \sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)}(\mathcal{R}_\alpha^{w^*}) - \pi_0\alpha) \xrightarrow[\tau_{n,m} \to +\infty]{\mathcal{L}} \mathcal{N} \left( 0, \alpha^2 \pi_0 \Xi_\alpha^{w^*} \frac{1 - \mathcal{T}_\alpha^{w^*}}{\mathcal{T}_\alpha^{w^*}} \right); \quad (27) $$

$$ \sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)}(\mathcal{R}_\alpha^{w^*}) - G^{w^*}(\mathcal{T}_\alpha^{w^*})) \xrightarrow[\tau_{n,m} \to +\infty]{\mathcal{L}} \mathcal{N} \left( 0, \frac{\sum_{\alpha}^{w^*}}{(\alpha^{-1} - (G_{\text{mixt}}^{w^*})'(\mathcal{T}_\alpha^{w^*}))^2} \right), \quad (28) $$

where we denote

$$ \Xi_{\alpha}^{w^*} = \sigma^2 + (1 - \sigma^2) \rho^{w^*} \pi_0 \frac{I^{w^*}(\mathcal{T}_{\alpha}^{w^*}) \mathcal{T}_{\alpha}^{w^*-1} + \mathcal{T}_{\alpha}^{w^*} - 2I^{w^*}(\mathcal{T}_{\alpha}^{w^*})}{1 - \mathcal{T}_{\alpha}^{w^*,*}}; $$

$$ \Sigma_{\alpha}^{w^*} = ((G^{w^*})'(\mathcal{T}_{\alpha}^{w^*}))^2 \mathcal{T}_{\alpha}^{w^*} (1 - \mathcal{T}_{\alpha}^{w^*}) \pi_0 \sigma^2 \\ + (\rho^{w^*} (G^{w^*})'(\mathcal{T}_{\alpha}^{w^*}) \alpha^{-1})^2 [\mathcal{T}_{\alpha}^{w^*} - I^{w^*} (\mathcal{T}_{\alpha}^{w^*})^2] (1 - \sigma^2) \\ + [\alpha^{-1} - \pi_0]^2 (1 - \pi_0)^{-1} G^{w^*} (\mathcal{T}_{\alpha}^{w^*}) (1 - G^{w^*} (\mathcal{T}_{\alpha}^{w^*})) \sigma^2. $$

Theorem 4.2 is proved in Section 5.2.4. The Bates et al. (2023) procedure with (similar) weighted conformal p-values has been studied in Jin and Candès (2023) and they obtained a convergence of FDR and FDP to quantities analogue to $\pi_0\alpha$ and $G^{w^*}(\mathcal{T}_\alpha^{w^*})$, respectively. By contrast, Theorem 4.2 provides the full asymptotic distribution.

While Theorem 4.2 focuses on the oracle weight function, the non-oracle case is deferred to Section D, see Theorem D.2.

# 5. Proofs

In this section, we prove the main results of the paper. They rely on a particular decomposition of the FCP/FDP into two processes that further jointly converge. Applying the functional delta method (van der Vaart, 1998) then allows to conclude.

## 5.1. Proofs for Section 3

### 5.1.1. FCP decomposition

To emphasize that the FCP is the e.c.d.f. of $(p_i^{(n)})_{i \in [m]}$, we let for all $n \ge 1$ and $m \ge 1$,

$$ \hat{G}_m^{(n)} := \frac{1}{m} \sum_{i=1}^{m} 1_{p_i^{(n)} \le t} = \text{FCP}_m^{(n)}(t), \quad t \in [0,1]. \quad (29) $$

We also introduce, for all $n \ge 1$ and $m \ge 1$,

$$ \hat{F}_{\text{cal}}^{(n)}(t) = \frac{1}{n+1} \sum_{k=1}^{n} 1_{S_k \le t}, \quad t \in \mathbb{R}, \quad (30) $$

$$ \hat{F}_{m, \text{test}}(t) = \frac{1}{m} \sum_{i=1}^{m} 1_{T_i \le t}, \quad t \in \mathbb{R}, \quad (31) $$

corresponding to the e.c.d.f. of the calibration score sample and test score sample, respectively. Note that we have $p_i^{(n)} = 1 - \hat{F}_{\text{cal}}^{(n)}(T_i)$ almost surely (under Assumption 1 to ensure that there are no ties almost surely).
By Lemma F.1 we have that $p_i^{(n)} \le t$ if and only if $T_i > (\hat{F}_{cal}^{(n)})^{-1}(1-t)$ for all $t \in (0,1)$. Recalling (13), this leads to the following decomposition for $\hat{G}_m^{(n)}$: for all $t \in (0,1)$,

$$ 
\begin{aligned}
\hat{G}_m^{(n)}(t) - G(t) &= \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{p_i^{(n)} \le t} - G(t) \\
&= \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{(\hat{F}_{cal}^{(n)})^{-1}(1-t) < T_i} - (1 - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t)) \\
&= 1 - \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{(\hat{F}_{cal}^{(n)})^{-1}(1-t) \ge T_i} - (1 - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t)) \\
&= F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t) - \hat{F}_{m,\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t).
\end{aligned}
$$

Hence, it follows

$$ 
\begin{aligned}
\hat{G}_m^{(n)}(t) - G(t) &= F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t) - \hat{F}_{m,\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t) \\
&\quad + F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t) - F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t).
\end{aligned}
$$

Finally, we obtain the decomposition

$$ 
\begin{aligned}
\sqrt{\tau_{n,m}} (\hat{G}_m^{(n)}(t) - G(t)) &= - \sqrt{\frac{\tau_{n,m}}{m}} \sqrt{m} (\hat{F}_{m,\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t) - F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t)) \\
&\quad - \sqrt{\frac{\tau_{n,m}}{n}} \sqrt{n} (F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-t) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-t)).
\end{aligned}
\quad (32) $$

### 5.1.2. Joint convergence

Thanks to (32), in order to obtain a convergence result for $\sqrt{\tau_{n,m}} (\hat{G}_m^{(n)} - G)$, we only need to derive the joint convergence of the two processes delineated in the decomposition (32).

**Proposition 5.1.** Under Assumptions 1 and 3 we have,

$$ \left( \begin{array}{c} \sqrt{m} \left[ \hat{F}_{m,\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) \right] \\ \sqrt{n} \left[ F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I) \right] \end{array} \right) \stackrel{\mathcal{L}}{\to} \left( \begin{array}{c} U \circ G \\ G'V \\ \sigma^2 \\ 1 - \sigma^2 \end{array} \right) \text{ on } [D(0,1)]^2, \quad (33) $$

where $U$ and $V$ are two independent Brownian bridges.

Proposition 5.1 is proved in Section B.1. The main idea of the proof is to study each coordinate separately and then to use independence to obtain a joint convergence. The process of the first coordinate (test term) is studied by using the Donsker Theorem for $\hat{F}_{m,\text{test}}$ and the continuous mapping theorem with a random change of time (Lemma E.10). The second coordinate (calibration term) is investigated by using the Donsker theorem for $(\hat{F}_{cal}^{(n)})^{-1}$ and then using the functional delta method with the map $\phi \mapsto F_{\text{test}} \circ \phi$ (Lemma E.5).

### 5.1.3. Proof of Theorem 3.2

Thanks to Proposition 5.1 we have $U$ and $V$ two independent standard Brownian bridges such that (33) holds. Since $n/(n+m) \to \sigma^2 \in [0,1]$ and $\tau_{n,m}/n \to 1 - \sigma^2 \in [0,1]$ by assumption, we obtain by Slutsky's Lemma

$$ \left( \begin{array}{c} \sqrt{m} \left[ \hat{F}_{m,\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) \right] \\ \sqrt{n} \left[ F_{\text{test}} \circ (\hat{F}_{cal}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I) \right] \\ \frac{\tau_{n,m}}{\frac{m}{\tau_{n,m}}} \\ \frac{\tau_{n,m}}{n} \end{array} \right) \stackrel{\mathcal{L}}{\to} \left( \begin{array}{c} U \circ G \\ G'V \\ \sigma^2 \\ 1 - \sigma^2 \end{array} \right) \text{ on } [D(0,1)]^2 \times [0,1]^2. $$

The result follows by applying the continuous mapping theorem with the decomposition (32).
### 5.1.4. Proof of Theorem 3.1

Up to consider a subsequence, one can assume that $n/(n+m) \to \sigma^2 \in [0, 1]$. The result thus follows from Theorem 3.2 in the special case $F_{cal} = F_{test}$, because $G = I$ in this case, and $\sigma U + \sqrt{1-\sigma^2}V$ is a standard Brownian bridge.

### 5.1.5. Proof of Theorem 3.3

For weighted conformal p-values, we introduce

$$ \hat{G}_{m}^{w,(n)}(t) := \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{p_{i}^{w,(n)} \le t} = \text{FCP}_{m}^{w,(n)}(t), \quad t \in \mathbb{R}; \qquad (34) $$

$$ \hat{F}_{\text{cal}}^{w,(n)}(t) := \frac{\sum_{k=1}^{n} w(S_k) \mathbb{1}_{S_k \le t}}{w(+\infty) + \sum_{k=1}^{n} w(S_k)}, \quad t \in \mathbb{R}, \qquad (35) $$

the counterparts of $\hat{G}_{m}^{(n)}$ (29) and $\hat{F}_{\text{cal}}^{(n)}$ (30) in the weighted case, respectively. Note that $p_{i}^{w,(n)} = 1 - \hat{F}_{\text{cal}}^{w,(n)}(T_i)$ almost surely under Assumption 1. Hence, the following decomposition, analogue to (32), holds:

$$ \sqrt{\tau_{n,m}} (\hat{G}_{m}^{w,(n)}(t) - G^{w}(t)) = - \sqrt{\frac{\tau_{n,m}}{m}} \sqrt{m} (\hat{F}_{m,\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-t) - F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-t)) \\ - \sqrt{\frac{\tau_{n,m}}{n}} \sqrt{n} (F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-t) - F_{\text{test}} \circ (F_{\text{cal}}^{w})^{-1}(1-t)). \qquad (36) $$

Thus, the novelty of (36) with respect to (32) is only the presence of $(\hat{F}_{\text{cal}}^{w,(n)})^{-1}$ instead of $(\hat{F}_{\text{cal}}^{(n)})^{-1}$. By Assumption 4, we can show that the family of function $\mathcal{F} = \{w_t : x \in \mathbb{R} \mapsto w(x) \mathbb{1}_{x \le t}; t \in \mathbb{R}\}$ is $P_{\text{cal}}$-Donsker and $P_{\text{cal}}$-Glivenko-Cantelli. Since $\mathcal{F}$ is Glivenko-Cantelli, the convergence of the test term happens with the same argument in the unweighted case. Because this class is Donsker, using twice the functional delta method gives us that $(\sqrt{n}[(\hat{F}_{\text{cal}}^{w,(n)})^{-1} - (F_{\text{cal}}^{w})^{-1}])_n$ converges in distribution to some known random process on the set $D(0, 1)$. This result is stated and then proved in Lemma C.1. This leads to the joint convergence Proposition C.2, which is the analogue of Proposition 5.1 in the weighted case. Theorem 3.3 is thus proved by applying the continuous mapping theorem to the decomposition (36).

## 5.2. Proofs for Section 4

### 5.2.1. FDP expression

We introduced, as in the works from Genovese and Wasserman (2004) and Neuvial (2008), $\hat{G}_{m,0}^{(n)}$ and $\hat{G}_{m,1}^{(n)}$ the two e.c.d.f.'s of conformal p-values for non-novelties and novelties, respectively:

$$ \hat{G}_{m,0}^{(n)}(t) := \frac{1}{m_0(m)} \sum_{i \in [m] \cap \mathcal{H}_0} \mathbb{1}_{p_i^{(n)} \le t}, \quad t \in (0, 1), \qquad (37) $$

$$ \hat{G}_{m,1}^{(n)}(t) := \frac{1}{m_1(m)} \sum_{i \in [m] \cap \mathcal{H}_1} \mathbb{1}_{p_i^{(n)} \le t}, \quad t \in (0, 1). \qquad (38) $$

We also introduce the mixture e.c.d.f. of the test sample

$$ \hat{G}_{m}^{(n)}(t) = \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{p_{i}^{(n)} \le t} = \pi_{0}(m) \hat{G}_{m,0}^{(n)}(t) + (1 - \pi_{0}(m)) \hat{G}_{m,1}^{(n)}(t), \quad t \in (0, 1). \qquad (39) $$
For all $t \in (0, 1)$, we denote simply $\text{FDP}_m^{(n)}(t) := \text{FDP}_m^{(n)}(\{i \in [m], p_i^{(n)} \le t\})$ (resp. $\text{TDP}_m^{(n)}(t) := \text{TDP}_m^{(n)}(\{i \in [m], p_i^{(n)} \le t\})$) the FDP (resp. TDP) of the procedure rejecting all the conformal $p$-values smaller than $t$, see (9) and (10). The following equalities hold:

$$ \text{FDP}_m^{(n)}(t) = \frac{\pi_0(m)\hat{G}_{m,0}^{(n)}(t)}{\hat{G}_m^{(n)}(t) \vee m^{-1}}, \quad t \in (0,1), $$

$$ \text{TDP}_m^{(n)}(t) = \hat{G}_{m,1}^{(n)}(t), \quad t \in (0,1). $$

Following Neuvial (2008), and since the novelty detection procedure from Bates et al. (2023) is the BH procedure applied to conformal $p$-values, we can be described it as a thresholding procedure with threshold $\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)})$, where the functional $\mathcal{T}^{\text{BH}_\alpha}$ is defined by

$$ \mathcal{T}^{\text{BH}_\alpha}(F) := \sup \left\{ t \in [0,1], F(t) \ge \frac{t}{\alpha} \right\}. \quad (40) $$

In other words, we have $\mathcal{R}_\alpha = \{i \in [m] : p_i^{(n)} \le \mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)})\}$ and $\text{FDP}_m^{(n)}(\mathcal{R}_\alpha) = \text{FDP}_m^{(n)}(\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)}))$ with the notation above.

### 5.2.2. Joint convergence and application to the FDP and TDP

Following Neuvial (2008), $G \mapsto \mathcal{T}^{\text{BH}_\alpha}(G)$ and $G \mapsto \text{FDP}_m^{(n)}(\mathcal{T}^{\text{BH}_\alpha}(G))$ are Hadamard differentiable at $G_{\text{mixt}}$ provided that $G_{\text{mixt}}$ is concave and differentiable and that $\alpha > [G'_{\text{mixt}}(0^+)]^{-1}$. The following result complete the picture by studying the convergence of $\hat{G}_m^{(n)}$.

**Proposition 5.2.** Under Assumptions 2 and 3, assuming that $n/(n+m) \to \sigma^2 \in [0,1]$ and $\pi_0(m) \to \pi_0 \in (0,1)$, we have

$$ \sqrt{\tau_{n,m}} \left( \hat{G}_{m,0}^{(n)} - I \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \left( \frac{\sigma}{\sqrt{1-\sigma^2}} U + \sqrt{1-\sigma^2} W \right) =: \left( \frac{Z_0}{Z_1} \right) \quad \text{on } [D(0,1)]^2, $$

with $U, V$ and $W$ three independent Brownian bridges. As a result,

$$ \sqrt{\tau_{n,m}} (\hat{G}_m^{(n)} - G_{\text{mixt}}) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \sqrt{\pi_0 \sigma^2} U + \sqrt{(1-\pi_0) \sigma^2} V_G + G'_{\text{mixt}} \sqrt{1-\sigma^2} W \\ = \pi_0 Z_0 + (1-\pi_0) Z_1 =: Z \quad \text{on } D(0,1). $$

Proposition 5.2 is proved in Section B.2. The proof is similar to Proposition 5.1, with the additional technicality that the decomposition (32) should be considered for the two processes $\hat{G}_{m,0}^{(n)}$ and $\hat{G}_{m,1}^{(n)}$. The fact that these decompositions are based on the same process $\hat{F}_{\text{cal}}^{(n)}$ induces a dependence between the components that results in the term $W$ in the asymptotic variance.

By using the functional delta method theorem with the BH functionals described above (see Neuvial (2008), supplementary files from Delattre and Roquain (2016) and Lemma S.2.2 from Kluger and Owen (2024)), we obtain the following result.

**Proposition 5.3.** Under Assumptions 2, 3 and 5, assume that BH is applied with a level $\alpha > [G'_{\text{mixt}}(0^+)]^{-1}$. If $n/(n+m) \to \sigma^2 \in [0,1]$ and $\pi_0(m) \to \pi_0 \in (0,1)$, we have the following convergences:

$$ \sqrt{\tau_{n,m}} (\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)}) - \mathcal{T}_\alpha) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{1}{\alpha - G'_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}(\mathcal{T}_\alpha); \\ \sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)}(\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)})) - \pi_0 \alpha) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{\pi_0}{G_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}_0(\mathcal{T}_\alpha); \\ \sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)}(\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)})) - G(\mathcal{T}_\alpha)) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{G'(\mathcal{T}_\alpha)}{\alpha - G'_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}(\mathcal{T}_\alpha) + \mathbb{Z}_1(\mathcal{T}_\alpha), $$

where $\mathcal{T}_\alpha = \mathcal{T}^{\text{BH}_\alpha}(G_{\text{mixt}})$ and $\mathbb{Z}_0, \mathbb{Z}_1$ and $\mathbb{Z}$ are the three processes defined in Proposition 5.2.
Proposition 5.3 is proved in Section B.3. As a sanity check, we see that Proposition 5.3 reduces to the result of Neuvial (2008) when $n/m$ tends to infinity ($\sigma^2 = 1$).

### 5.2.3. Proof of Theorem 4.1

Theorem 4.1 is obtained from Proposition 5.3 by computing the different asymptotic covariance functions. For this, we use that $(\mathbb{Z}_0, \mathbb{Z}_1, \mathbb{Z})$ can be written as

$$ \begin{pmatrix} \mathbb{Z}_0 \\ \mathbb{Z}_1 \\ \mathbb{Z} \end{pmatrix} = \begin{pmatrix} \frac{\sigma}{\sqrt{\pi_0}} \mathbb{U} + \sqrt{1 - \sigma^2} \mathbb{W} \\ \frac{\sigma}{\sqrt{1-\pi_0}} \mathbb{V}_G + G' \sqrt{1-\sigma^2} \mathbb{W} \\ \sqrt{\pi_0 \sigma^2} \mathbb{U} + \sqrt{(1-\pi_0) \sigma^2} \mathbb{V}_G + G'_{\text{mixt}} \sqrt{1-\sigma^2} \mathbb{W} \end{pmatrix}, $$

with $\mathbb{U}$, $\mathbb{V}$ and $\mathbb{W}$ being three independent standard Brownian bridges. The result follows from direct computations.

### 5.2.4. Proof of Theorem 4.2

Proving Theorem 4.2 is analogue to the proof of Theorem 4.1 above, but starting from weighted processes. For short, the full description of the proof is postponed to Section C.3. Therein, Propositions C.3 and C.4 are the analogues of Propositions 5.2 and 5.3, respectively.

## 6. Conclusion

In this paper we obtained the exact asymptotic distribution of FCP and FDP for conformal inference methods when both the sizes of the calibration sample and test sample grow simultaneously. Our theory covered both the prediction and novelty detection settings, including a potential distribution shift. Our results quantified exactly how the covariance process is affected by the dependence inherent to the conformal settings, that use the same calibration sample for all the test examples. First, we proved that the convergence rate $\tau_{n,m}$ can be largely deteriorated when $n/m$ vanishes to zero (that is, $\sigma = 0$). Otherwise, when $n$ and $m$ are of the same order, the convergence rate is the usual one $(m^{1/2})$, but the asymptotic covariance is affected. Nevertheless, when $n/m$ tends to infinity, the convergence is strictly the same as in the usual independent case. Interestingly, our results can be used to calibrate easily and accurately quantiles for controlling an error amount when performing conformal inference with large $n$ and $m$. We also quantified the effects of doing conformal inference while there is a distribution shift between the calibration sample and the test sample. We exhibits how this distribution shift acts on the asymptotic behaviour of the FCP, by changing the mean and the variance, and how the correction with weighted conformal $p$-values impacts the asymptotic variance.

While our work paves the way for studying asymptotic convergences in conformal inferences, it left some open directions for future research. For instance, in case of a distribution shift, the oracle weight function is mostly unknown, and is often estimated (Jin and Candès, 2023). Finding the exact asymptotic distribution for the processes using estimated weights is a very interesting and challenging problem for future investigations.

## Acknowledgements

I am grateful to Étienne Roquain for his precious advices and reviews throughout this work. I wish to thank Gilles Blanchard and Sylvain Delattre for their comments, and Magalie Fromont for fruitful discussions. I acknowledge the Emergence project MARS of Sorbonne Université.
References

Angelopoulos, A. N. and Bates, S. (2021). A gentle introduction to conformal prediction and distribution-free uncertainty quantification. *arXiv preprint arXiv:2107.07511*.

Balasubramanian, V., Ho, S.-S., and Vovk, V. (2014). *Conformal prediction for reliable machine learning: theory, adaptations and applications*. Morgan Kaufmann books.

Barber, R. F., Candes, E. J., Ramdas, A., and Tibshirani, R. J. (2023). Conformal prediction beyond exchangeability. *The Annals of Statistics*, 51(2):816–845.

Bates, S., Candès, E. R., Lei, L., Romano, Y., and Sesia, M. (2023). Testing for outliers with conformal p-values. *Ann. Statist.*, 51(1):149–178.

Benjamini, Y. and Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. *J. Roy. Statist. Soc. Ser. B*, 57(1):289–300.

Billingsley, P. (1999). *Convergence of probability measures*. Wiley Series in Probability and Statistics: Probability and Statistics. John Wiley & Sons Inc., New York, second edition. A Wiley-Interscience Publication.

Chi, Z. (2007). On the performance of FDR control: constraints and a partial solution. *Ann. Statist.*, 35(4):1409–1431.

Delattre, S. and Roquain, E. (2011). On the false discovery proportion convergence under Gaussian equi-correlation. *Statist. Probab. Lett.*, 81(1):111–115.

Delattre, S. and Roquain, E. (2016). On empirical distribution function of high-dimensional Gaussian vector components with an application to multiple testing. *Bernoulli*, 22(1):302–324.

Donsker, M. D. (1952). Justification and extension of Doob's heuristic approach to the Komogorov-Smirnov theorems. *Ann. Math. Statistics*, 23:277–281.

Gazin, U., Blanchard, G., and Roquain, E. (2024). Transductive conformal inference with adaptive scores. In Dasgupta, S., Mandt, S., and Li, Y., editors, *Proceedings of The 27th International Conference on Artificial Intelligence and Statistics*, volume 238 of *Proceedings of Machine Learning Research*, pages 1504–1512. PMLR.

Genovese, C. and Wasserman, L. (2002). Operating characteristics and extensions of the false discovery rate procedure. *J. R. Stat. Soc. Ser. B Stat. Methodol.*, 64(3):499–517.

Genovese, C. and Wasserman, L. (2004). A stochastic process approach to false discovery control. *Ann. Statist.*, 32(3):1035–1061.

Huang, K., Jin, Y., Candes, E., and Leskovec, J. (2024). Uncertainty quantification over graph with conformalized graph neural networks. *Advances in Neural Information Processing Systems*, 36.

Jin, Y. and Candès, E. J. (2023). Model-free selective inference under covariate shift via weighted conformal p-values. *arXiv preprint arXiv:2307.09291*.

Kluger, D. M. and Owen, A. B. (2024). A central limit theorem for the benjamini-hochberg false discovery proportion under a factor model. *Bernoulli*, 30(1):743–769.

Marandon, A., Lei, L., Mary, D., and Roquain, E. (2024). Adaptive novelty detection with false discovery rate guarantee. *The Annals of Statistics*, 52(1):157–183.

Marques F., P. C. (2023). On the universal distribution of the coverage in split conformal prediction. *arXiv preprint 2303.02770*.

Mary, D. and Roquain, E. (2022). Semi-supervised multiple testing. *Electronic Journal of Statistics*, 16(2):4926–4981.

Neuvial, P. (2008). Asymptotic properties of false discovery rate controlling procedures under independence. *Electron. J. Stat.*, 2:1065–1110.

Nguyen, D. T., Pathak, R., Angelopoulos, A. N., Bates, S., and Jordan, M. I. (2024). Data-adaptive tradeoffs among multiple risks in distribution-free prediction. *arXiv preprint arXiv:2403.19605*.

Papadopoulos, H., Proedrou, K., Vovk, V., and Gammerman, A. (2002). Inductive confidence machines for regression. In *13th European Conference on Machine Learning (ECML 2002)*, pages 345–356. Springer.

Romano, J. P. and Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. *J. Amer. Statist. Assoc.*, 100(469):94–108.

Saunders, C., Gammerman, A., and Vovk, V. (1999). Transduction with confidence and credibility.
In *16th International Joint Conference on Artificial Intelligence (IJCAI 1999)*, pages 722–726.

Shorack, G. R. and Wellner, J. A. (1986). *Empirical processes with applications to statistics*. Wiley Series in Probability and Mathematical Statistics: Probability and Mathematical Statistics. John Wiley & Sons Inc., New York.

Storey, J. D. (2002). A direct approach to false discovery rates. *J. R. Stat. Soc. Ser. B Stat. Methodol.*, 64(3):479–498.

Tibshirani, R. J., Foygel Barber, R., Candes, E., and Ramdas, A. (2019). Conformal prediction under covariate shift. *Advances in neural information processing systems*, 32.

van der Vaart, A. W. (1998). *Asymptotic statistics*, volume 3 of *Cambridge Series in Statistical and Probabilistic Mathematics*. Cambridge University Press, Cambridge.

van der Vaart, A. W. and Wellner, J. A. (1996). *Weak convergence and empirical processes*. Springer Series in Statistics. Springer-Verlag, New York. With applications to statistics.

Vovk, V. (2013). Transductive conformal predictors. In *Artificial Intelligence Applications and Innovations: 9th IFIP WG 12.5 International Conference (AIAI 2013)*, pages 348–360. Springer.

Vovk, V., Gammerman, A., and Shafer, G. (2005). *Algorithmic learning in a random world*. Springer.
## Appendix A: Standardisation lemma

In this section, we introduce the standardisation lemma, which will be extensively used in our proofs. Let us introduce the notation

$$F_{\text{test,cal}}(t) = F_{\text{test}} \circ F_{\text{cal}}^{-1}(t), t \in [0, 1]; \qquad (41)$$

$$F_{0,\text{cal}}(t) = F_0 \circ F_{\text{cal}}^{-1}(t), t \in [0, 1], \qquad (42)$$

where by convention $F_{\text{cal}}^{-1}(0)$ denotes the infimum of the support of the distribution given by $F_{\text{cal}}$ and $F_{\text{test,cal}}(1) = F_{0,\text{cal}}(1) = 1$. The following lemma holds.

**Lemma A.1.** Consider either the prediction setting with Assumption 1 (with parameters $F_{\text{cal}}$, $F_{\text{test}}$) or the novelty detection setting with Assumption 2 (with parameters $F_{\text{cal}}$, $F_{\text{test}}$, $F_0$). If $F_{\text{cal}}$, $F_{\text{test}}$ satisfy Assumption 3, for any weight function $w: \mathbb{R} \cup \{\infty\} \to \mathbb{R}^+$ with $w(+\infty) > 0$, the distribution of the w-weighted conformal p-value family under the parameters $F_{\text{cal}}$, $F_{\text{test}}$ (and $F_0$) is the same as the $w \circ F_{\text{cal}}^{-1}$-weighted conformal p-value family under the parameters $F_{\text{cal}} = I$, $F_{\text{test}} = F_{\text{test,cal}}$ (and $F_0 = F_{0,\text{cal}}$).

*Proof of Lemma A.1.* Since $F_{\text{cal}}$ is continuous increasing on its support, we can write almost surely

$$\sum_{k \in [n]} w(S_k) \mathbb{1}_{S_k \ge T_i} = \sum_{k \in [n]} (w \circ F_{\text{cal}}^{-1})(F_{\text{cal}}(S_k)) \mathbb{1}_{F_{\text{cal}}(S_k) \ge F_{\text{cal}}(T_i)} \\ = \sum_{k \in [n]} (w \circ F_{\text{cal}}^{-1})(S'_k) \mathbb{1}_{S'_k \ge T'_i},$$

with $S'_k = F_{\text{cal}}(S_k)$ which are iid uniform and $T'_i = F_{\text{cal}}(T_i)$ which are iid $\sim F_{\text{test,cal}}$ (or either $\sim F_{0,\text{cal}}$ under the null or $\sim F_{\text{test,cal}}$ under the alternative, in the novelty detection setting). $\square$

## Appendix B: Proofs of auxiliary results

In this section, we prove Proposition 5.1, Propositions 5.2 and 5.3. Proofs for the weighted case are given in Section C.

### B.1. Proof of Proposition 5.1

First, the Donsker theorem (Theorem E.3) provides

$$\sqrt{m} \left( \hat{F}_{m, \text{test}} - F_{\text{test}} \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \mathbb{U} \circ F_{\text{test}} \text{ on } D(\mathbb{R}),$$

with $\mathbb{U}$ being a standard Brownian bridge. Moreover, by the Glivenko-Cantelli theorem, we have that $(\hat{F}_{\text{cal}}^{(n)})_n$ converges in probability on $\ell^\infty(\mathbb{R})$ to $F_{\text{cal}}$. Since by Assumption 3 the inverse map is continuous at $F_{\text{cal}}$ we obtain that $((\hat{F}_{\text{cal}}^{(n)})^{-1})_n$ converges in probability on $D(0, 1)$ to $F_{\text{cal}}^{-1}$.

Second, applying again the Donsker theorem (Theorem E.3), we have

$$\sqrt{n} \left( \hat{F}_{\text{cal}}^{(n)} - F_{\text{cal}} \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \mathbb{V} \circ F_{\text{cal}} \text{ on } D(\mathbb{R}),$$

with $\mathbb{V}$ a standard Brownian bridge independent of $\mathbb{U}$. Now, by using the functional delta method with the inverse map (see Lemma E.6) by Assumption 3, we obtain,

$$\sqrt{n} \left( (\hat{F}_{\text{cal}}^{(n)})^{-1} - F_{\text{cal}}^{-1} \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} (F_{\text{cal}}^{-1})' \mathbb{V} \text{ on } D(0,1), \qquad (43)$$

where $(F_{\text{cal}}^{-1})'$ denotes the derivative of $F_{\text{cal}}^{-1}$. Again, we use the Hadamard differentiability of the map $\varphi \mapsto F_{\text{test}} \circ \varphi$ which is true by Assumption 3 (see Lemma E.5) to obtain

$$\sqrt{n} \left( F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1} - F_{\text{test}} \circ F_{\text{cal}}^{-1} \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} F_{\text{test}}' \circ F_{\text{cal}}^{-1} (F_{\text{cal}}^{-1})' \mathbb{V} = (F_{\text{test}} \circ F_{\text{cal}}^{-1})' \mathbb{V} \text{ on } D(0,1).$$
Since for all $t \in (0, 1)$, $G'(t) = (F_{\text{test}} \circ F_{\text{cal}}^{-1})'(1-t)$ and since $\mathbb{V}$ is a standard Brownian bridge if and only if $(\mathbb{V}_t)_t = (\mathbb{V}_{1-t})_t$ is a standard Brownian bridge we obtain the second term in (33). Finally, since $\mathcal{D}_{\text{cal}}$ and $\mathcal{D}_{\text{test}}$ are independent, we obtain the joint convergence:

$$ \left( \begin{array}{c} \sqrt{m} [\hat{F}_{m,\text{test}} - F_{\text{test}}] \\ \sqrt{n} [F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I)] \end{array} \right) \xrightarrow{\mathcal{L}} \left( \begin{array}{c} \mathbb{U} \circ F_{\text{test}} \\ G'\mathbb{V} \end{array} \right) \quad \text{on } D(\mathbb{R}) \times D(0,1), $$

with $\mathbb{U}$ and $\mathbb{V}$ two independent standard Brownian bridges. By Slutsky's Lemma, we obtain the following joint convergence

$$ \left( \begin{array}{c} \sqrt{m} [\hat{F}_{m,\text{test}} - F_{\text{test}}] \\ \sqrt{n} [F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I)] \\ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) \end{array} \right) \xrightarrow{\mathcal{L}} \left( \begin{array}{c} \mathbb{U} \circ F_{\text{test}} \\ G'\mathbb{V} \\ F_{\text{cal}}^{-1}(1-I) \end{array} \right) \quad \text{on } D(\mathbb{R}) \times D(0,1) \times \ell^{\infty}(0,1). $$

Then, using Lemma E.10, we finally obtain

$$ \left( \begin{array}{c} \sqrt{m} [\hat{F}_{m,\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I)] \\ \sqrt{n} [F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I)] \end{array} \right) \xrightarrow{\mathcal{L}} \left( \begin{array}{c} \mathbb{U} (F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I)) \\ G'\mathbb{V} \end{array} \right) \quad \text{on } [D(0,1)]^2. $$

Since $\mathbb{U}(F_{\text{test}} \circ F_{\text{cal}}^{-1}(1-I))$ has the same distribution as $\mathbb{U}(G)$, we obtain (33).

## B.2. Proof of Proposition 5.2

By using Lemma A.1, one can assume without loss of generality that $P_0 = P_{\text{cal}} = \mathcal{U}(0,1)$ and $P_{\text{test}}$ has for c.d.f. $F_{\text{test,cal}}$. By applying the Donsker theorem (Theorem E.3) with the independent families $(S_k, k \ge 1)$, $(T_i, i \in \mathcal{H}_0)$ and $(T_i, i \in \mathcal{H}_1)$ and following the same reasoning as in the proof of Proposition 5.1, there exist $\mathbb{U}$, $\mathbb{V}$ and $\mathbb{W}$ three independent standard Brownian bridges such that

$$ \left( \begin{array}{c} \sqrt{m_0(m)} [\hat{F}_{m,0,\text{test}} - I] \\ \sqrt{m_1(m)} [\hat{F}_{m,1,\text{test}} - F_{\text{test,cal}}] \\ \sqrt{n} [(\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - (1-I)] \\ \sqrt{n} [F_{\text{test,cal}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test,cal}}(1-I)] \\ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) \end{array} \right) \xrightarrow{\mathcal{L}} \left( \begin{array}{c} \mathbb{U} \\ \mathbb{V}(1-F_{\text{test,cal}}) \\ \mathbb{W} \\ G'\mathbb{W} \\ 1-I \end{array} \right) \quad \text{on } [D(0,1)]^4 \times \ell^{\infty}(0,1), $$

where we denoted $\hat{F}_{m,r,\text{test}}$ the e.c.d.f. of $\{T_i, i \in [m] \cap \mathcal{H}_r\}$ for $r \in \{0,1\}$. Now, by using Lemma E.10 (or more precisely, an obvious extension of it for 5 joint processes), we obtain

$$ \left( \begin{array}{c} \sqrt{m_0(m)} [\hat{F}_{m,0,\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I)] \\ \sqrt{m_1(m)} [\hat{F}_{m,1,\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test,cal}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I)] \\ \sqrt{n} [(\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - (1-I)] \\ \sqrt{n} [F_{\text{test,cal}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test,cal}}(1-I)] \end{array} \right) \xrightarrow{\mathcal{L}} \left( \begin{array}{c} \mathbb{U} \\ \mathbb{V} \circ G \\ \mathbb{W} \\ G'\mathbb{W} \end{array} \right) \quad \text{on } [D(0,1)]^4. $$
Now, $\hat{G}_{m,0}^{(n)}$ (37) and $\hat{G}_{m,1}^{(n)}$ (38) satisfy the following decomposition (obtained similarly to (32)):

$$
\begin{align*}
\sqrt{\tau_{n,m}} [\hat{G}_{m,0}^{(n)} - I] &= -\sqrt{\frac{\tau_{n,m}}{m}} \times \frac{m}{m_0} \sqrt{m_0} [\hat{F}_{m,0,
\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I)] \\
&\quad - \sqrt{\frac{\tau_{n,m}}{n}} \sqrt{n} [(\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - (1-I)], \\
\sqrt{\tau_{n,m}} [\hat{G}_{m,1}^{(n)} - G] &= -\sqrt{\frac{\tau_{n,m}}{m}} \times \frac{m}{m_1} \sqrt{m_1} [\hat{F}_{m,1,
\text{test}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test,cal}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I)] \\
&\quad - \sqrt{\frac{\tau_{n,m}}{n}} \sqrt{n} [F_{\text{test,cal}} \circ (\hat{F}_{\text{cal}}^{(n)})^{-1}(1-I) - F_{\text{test,cal}}(1-I)].
\end{align*}
$$

We conclude by using $m_0/m \to \pi_0 \in (0,1)$, $m_1/m \to 1 - \pi_0 \in (0,1)$, $n/(n+m) \to \sigma^2 \in [0,1]$ and Slutsky's lemma.

### B.3. Proof of Proposition 5.3

By Assumption 5, and since $\alpha > [G'_{\text{mixt}}(0^+)]^{-1}$, the asymptotic threshold $\mathcal{T}_\alpha = \mathcal{T}^{\text{BH}_\alpha}(G_{\text{mixt}})$ is well defined and belongs to $(0,1)$. Now observe that there exists a compact interval $[a,b] \subset (0,1)$ such that

$$ \mathcal{T}_{\alpha} = \sup \left\{ t \in [a, b], G_{\text{mixt}}(t) \ge \frac{t}{\alpha} \right\}, \quad (44) $$

To see this, note that since $G_{\text{mixt}} \le 1$ we have that $\mathcal{T}_\alpha \le \alpha$, hence $\mathcal{T}_\alpha$ is smaller than any $b \in (\alpha, 1)$.
Now, since $\mathcal{T}_\alpha > 0$, any $a \in (0, \mathcal{T}_\alpha)$ leads to $\mathcal{T}_\alpha \in (a, b)$, which leads to (44).

Now consider the functional

$$ \mathcal{T}_{[a,b]}^{\text{BH}\alpha}(F) := \sup \left\{ t \in [a,b], F(t) \ge \frac{t}{\alpha} \right\}, \quad (45) $$

which is similar to (40) but with a restricted range on $t$. Equation (44) hence reads as $\mathcal{T}_\alpha = \mathcal{T}_{[a,b]}^{\text{BH}_\alpha}(G_{\text{mixt}})$. In addition, we have

$$ \left\{ |\hat{G}_m^{(n)}(a) - G_{\text{mixt}}(a)| \le \eta \right\} \subset \left\{ \mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)}) = \mathcal{T}_{[a,b]}^{\text{BH}_\alpha}(\hat{G}_m^{(n)}) \right\}, \quad (46) $$

where $\eta = (G_{\text{mixt}}(a) - a\alpha^{-1})/2$, which is positive by the choice of $a$. Indeed, if $|\hat{G}_m^{(n)}(a) - G_{\text{mixt}}(a)| \le \eta$, we have $\hat{G}_m^{(n)}(a) - a\alpha^{-1} = \hat{G}_m^{(n)}(a) - G_{\text{mixt}}(a) + G_{\text{mixt}}(a) - a\alpha^{-1} \ge \eta$, which implies that $\{|\hat{G}_m^{(n)}(a) - G_{\text{mixt}}(a)| \le \eta\} \subset \{\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)}) > a\}$. This proves (46).

Now, $\mathcal{T}_{[a,b]}^{\text{BH}_\alpha}$ is Hadamard differentiable at $G_{\text{mixt}}$, tangentially to $C[a,b]$ with a derivative coinciding with the one of $\mathcal{T}^{\text{BH}_\alpha}$, that is,

$$ (\dot{\mathcal{T}}_{[a,b]}^{\text{BH}_\alpha})_{G_{\text{mixt}}} = (\dot{\mathcal{T}}^{\text{BH}_\alpha})_{G_{\text{mixt}}}. $$

By the convergence of Proposition 5.2, which holds on $D[a,b]$, we can apply the functional delta method (see Lemma E.9 for the exact expression of derivatives) to obtain

$$
\begin{align*}
\sqrt{\tau_{n,m}} (\mathcal{T}_{[a,b]}^{\text{BH}_\alpha} (\hat{G}_m^{(n)}) - \mathcal{T}_\alpha) &\xrightarrow{\substack{\mathcal{L} \\ \tau_{n,m} \to +\infty}} \frac{1}{\alpha - G'_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}(\mathcal{T}_\alpha); \\
\sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)} (\mathcal{T}_{[a,b]}^{\text{BH}_\alpha} (\hat{G}_m^{(n)})) - \pi_0 \alpha) &\xrightarrow{\substack{\mathcal{L} \\ \tau_{n,m} \to +\infty}} \frac{\pi_0}{G_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}_0(\mathcal{T}_\alpha); \\
\sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)} (\mathcal{T}_{[a,b]}^{\text{BH}_\alpha} (\hat{G}_m^{(n)})) - G(\mathcal{T}_\alpha)) &\xrightarrow{\substack{\mathcal{L} \\ \tau_{n,m} \to +\infty}} \frac{G'(\mathcal{T}_\alpha)}{\alpha - G'_{\text{mixt}}(\mathcal{T}_\alpha)} \mathbb{Z}(\mathcal{T}_\alpha) + \mathbb{Z}_1(\mathcal{T}_\alpha),
\end{align*}
$$

where $\mathbb{Z}_0, \mathbb{Z}_1$ and $\mathbb{Z}$ are the three processes defined in Proposition 5.2. Now, the same convergences hold for $\mathcal{T}^{\text{BH}_\alpha}(\hat{G}_m^{(n)})$ by using (46) because $\hat{G}_m^{(n)}(a)$ converges in probability to $G_{\text{mixt}}(a)$. This concludes the proof.
## Appendix C: Proofs for the weighted case

In this section, we state and prove Lemma C.1, Propositions C.2, C.3 and C.4.

### C.1. Weighted versions of the Glivenko-Cantelli and Donsker theorem.

Recall that $\hat{F}_{cal}^{w,(n)}(t)$ is given by (35). The next result applies both in the prediction and novelty detection settings and will be used to prove Propositions C.2, C.3 and C.4.

**Lemma C.1.** Assume $P_{cal} = \mathcal{U}(0,1)$. Let $w$ a weight function satisfying Assumption 4. Then it holds

$$ (\hat{F}_{cal}^{w,(n)})^{-1} \xrightarrow{\mathbb{P}} (F_{cal}^{w})^{-1} \quad \text{on } \ell^{\infty}(0,1), $$

and

$$ \sqrt{n} \left( (\hat{F}_{cal}^{w,(n)})^{-1} - (F_{cal}^{w})^{-1} \right) \xrightarrow{\mathcal{L}} \left( (F_{cal}^{w})^{-1} \right)' \rho^{w} \left( \mathbb{V} \left( V_{cal}^{w} \circ (F_{cal}^{w})^{-1} \right) + [I - V_{cal}^{w} \circ (F_{cal}^{w})^{-1}] N \right) \quad \text{on } D(0,1), $$

where $\mathbb{V}$ is a standard Brownian bridge and $N$ an independent standard Gaussian random variable.

Note that in the case $w \equiv 1$ (unweighted case), we recover the convergence presented in Corollary E.7, because $F_{cal}^{w} = V_{cal}^{w} = I$.

**Proof of Lemma C.1.** Denote for $n \ge 1$ and $t \in [0,1]$,

$$ K^{(n)}(t) := \frac{1}{n+1} \sum_{k=1}^{n} w(S_k) 1_{S_k \le t}. $$

Since $w$ is uniformly bounded, the family $\mathcal{F} = \{w_t : x \in \mathbb{R} \mapsto w(x) 1_{x \le t}; t \in \mathbb{R}\}$ is $\mathcal{U}(0,1)$-Glivenko-Cantelli, and $(K^{(n)})_n$ converges uniformly on $[0,1]$ in probability to the function $K$ given by $K(t) := \int_0^t w(x) \, dx$ (Shorack and Wellner, 1986). Then, by continuity at $K$ of the map of Lemma E.8, we get that $(K^{(n)}/K^{(n)}(1))_n$ converges uniformly (in probability) to $F_{cal}^w$. Since $\|\hat{F}_{cal}^{w,(n)} - K^{(n)}/K^{(n)}(1)\|_{\infty} \le w(+\infty)/((n+1)K^{(n)}(1) + w(+\infty))$ tends uniformly to 0 a.s., $(\hat{F}_{cal}^{w,(n)})_n$ converges uniformly (in probability) to $F_{cal}^w$. By continuity of the inverse map at $F_{cal}^w$ (see Lemma E.6), we obtain that $((\hat{F}_{cal}^{w,(n)})^{-1})_n$ converges in probability to $(F_{cal}^w)^{-1}$ on $\ell^{\infty}(0,1)$. This proves the first statement.

Next, we turn to prove the second statement. Since $w$ is uniformly bounded, the family $\mathcal{F} = \{w_t : x \in \mathbb{R} \mapsto w(x) 1_{x \le t}; t \in \mathbb{R}\}$ is $\mathcal{U}(0,1)$-Donsker (Shorack and Wellner, 1986). hence there exist $K = (K(t))_{t \in [0,1]}$ a Gaussian process such that

$$ \sqrt{n} (K^{(n)} - K) \xrightarrow{\mathcal{L}} \mathbb{K} \text{ in } \ell^{\infty}[0,1], $$

where the distribution of $K$ is given by $\mathbb{E}(K) = 0$ and for $(s,t) \in [0,1]^2$,

$$ \begin{aligned} \text{Cov}(K(s), K(t)) &= \int_0^{s \wedge t} w^2(x) \, dx - \int_0^s w(x) \, dx \int_0^t w(x) \, dx; \\ &= K(1)^2 \left( \rho^{w2} V_{cal}^w(s \wedge t) - F_{cal}^w(t) F_{cal}^w(s) \right), \end{aligned} $$

where we used $K(1)^2 \rho^{w2} V_{cal}^w(t) = \int_0^t w^2(x) \, dx$ and $F_{cal}^w = K/K(1)$ by the definition of $V_{cal}^w$ (17), $\rho^w$ (16) and $F_{cal}^w$ (14). We easily check that the condition of the Kolmogorov-Čentsov theorem is satisfied, so that $K$ has a continuous version. Now, by applying the functional delta method with the map of Lemma E.8, we obtain

$$ \sqrt{n} \left( \left( \frac{K^{(n)}}{K^{(n)}(1)} \right) - F_{cal}^{w} \right) \xrightarrow{\mathcal{L}} \frac{K}{K(1)} - \frac{K(1)}{K(1)} F_{cal}^{w}, \quad \text{in } \mathcal{C}[0,1]. $$
Since $\sqrt{n}\|\hat{F}_{\text{cal}}^{w,(n)} - K^{(n)}/K^{(n)}(1)\|_{\infty} \le \sqrt{n}w(+\infty)/((n+1)K^{(n)}(1) + w(+\infty)) \to 0$ a.s., then by Slustky's lemma, we obtain

$$ \sqrt{n} (\hat{F}_{\text{cal}}^{w,(n)} - F_{\text{cal}}^{w}) \xrightarrow{\mathcal{L}} \frac{\mathbb{K}}{K(1)} - \frac{\mathbb{K}(1)}{K(1)} F_{\text{cal}}^{w}, \text{ in } \mathcal{C}[0,1]. $$

And by applying the functional delta method with the inverse map at $F_{\text{cal}}^{w}$ (see Lemma E.6) we obtain,

$$ \sqrt{n} (\hat{F}_{\text{cal}}^{w,(n)-1} - (F_{\text{cal}}^{w})^{-1}) \xrightarrow{\mathcal{L}} ((F_{\text{cal}}^{w})^{-1})' \left( -\frac{\mathbb{K} \circ (F_{\text{cal}}^{w})^{-1}}{K(1)} + \frac{\mathbb{K}(1)}{K(1)} I \right), \text{ in } D(0,1). $$

To conclude, we identify the covariance of the Gaussian limiting process. For, $1 > t \ge s > 0$,

$$
\begin{align*}
\operatorname{Cov}(-\mathbb{K}((F_{\text{cal}}^w)^{-1}(t))/K(1) + \mathbb{K}(1)/K(1)t, -\mathbb{K}((F_{\text{cal}}^w)^{-1}(s))/K(1) + \mathbb{K}(1)/K(1)s)
&= \rho^{w2} V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) - F_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))F_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) \\
&\quad - s\rho^{w2}V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t)) + sF_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t)) \\
&\quad - t\rho^{w2}V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) + tF_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) \\
&\quad + ts\rho^{w2} - ts \\
&= \rho^{w2} V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) - ts - s\rho^{w2}V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t)) + st \\
&\quad - t\rho^{w2}V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) + st + ts\rho^{w2} - ts \\
&= \rho^{w2} (V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) - sV_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t)) - tV_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) + ts).
\end{align*}
$$

Therefore, the last display is equal to

$$
\begin{align*}
& \rho^{w2} \left( V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s))V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t)) \right. \\
& \qquad \left. + [t - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] [s - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] \right) \\
& = \rho^{w2} \left( V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(s)) [1 - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] + [t - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] [s - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] \right).
\end{align*}
$$

The first term coincides with the covariance term of $V(V_{\text{cal}}^w \circ (F_{\text{cal}}^w)^{-1})$ for a standard Brownian bridge $V$, while the second term is the covariance of the process $([t - V_{\text{cal}}^w((F_{\text{cal}}^w)^{-1}(t))] N)_{t \in (0,1)}$ with $N \sim \mathcal{N}(0,1)$. This concludes the proof for the second statement. $\square$

## C.2. Prediction setting

The following result is the weighted version of Proposition 5.1.

**Proposition C.2.** In the prediction setting with Assumptions 1, 3 and 4 and assuming that $n/(n+m)$ tends to $\sigma^2 \in [0,1]$, we have,

$$ \left( \sqrt{m} \left[ \hat{F}_{m, \text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-I) - F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-I) \right] \atop \sqrt{n} \left[ F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1}(1-I) - F_{\text{test}} \circ (F_{\text{cal}}^{w})^{-1}(1-I) \right] \right) \xrightarrow{\mathcal{L}} \left( \rho^w (G^w)' \left[ \mathbb{U}(I^w) + [I-I^w]N \right] \atop \rho^w (G^w)' \left[ \mathbb{V}(I^w) + [I-I^w]N \right] \right) \quad \text{on } [D(0,1)]^2, $$

where $\mathbb{U}$ and $\mathbb{V}$ are two independent standard Brownian bridges and $N$ is an independent standard Gaussian random variable.

*Proof.* By the Donsker theorem (Theorem E.3), we have

$$ \sqrt{m} (\hat{F}_{m, \text{test}} - F_{\text{test,cal}}) \xrightarrow{\mathcal{L}} \mathbb{U}(1 - F_{\text{test,cal}}) \text{ on } D(0,1), $$
where $\mathbb{U}$ is a standard Brownian bridge. By Lemma C.1 (which applies because we can standardize the calibration set, see Lemma A.1), we have

$$ \sqrt{n} \left( (\hat{F}_{\text{cal}}^{w,(n)})^{-1} - (F_{\text{cal}}^{w})^{-1} \right) \xrightarrow{\mathcal{L}} ((F_{\text{cal}}^{w})^{-1})' \rho^{w} \left( \mathbb{U} (V_{\text{cal}}^{w} \circ (F_{\text{cal}}^{w})^{-1}) + [I - V_{\text{cal}}^{w} \circ (F_{\text{cal}}^{w})^{-1}] N \right) \quad \text{on } D(0, 1), $$

where $\mathbb{V}$ is a standard Brownian bridge and $N$ is an independent standard Gaussian random variable. Thus, by independence between $\mathcal{D}_{\text{cal}}$ and $\mathcal{D}_{\text{test}}$,

$$ \left( \sqrt{m} \left[ \hat{F}_{m, \text{test}} - F_{\text{test,cal}} \right] \quad \mathcal{L} \quad \left( \rho^w (G^w)' [\mathbb{V}(I^w) + [I - I^w] N] \right) \right) \quad \text{on } [D(0, 1)]^2, $$

where $\mathbb{U}$ and $\mathbb{V}$ two independent Brownian bridges and $N$ an independent Gaussian r.v.. By Lemma C.1, we have that $(\hat{F}_{\text{cal}}^{w,(n)})^{-1} \xrightarrow{\mathbb{P}} (F_{\text{cal}}^{w})^{-1}$ on $\ell^{\infty}(0,1)$ hence by using Lemma E.10 we get

$$ \left( \sqrt{m} \left[ \hat{F}_{m, \text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1} (1-I) - F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w,(n)})^{-1} (1-I) \right] \quad \mathcal{L} \quad \left( \rho^w (G^w)' [\mathbb{V}(I^w) + [I - I^w] N] \right) \right) \quad \text{on } [D(0, 1)]^2, $$

which concludes the proof.

□

### C.3. Novelty detection setting

We define

$$ \hat{G}_{m,0}^{w,(n)}(t) = \frac{1}{m_0(m)} \sum_{i \in [m] \cap \mathcal{H}_0} \mathbb{1}_{p_i^{w,(n)} \le t}, \quad t \in (0,1); $$

$$ \hat{G}_{m,1}^{w,(n)}(t) = \frac{1}{m - m_0(m)} \sum_{i \in [m] \cap \mathcal{H}_0^c} \mathbb{1}_{p_i^{w,(n)} \le t}, \quad t \in (0,1), $$

the counterparts of $\hat{G}_{m,0}^{(n)}$ (37) and $\hat{G}_{m,1}^{(n)}$ (38), respectively. Hence, the mixture e.c.d.f.

$$ \hat{G}_{m}^{w,(n)}(t) = \frac{1}{m} \sum_{i \in [m]} \mathbb{1}_{p_{i}^{w,(n)} \le t} = \pi_{0}(m) \hat{G}_{m,0}^{w,(n)}(t) + (1 - \pi_{0}(m)) \hat{G}_{m,1}^{w,(n)}(t), \quad t \in (0,1), $$

is the counterpart of $\hat{G}_m^{(n)}$ (39).

The following result is the weighted version of Proposition 5.2 (with an oracle weight function).

**Proposition C.3.** In the novelty detection setting with Assumption 2, assume that $P_0$ is absolutely continuous with respect to $P_{\text{cal}}$ and that the oracle weight function $w^*$ (11) satisfies Assumption 4. Under Assumption 3, assuming that $n/(n+m) \to \sigma^2 \in [0,1]$ and $\pi_0(m) \to \pi_0 \in (0,1)$, we have

$$ \sqrt{\tau_{n,m}} \left( \begin{array}{c} \hat{G}_{m,0}^{w^*,(n)} - I \\ \hat{G}_{m,1}^{w^*,(n)} - G^{w^*} \end{array} \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \left( \begin{array}{c} \frac{\sigma}{\sqrt{\pi_0}} \mathbb{U} + \rho^{w^*} \sqrt{1-\sigma^2} (\mathbb{W}_{I^{w^*}} + [I-I^{w^*}] N) \\ \frac{\sigma}{\sqrt{1-\pi_0}} \mathbb{V}_{G^{w^*}} + (G^{w^*})' \rho^w \sqrt{1-\sigma^2} (\mathbb{W}_{I^{w^*}} + [I-I^{w^*}] N) \end{array} \right) \\ =: \left( \begin{array}{c} Z_0^{w^*} \\ Z_1^{w^*} \end{array} \right) \quad \text{on } [D(0,1)]^2. $$
with $U$, $V$ and $W$ three independent Brownian bridges and an independent standard Gaussian random variable $N$. Furthermore,

$$ \sqrt{\tau_{n,m}} (\hat{G}_{m}^{w^{*},(n)} - G_{\text{mixt}}^{w^{*}}) \xrightarrow{\mathcal{L}} \sqrt{\pi_0 \sigma^2 U} + \sqrt{(1-\pi_0) \sigma^2 V} G_{w^*} \\ + (G_{\text{mixt}}^{w^*})' \rho^{w^*} \sqrt{1-\sigma^2} (W_{I^{w^*}} + [I-I^{w^*}]N) \\ = \pi_0 \mathbb{Z}_0^{w^*} + (1-\pi_0) \mathbb{Z}_1^{w^*} =: \mathbb{Z}^{w^*} \quad \text{on } D(0,1). $$

*Proof.* We apply twice the argument of the proof of Proposition C.2 to the null and the alternative processes to obtain $U$, $V$ and $W$ three independent standard Brownian bridges and an independent standard Gaussian r.v. $N$ such that,

$$ \left( \begin{array}{c} \sqrt{m_0(m)} (\hat{F}_{m,0,
\text{test}} \circ (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I) - (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I)) \\ \sqrt{m_1(m)} (\hat{F}_{m,1,
\text{test}} \circ (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I) - F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I)) \\ \sqrt{n} (F_{\text{cal}}^{w^*} \circ (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I) - (1-I)) \\ \sqrt{n} (F_{\text{test}} \circ (\hat{F}_{\text{cal}}^{w^*,(n)})^{-1}(1-I) - F_{\text{test}} \circ (F_{\text{cal}}^{w^*})^{-1}(1-I)) \end{array} \right) $$

converges when $\tau_{n,m} \to +\infty$ in distribution to

$$ \left( \begin{array}{c} U \\ V \circ G^{w^*} \\ \rho^{w^*} (W(I^{w^*}) + [I - I^{w^*}]N) \\ \rho^{w^*} (G^{w^*})' (W(I^{w^*}) + [I - I^{w^*}]N) \end{array} \right) \quad \text{on } [D(0,1)]^4. $$

We conclude by using the decomposition (36) on $\hat{G}_{m,0}^{w^*,(n)}$ and $\hat{G}_{m,1}^{w^*,(n)}$, the Slutsky lemma and the continuous mapping theorem. $\square$

The following result is the weighted version of Proposition 5.3.

**Proposition C.4.** Under Assumption 2, assume that $P_0$ is absolutely continuous with respect to $P_{cal}$ and that the oracle weight function $w^*$ (11) satisfies Assumption 4. Under Assumptions 3, and 6, assuming that the targeted level $\alpha > [(G_{\text{mixt}}^{w^*})'(0^+)]^{-1}$, assuming that $n/(n+m) \to \sigma^2 \in [0,1]$ and $\pi_0(m) \to \pi_0 \in (0,1)$, we have,

$$ \sqrt{\tau_{n,m}} (\mathcal{T}^{\text{BH}_\alpha} (\hat{G}_m^{w^*,(n)}) - \mathcal{T}_\alpha^{w^*}) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{1}{\frac{1}{\alpha} - (G_{\text{mixt}}^{w^*})'(\mathcal{T}_\alpha^{w^*})} \mathbb{Z}^{w^*}(\mathcal{T}_\alpha^{w^*}); \\ \sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)} (\mathcal{T}^{\text{BH}_\alpha} (\hat{G}_m^{w^*,(n)})) - \pi_0 \alpha) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{\pi_0}{G_{\text{mixt}}^{w^*}(\mathcal{T}_\alpha^{w^*})} \mathbb{Z}_0^{w^*}(\mathcal{T}_\alpha^{w^*}); \\ \sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)} (\mathcal{T}^{\text{BH}_\alpha} (\hat{G}_m^{w^*,(n)})) - G^w(\mathcal{T}_\alpha^{w^*})) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{(G^{w^*})'(\mathcal{T}_\alpha^{w^*})}{\frac{1}{\alpha} - (G_{\text{mixt}}^{w^*})'(\mathcal{T}_\alpha^{w^*})} \mathbb{Z}^{w^*}(\mathcal{T}_\alpha^{w^*}) + \mathbb{Z}_1^{w^*}(\mathcal{T}_\alpha^{w^*}), $$

where $\mathbb{Z}_0^{w^*}$, $\mathbb{Z}_1^{w^*}$ and $\mathbb{Z}^{w^*}$ are the three processes defined in Proposition C.3.

*Proof of Proposition C.4.* It is mutatis mutandis the same proof as in Section B.3 by using the weighted processes and the weighted convergence in distribution delineated in Proposition C.3. $\square$

## Appendix D: Weighted novelty detection for a general weight function

In this section, we extend Propositions C.3 and C.4 to the case of a general weight function. We should add the following technical assumption (which was implicitly satisfied in the oracle case):
**Assumption 7.** $F_0$ is continuously differentiable.

Let us introduce

$$ 
\begin{aligned}
\mathbf{p}(t) &= \frac{\pi_0 G_0^w(t)}{G_{\text{mixt}}^w(t)} \\
\zeta_{\alpha}(t) &= 1 - (1 - \pi_0) \frac{(G_0^w)' G^w - G_0^w (G^w)'}{(\alpha^{-1} - (G_{\text{mixt}}^w)'(t)) G_0^w}
\end{aligned}
$$

where $\mathbf{p}(t)$ corresponds to the positive false discovery rate at $t$ (Storey, 2002). Note that in the oracle case $\zeta_{\alpha}(T_{\alpha}^w) = 0$, but $\zeta_{\alpha}(T_{\alpha}^w)$ is not necessarily zero for a general $w$.

**Proposition D.1.** Under Assumptions 2, 3, 7, assuming that the weight function $w$ satisfies Assumption 4, and assuming that $n/(n+m) \to \sigma^2 \in [0, 1]$ and $\pi_0(m) \to \pi_0 \in (0, 1)$, we have

$$ \sqrt{\tau_{n,m}} \left( \hat{G}_{m,0}^{w,(n)} - G_0^w \right) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \left( \frac{\frac{\sigma}{\sqrt{\pi_0}} \mathbb{U}_{G_0^w} + (G_0^w)' \rho^w \sqrt{1-\sigma^2} (\mathbb{W}_{I^w} + [I-I^w] N)}{\frac{\sigma}{\sqrt{1-\pi_0}} \mathbb{V}_{G^w} + (G^w)' \rho^w \sqrt{1-\sigma^2} (\mathbb{W}_{I^w} + [I-I^w] N)} \right) =: \begin{pmatrix} \mathbb{Z}_0^w \\ \mathbb{Z}_1^w \end{pmatrix} \quad \text{on } [D(0,1)]^2. $$

with $\mathbb{U}$, $\mathbb{V}$ and $\mathbb{W}$ three independent Brownian bridges and an independent standard Gaussian random variable $N$. Furthermore,

$$ 
\begin{aligned}
\sqrt{\tau_{n,m}} (\hat{G}_m^{w,(n)} - G_{\text{mixt}}^w) \xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} & \sqrt{\pi_0 \sigma^2} \mathbb{U}_{G_0^w} + \sqrt{(1-\pi_0) \sigma^2} \mathbb{V}_{G^w} \\
& + (G_{\text{mixt}}^w)' \rho^w \sqrt{1-\sigma^2} (\mathbb{W}_{I^w} + [I-I^w] N) \\
& = \pi_0 \mathbb{Z}_0^w + (1-\pi_0) \mathbb{Z}_1^w =: \mathbb{Z}^w \quad \text{on } D(0,1).
\end{aligned}
$$

The proof of Proposition D.1 is omitted because it is completely analogue to the one of Proposition C.3.

**Theorem D.2.** Under Assumptions 2, 3, 6, 7, assuming that $\alpha > [(G_{\text{mixt}}^w)'(0^+)]^{-1}$ and that the weight function $w$ satisfies Assumption 4. Then if $n/(n+m) \to \sigma^2 \in [0, 1]$ and $\pi_0(m) \to \pi_0 \in (0, 1)$, we have

$$ 
\begin{aligned}
\sqrt{\tau_{n,m}} (\mathcal{T}^{\text{BH}_\alpha} (\hat{G}_m^{w,(n)} - \mathcal{T}_\alpha^w)) &\xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{1}{\frac{1}{\alpha} - (G_{\text{mixt}}^w)' (\mathcal{T}_\alpha^w)} \mathbb{Z}^w (\mathcal{T}_\alpha^w); \\
\sqrt{\tau_{n,m}} (\text{FDP}_m^{(n)} (\mathcal{R}_\alpha^w) - \mathbf{p}(\mathcal{T}_\alpha^w)) &\xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{\mathbb{Z}_0^w (\mathcal{T}_\alpha^w)}{G_0^w (\mathcal{T}_\alpha^w)} \mathbf{p}(\mathcal{T}_\alpha^w) [1 - \mathbf{p}(\mathcal{T}_\alpha^w) \zeta_\alpha (\mathcal{T}_\alpha^w)] \\
&\quad - \frac{\mathbb{Z}_1^w (\mathcal{T}_\alpha^w)}{G^w (\mathcal{T}_\alpha^w)} \mathbf{p}(\mathcal{T}_\alpha^w) [1 - \mathbf{p}(\mathcal{T}_\alpha^w)] \zeta_\alpha (\mathcal{T}_\alpha^w); \\
\sqrt{\tau_{n,m}} (\text{TDP}_m^{(n)} (\mathcal{R}_\alpha^w) - G^w (\mathcal{T}_\alpha^w)) &\xrightarrow{\mathcal{L}}_{\tau_{n,m} \to +\infty} \frac{(G^w)' (\mathcal{T}_\alpha^w)}{\frac{1}{\alpha} - (G_{\text{mixt}}^w)' (\mathcal{T}_\alpha^w)} \mathbb{Z}^w (\mathcal{T}_\alpha^w) + \mathbb{Z}_1^w (\mathcal{T}_\alpha^w),
\end{aligned}
$$

where the three processes $(\mathbb{Z}_0^w, \mathbb{Z}_1^w, \mathbb{Z}^w)$ are defined in Proposition D.1.

The proof of Theorem D.2 is omitted because completely analogue to the one of Proposition C.4.

# Appendix E: Additional tools for asymptotics

## E.1. Donsker and Glivenko-Cantelli theorems

The results below can be found in van der Vaart (1998) and Shorack and Wellner (1986).

**Theorem E.1 (Glivenko-Cantelli).** Let $F_{\text{test}}$ be a c.d.f., and $\hat{F}_{m,\text{test}}$ be an empirical version of $F_{\text{test}}$ with $m$ i.i.d. points. Then,

$$ \| \hat{F}_{m,\text{test}} - F_{\text{test}} \|_{\infty} \to 0 \text{ a.s.} $$
**Proposition E.2.** Let $(U_k)_{k \ge 1}$ be i.i.d. random variables uniformly distributed over $(0, 1)$. Denote $\mathbb{F}^{(n)}$ the e.c.d.f. of the family $(U_k)_{k \in \mathbb{N}}$. Then,

$$ \left\| (\mathbb{F}^{(n)})^{-1} - I \right\|_{\infty} \to 0 \text{ a.s.} $$

**Theorem E.3 (Donsker (1952)).** Let $(X_i)_{i \ge 1}$ iid real random variables. Let $F$ the cumulative distribution function of $X_1$ and $\mathbb{F}_n$ the empirical cdf of $\{X_1, \dots, X_n\}$. Then,

$$ \sqrt{n}(\mathbb{F}_n - F) \xrightarrow{\mathcal{L}} \mathbb{U}_F, $$

with $\mathbb{U}$ a standard Brownian bridge.

**Proposition E.4.** Let $w$ a weight function satisfying Assumption 4. Then the family of function $\mathcal{F} = \{w_t : x \in \mathbb{R} \mapsto w(x) 1_{\{x \le t\}}; t \in \mathbb{R}\}$ is $P_{\text{cal}}$-Donsker and $P_{\text{cal}}$-Glivenko-Cantelli.

## E.2. Hadamard differentiability

The three first results below can be found in van der Vaart (1998).

**Lemma E.5.** Let $F : [a, b] \to \mathbb{R}$ be a continuously differentiable function. The map $T : \phi \mapsto F \circ \phi$ with entries being functions $\phi : T \mapsto [a, b]$ contained in $\ell^\infty(T)$ is Hadamard differentiable tangentially to $C(T)$ with derivative:

$$ \dot{T}_{\phi}(H) = F'(\phi)H $$

**Assumption 8.** The cumulative distribution function $F$ have a compact support $[a, b]$ in the sense that for all $x \le a$, $F(x) = 0$, for all $x \ge b$, $F(x) = 1$ and for all $x \in (a, b)$, $0 < F(x) < 1$. Furthermore, $F$ is continuously differentiable on $(a, b)$ with strictly positive derivative.

**Lemma E.6.** Let $F$ satisfying Assumption 8. Then the inverse map $G \mapsto G^{-1}$ with domain the set of cumulative distribution function of probability measure on $(a, b]$ with value in $\ell^\infty(0, 1)$ is Hadamard differentiable at $F$ tangentially to $C[a, b]$ with derivative being the map

$$ H \mapsto -H \circ F^{-1}F^{-1}' = -\frac{H \circ F^{-1}}{F' \circ F^{-1}}. $$

**Corollary E.7.** Let $(X_i)_{i \ge 1}$ be iid real random variables. Let $F$ be the cumulative distribution function of $X_1$ and $\mathbb{F}_n$ be the empirical cdf of $\{X_1, \dots, X_n\}$. Denote $F^{-1}$ and $\mathbb{F}_n^{-1}$ the corresponding quantile functions. Assume that $F$ satisfies Assumption 8 with derivative $f$. Then,

$$ \sqrt{n}(\mathbb{F}_n^{-1} - F^{-1}) \xrightarrow{\mathcal{L}} \frac{\mathbb{U}}{f \circ F^{-1}} = (F^{-1})'\mathbb{U}, $$

with $\mathbb{U}$ being a standard Brownian bridge.

**Lemma E.8.** Let $w$ a weight function satisfying Assumption 4. Denote $K : t \in [0, 1] \to \int_0^t w(x) \mathrm{d}x$. The map $T : F \in D[0, 1] \to F/F(1) \in D[0, 1]$ is Hadamard differentiable at $K$ tangentially to $C[0, 1]$ with the following formula:

$$ \dot{T}_K(H)(u) = \frac{H}{K(1)} - \frac{H(1)}{K(1)}W, $$

with $W = T(K) = K/K(1)$.
Proof of Lemma E.8. Let $K \in D[0, 1]$ defined as in the statement. Let $(H_t)_{t \in [0,1]}$ be a family of function in $C[0, 1]$ with $H_t \to H \in C[0, 1]$ uniformly on $[0, 1]$. We have, for $t$ small enough,

$$ 
\begin{aligned}
T(K + tH_t) - T(K) &= \frac{K(1)(K + tH_t) - (K(1) + tH_t(1))K}{(K(1) + tH_t(1))K(1)} \\
&= \frac{K(1)tH_t - tH_t(1)K}{(K(1) + tH_t(1))K(1)} \\
&= t \times \left( \frac{H_t}{K(1) + tH_t(1)} - \frac{H_t(1)}{K(1) + tH_t(1)} \frac{K}{K(1)} \right).
\end{aligned}
$$

Hence, we obtain

$$ \frac{T(K + tH_t) - T(K)}{t} \underset{t \to 0}{\longrightarrow} \frac{H}{K(1)} - \frac{H(1)}{K(1)} \frac{K}{K(1)}, $$

which prove the Hadamard differentiability.

<figure><img src="image_4.png" /></figure>

We gather below the formulas of the Hadamard derivatives of the functionals of interest when studying the asymptotic of the FDP. They are obtained from Neuvial (2008).

**Lemma E.9.** Let $G: [0, 1] \to [0, 1]$ be a continuously differentiable increasing strictly concave function. If $\alpha > [G'(0)]^{-1}$, then $\mathcal{T}^{\text{BH}_\alpha}$ is Hadamard differentiable at $G$ tangentially to $C[0, 1]$ with the following expression for all $H \in C[0, 1]$

$$ (\dot{\mathcal{T}}^{\text{BH}_\alpha})_G(H) = \frac{H(\mathcal{T}^{\text{BH}_\alpha}(G))}{\alpha^{-1} - G'(\mathcal{T}^{\text{BH}_\alpha}(G))}. $$

Let $(G_0, G_1)$ be two continuously differentiable c.d.f. functions from $[0, 1]$ to $[0, 1]$ and let $\pi \in (0, 1)$ such that $G = \pi G_0 + (1 - \pi)G_1$ is strictly concave. Let $\alpha > [G'(0)]^{-1}$. In addition, let us define

$$ \nu: (F_0, F_1) \to F_0(\mathcal{T}^{\text{BH}_\alpha}(\pi F_0 + (1 - \pi)F_1)); $$

$$ \Psi: (F_0, F_1) \to \frac{\pi F_0(\mathcal{T}^{\text{BH}_\alpha}(F))}{F(\mathcal{T}^{\text{BH}_\alpha}(F)); \qquad (47) $$

$$ \Phi: (F_0, F_1) \to \pi F_1(\mathcal{T}^{\text{BH}_\alpha}(F)), \qquad (48) $$

where $F = \pi F_0 + (1 - \pi)F_1$. Then, $\nu$, $\Psi$ and $\Phi$ are Hadamard differentiable at $(G_0, G_1)$ tangentially to $(C[0, 1])^2$ with the following derivative expressions: for all $(H_0, H_1) \in (C[0, 1])^2$,

$$ \dot{\nu}_{G_0, G_1}(H_0, H_1) = G'_0(\mathcal{T}^{\text{BH}_\alpha}(G)) \frac{H(\mathcal{T}^{\text{BH}_\alpha}(G))}{\alpha^{-1} - G'(\mathcal{T}^{\text{BH}_\alpha}(G))} + H_0(\mathcal{T}^{\text{BH}_\alpha}(G)); $$

$$ \dot{\Psi}_{G_0, G_1}(H_0, H_1) = G'_1(\mathcal{T}^{\text{BH}_\alpha}(G)) \frac{H(\mathcal{T}^{\text{BH}_\alpha}(G))}{\alpha^{-1} - G'(\mathcal{T}^{\text{BH}_\alpha}(G))} + H_1(\mathcal{T}^{\text{BH}_\alpha}(G)); $$

$$ \dot{\Phi}_{G_0, G_1}(H_0, H_1) = \frac{1}{G(\mathcal{T}^{\text{BH}_\alpha}(G))} \left( \dot{\nu}_{G_0, G_1}(H_0, H_1) - \frac{\pi G_0(\mathcal{T}^{\text{BH}_\alpha}(G))}{G(\mathcal{T}^{\text{BH}_\alpha}(G))} (\dot{\mathcal{T}}^{\text{BH}_\alpha})_G(H) \right), $$

where $H = \pi H_0 + (1 - \pi)H_1$.

### E.3. Random change of time

We present here a version of the random change of time lemma of Billingsley (1999) (page 151), which is adapted to the topological spaces $D(\mathbb{R})$, $\ell^\infty(0, 1)$ and $D(0, 1)$.
**Lemma E.10.** Let $(U_n, V_n)_n$ be a sequence of random processes in $D(\mathbb{R}) \times D(0, 1)$, $\mathbb{U}$ and $\mathbb{V}$ two random processes in $D(\mathbb{R})$ and $D(0, 1)$, respectively, which are both a.s. continuous and such that $(U_n, V_n) \xrightarrow{\mathcal{L}} (\mathbb{U}, \mathbb{V})$ in $D(\mathbb{R}) \times D(0, 1)$. Let $(F_n)_n$ be a sequence of random processes in $D(0, 1)$ and $F \in D(0, 1)$ such that $(F_n)_n$ converges in probability to $F$ on $\ell^\infty(0, 1)$. Assume that for all $n \in \mathbb{N}$, $U_n \circ F_n \in D(0, 1)$. Then,

$$ (U_n \circ F_n, V_n) \xrightarrow{\mathcal{L}} (\mathbb{U} \circ F, \mathbb{V}) \text{ on } (D(0, 1))^2. $$

*Proof of Lemma E.10.* Since $\mathbb{U}$ and $\mathbb{V}$ are continuous, $(U_n, V_n)_n$ converges in distribution to $(\mathbb{U}, \mathbb{V})$ on $\ell^\infty(\mathbb{R}) \times \ell^\infty(0, 1)$ by Lemma E.12. Hence, by Slutsky's lemma, the sequence $(U_n, V_n, F_n)_n$ converges in distribution to $(\mathbb{U}, \mathbb{V}, F)$ on $\ell^\infty(\mathbb{R}) \times (\ell^\infty(0, 1))^2$. Hence by Lemma E.11 and the continuous mapping theorem we obtain,

$$ (U_n \circ F_n, \mathbb{V}) \xrightarrow{\mathcal{L}} \mathbb{U} \circ F \text{ on } \ell^\infty(0, 1). $$

Since $\mathbb{U}$ is continuous, then $\mathbb{U} \circ F$ is in $D(0, 1)$ and the previous convergence implies the convergence in $(D(0, 1))^2$. $\square$

Note that when using Lemma E.10 in our work, the convergence of the sequence $(U_n)_n$ is typically given by the Donsker Theorem, while the convergence of $(F_n)_n$ is given by the Glivenko-Cantelli theorem.

**Lemma E.11.** Define the following map $\Psi : (F_1, F_2, F_3) \in \ell^\infty(\mathbb{R}) \times (\ell^\infty(0, 1))^2 \mapsto (F_1 \circ F_3, F_2) \in (\ell^\infty(0, 1))^2$. For all $U \in \mathcal{C}(\mathbb{R})$ and $(F, V) \in (\ell^\infty(0, 1))^2$, $\Psi$ is continuous at $(U, V, F)$.

*Proof of Lemma E.11.* Let $U \in \mathcal{C}(\mathbb{R})$ and $(V, F) \in (\ell^\infty(0, 1))^2$. Let $(U_n, V_n, F_n)_n$ a sequence in $\ell^\infty(\mathbb{R}) \times (\ell^\infty(0, 1))^2$ which converges to $(U, V, F)$. Let $K \subset (0, 1)$ be a compact set. Let $\varepsilon > 0$. The set $\{F_n(x), x \in K, n \in \mathbb{N}\}$ is bounded since $\|F_n - F\|_{\infty, K} \to 0$ and $(F_n)_n$ and $F$ belongs in $\ell^\infty(0, 1)$, hence is included in a compact set $K'$ of $\mathbb{R}$. Since $U$ is continuous, we have $\eta > 0$ such that for all $(x, y) \in K'^2$, $|x - y| \le \eta$ implies that $|U(x) - U(y)| \le \varepsilon$. Let $N > 0$ such that for all $n \ge N$, $\|U_n - U\|_{\infty, K'} \le \varepsilon$ and $\|F_n - F\|_{\infty, K} \le \eta$. Then for all $n \ge N$,

$$ \begin{aligned} \|U_n \circ F_n - U \circ F\|_{\infty, K} &\le \|U_n \circ F_n - U \circ F_n\|_{\infty, K} + \|U \circ F_n - U \circ F\|_{\infty, K} \\ &\le \|U_n - U\|_{\infty, K'} + \varepsilon \\ &\le 2\varepsilon, \end{aligned} $$

where the first $\varepsilon$ appears since for all $x \in K$, $F_n(x) \in K'$, $F(x) \in K'$ and $|F_n(x) - F(x)| \le \eta$. Furthermore for all $\tilde{K}$ a compact subset of $(0, 1)$, $\|V_n - V\|_{\infty, \tilde{K}} \to 0$. Hence, $\Psi$ is continuous at $(U, V, F)$. $\square$

Finally, the following result is classical and shows how a convergence in distribution on $D[0, 1]$ can imply a uniform convergence (Billingsley, 1999), with the local topology defined in Section 2.3.

**Lemma E.12 (Billingsley (1999)).** Let $(X_n)_n$ be a sequence of random processes on $D(0, 1)$. Let $X \in D(0, 1)$ be a continuous function a.s.. Then, $(X_n)_n$ converges in distribution to $X$ on $D(0, 1)$ if and only if $(X_n)_n$ converges in distribution to $X$ on $\ell^\infty(0, 1)$

## Appendix F: Useful Lemmas

**Lemma F.1.** Let $(s_1, \dots, s_{n+1}) \in \mathbb{R} \cup \{+\infty\}$, $(w_k)_{k \in [n+1]}$ be a family of positive weight summing to 1 and $\mu = \sum_{k \in [n+1]} w_k \delta_{s_k}$ be a probability measure on $\mathbb{R} \cup \{+\infty\}$. Define for all $\alpha \in (0, 1)$, $Q_\alpha(\mu) = \inf\{x \in \mathbb{R} : \mu([-\infty, x]) \ge \alpha\}$ the $\alpha$-quantile of the probability measure $\mu$. Then, for all $t \in \mathbb{R}$ and $\alpha \in (0, 1)$, the two following assertions are equivalent:

$$ (i) \sum_{k \in [n+1]} w_k 1_{s_k \ge t} \le \alpha $$

$$ (ii) t > Q_{1-\alpha}(\mu) $$
Proof of Lemma F.1. First note that, since the weights are summing to 1, (i) is equivalent to $\sum_{k \in [n+1]} w_k 1_{s_k < t} \ge 1 - \alpha$. Now prove that (ii) implies (i). If $t > Q_{1-\alpha}(\mu)$, then $\sum_{k \in [n+1]} w_k 1_{s_k < t} \ge \sum_{k \in [n+1]} w_k 1_{s_k \le Q_{1-\alpha}(\mu)} \ge 1 - \alpha$ and thus (i) holds.

Conversely, if (i) holds, we have $\sum_{k \in [n+1]} w_k 1_{s_k < t} \ge 1 - \alpha > 0$ and thus

$$S := \max_{k \in [n+1]} \{s_k : s_k < t\} \in \mathbb{R}$$

exists. With such a $S < t$ we have $\sum_{k \in [n+1]} w_k 1_{s_k \le S} = \sum_{k \in [n+1]} w_k 1_{s_k < t} \ge 1 - \alpha$. This proves $S \ge Q_{1-\alpha}(\mu)$ by definition of the quantile function. Hence $t > Q_{1-\alpha}(\mu)$ and we have proved (ii). □

**Lemma F.2.** $\frac{r_{n,m}}{m} \to \sigma^2 \in [0, 1]$ if and only if $\frac{m}{n} \to \sigma^{-2} - 1 \in [0, +\infty]$. □