Skip to content

Menu

WorksMathematics

Conformal Novelty Detection via Data-enhanced Localization

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_wufj7we3. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

Novelty detection is an important area of research in both statistics and machine learning. In this paper, we focus on the conditional novelty detection problem, where novelties arise from the relationship between different variables. We first adopt the conformal inference framework and propose a data-enhanced localized conformal p-value, constructed by recalibrating an enhanced conditional distribution estimator. This estimator efficiently captures conditional information by incorporating both calibration and test data into its kernel estimation. We show that our p-values are valid in finite samples and can improve detection efficiency. Based on this p-value, we then develop a novel conditional novelty detection algorithm, along with a data-driven bandwidth selection method that ensures finite-sample false discovery rate control while enhancing detection power. Both simulated and real data experiments demonstrate the advantages of our proposed approach.

Introduction

Novelty detection plays a pivotal role in numerous scientific and industrial domains. The objective of novelty detection is to identify observations that significantly deviate from the expected pattern. In fields such as finance, healthcare, industrial monitoring and scientific discovery, novelties often correspond to fraud, disease outbreaks, fatal machine errors and identification of unexpected patterns, respectively [24, 5] (Li et al. 2014). The ability to accurately detect such novelties not only prevents economic and social losses but also facilitates timely decision-making.

The novelty detection problem can be formulated rigorously from a statistical perspective. In novelty detection problems, we generally have access to a reference distribution PP or a reference dataset {Zi}i=1n\{Z_i\}_{i=1}^{n} sampled from PP. For a test sample Zn+1∼QZ_{n+1} \sim Q, the target is to determine whether P=QP = Q or not. That is, to test for the hypothesis

H0:P=Q,versusH1:P≠Q.H_0 : P = Q,\quad\text{versus}\quad H_1 : P \ne Q.

While this characterizes the marginal pattern, there is another line of scenarios where we are more interested in the relationship between different variables of the data. That is, we need to test for conditional novelties [26, 11]. Let Z:=(X,W)Z := (X, W) where X∈RdX \in\mathbb{R}^{d}, W∈RW \in\mathbb{R}, conditional novelty detection aims to detect novelties regarding the conditional distribution of W∣XW \mid X, which is equivalent to the following hypothesis test:

H0:PW∣X=QW∣X,versusH1:PW∣X≠QW∣X.H_0 : P_{W\mid X} = Q_{W\mid X},\quad\text{versus}\quad H_1 : P_{W\mid X} \ne Q_{W\mid X}.

For instance, in fraud monitoring, a transaction may be statistically common in general, but highly unusual for a specific user group. In a bike-sharing dataset, one would like to identify novelties of the rental bike counts which tend to peak around 8:00 and 18:00. To determine whether an observation is a novelty, it is necessary to examine the distribution of rental bike counts conditional on different time periods during the day.

Related works and motivation

Classical novelty detection methods can be broadly categorized into model-based approaches and machine learning-based approaches. Model-based approaches typically rely on assumptions about the data distribution and use robust statistical estimators to identify points that significantly deviate from the estimated structure [16, 4]. In contrast, machine learning-based approaches treat anomaly detection as a learning problem, especially suitable for high-dimensional or large-scale settings [21, 6, 12]. While those existing approaches to both marginal and conditional novelty detection have shown substantial utility, many of them rely on specific distributional assumptions or heuristic scoring mechanisms that may lack theoretical guarantees.

In recent years, conformal prediction [28, 18, 1] has become more and more popular for its ability to provide a flexible and distribution-free framework of uncertainty quantification for black-box models. Given a reference data set, conformal prediction constructs prediction intervals for new test data points with finite-sample coverage guarantees. In addition to constructing prediction intervals, the conformal prediction framework has also been applied to the marginal novelty detection problem, where the conformal p-value is defined to assess how well a new observation conforms to a reference distribution.

To apply conformal inference to conditional novelty detection problems, Wu et al. (2025) proposed to construct the localized conformal p-value (LCP) for each test sample and then to determine it as a novelty if the corresponding p-value is rejected. The LCP incorporates localization into p-value construction with kernel estimation based on calibration data, enabling it to capture information about the conditional distribution W∣XW \mid X. However, such localization can hamper the efficiency of LCP, since the kernel weighting technique usually reduces the effective sample size (Hall et al. [13]). The LCP may even perform worse than the marginal conformal p-value especially in cases with very limited calibration data. Note that a large amount of test data Du\mathcal{D}_u contains helpful information that is ignored by the LCP when constructing the p-value. It is worth investigating how to integrate these test samples to improve the p-value’s efficiency. Additionally, the performance of LCP is sensitive to the choice of bandwidth hh in the kernel function, which could be difficult to determine in real applications.

To address these challenges, we propose a more efficient methodology for localized novelty detection, termed as Data-Enhanced Localization (DEL). While LCP relies solely on calibration data to estimate the conditional distribution via kernel estimation, we propose a data-enhanced kernel estimator that incorporates both calibration and test data, thereby improving the efficiency of p-values. However, since the test data may include a proportion of novelties that violate exchangeability assumptions, we introduce a density-ratio estimator to account for potential distributional shifts between the calibration and test datasets. This adjustment ensures robustness in the presence of such shifts. The proposed p-values are seamlessly integrated with the conditional calibration framework (Fithian and Lei [7]), resulting in a novel novelty detection algorithm. This algorithm not only guarantees a finite-sample false discovery rate (FDR) but also demonstrates superior statistical power compared to existing methods. Furthermore, we propose an adaptive bandwidth selection strategy that maximizes power in the context of novelty detection, further enhancing the method’s performance.

Our contributions

In this work, the proposed data-enhanced localization method widens the scope of localization technique and is applicable in the case with limited calibration source.

Our contribution can be summarized as follows:

  • We propose a data-enhanced localized conformal p-value by constructing kernel conditional distribution estimators with both calibration and test data and then performing a recalibration step. The proposed p-value is shown to be finite-sample valid and be more efficient than LCP.

  • We derive a novelty detection algorithm with the proposed p-value. By utilizing the conditional calibration technique, we prove that our proposed algorithm ensures finite-sample FDR control. The use of data-enhancement helps to identify more novelties, especially in heteroscedastic scenarios.

  • We provide a reliable strategy for selecting bandwidths of the kernel estimator in a data-dependent manner. With a slight modification to the testing procedure, the optimal bandwidth can be determined by an optimization step. With this adaptive bandwidth, the proposed algorithm for novelty detection can still control the FDR in finite samples.

Data-enhanced localized conformal p-value

In this section, we first provide a brief review of using conformal p-values for novelty detection in § 2.1. Next, we consider conditional novelties, introduce the data-enhanced localized conformal p-value and establish its finite-sample validity and asymptotic efficiency in § 2.2.

Recap: novelty detection with conformal p-value

Consider the marginal novelty detection setting, where we observe i.i.d. data {Zi}i=1n∼P\{Z_i\}_{i=1}^{n} \sim P and a test dataset Du={Zj}j=n+1n+m\mathcal{D}_u = \{Z_j\}_{j=n+1}^{n+m} with index set U={n+1,…,n+m}\mathcal{U} = \{n+1,\ldots,n+m\}. Let I⊆U\mathcal{I} \subseteq\mathcal{U} denote the index set of inliers and O⊆U\mathcal{O} \subseteq\mathcal{U} denote the index sets of novelties, respectively. Our goal is to identify as many true novelties in Du\mathcal{D}_u as possible while controlling the FDR at some pre-specified level α>0\alpha> 0:

FDR⁡=E(∣R∩I∣∣R∣∨1)≤α\operatorname{FDR} = \mathbb{E}\left(\frac{|\mathcal{R} \cap\mathcal{I}|}{|\mathcal{R}| \vee1}\right) \leq\alpha

where R\mathcal{R} is the set of identified novelties. Bates et al. [2] proposes to use conformal p-values for novelty detection, offering a flexible and robust inference tool without requiring explicit modeling of the data distribution. The data is split into a training set Dt={Zi}i∈T\mathcal{D}_t = \{Z_i\}_{i \in\mathcal{T}} and a calibration set Dc={Zi}i∈C\mathcal{D}_c = \{Z_i\}_{i \in\mathcal{C}} with index sets T\mathcal{T} and C\mathcal{C}. A score function VV, trained on Dt\mathcal{D}_t, assigns a nonconformity score to each point, capturing how anomalous an observation appears under the learned model. Typical choices for VV include scores from one-class classifiers or distance-based methods. For one new test point Zn+1Z_{n+1}, its score Vn+1V_{n+1} is compared to the calibration scores {Vi}i∈C\{V_i\}_{i \in\mathcal{C}}, yielding a conformal p-value:

pn+1=1+∑i∈CI{Vn+1≤Vi}∣C∣+1(1)p_{n+1} = \frac{1 + \sum_{i \in\mathcal{C}} \mathbb{I}\{V_{n+1} \leq V_i\}}{|\mathcal{C}| + 1} \tag*{(1)}

This p-value is guaranteed to be super-uniform under the null if Dc∪{Zn+1}\mathcal{D}_c \cup\{Z_{n+1}\} are exchangeable.

The conformal p-values {pj}j∈U\{p_j\}_{j \in\mathcal{U}} computed with the same calibration set are also shown to be positive regression dependent on a subset (PRDS). This allows one to directly apply the Benjamini-Hochberg (BH) procedure on p-values {pj}j∈U\{p_j\}_{j \in\mathcal{U}} and take the rejection set BH⁡α({pj}j∈U):={j∈U:pj≤τα}\operatorname{BH}_{\alpha}(\{p_j\}_{j\in\mathcal{U}}) := \{j \in\mathcal{U} : p_j \le\tau_{\alpha}\} as detected novelties with

τα=max⁡{t:mt∑j∈UI{pj≤t}≤α}\tau_{\alpha} = \max\left\{t : \frac{m t}{\sum_{j\in\mathcal{U}} \mathbb{I}\{p_j \le t\}} \le\alpha\right\}

to ensure FDR ≤α\le\alpha.

Data-enhanced localized conformal p-values

In the conditional setting, we aim to test whether a new observation Zn+1=(Xn+1,Wn+1)Z_{n+1} = (X_{n+1}, W_{n+1}) is a novelty with respect to the conditional distribution W∣XW \mid X. Compared to the marginal setting, the key distinction lies in constructing a score function V(X,W)V(X, W) that captures the conformity of WW given XX, such as regression residuals or class-conditional likelihoods. The conformal p-value is then computed using the same rank-based formula as in Equation (1), with calibration scores constructed from the conditional setting. A direct way to build p-value is by reverting to the original localized prediction interval in Guan [9]:

pL,n+1∗=∑i∈C∪{n+1}H(Xi,Xn+1)I{Vn+1≤Vi}∑i∈C∪{n+1}H(Xi,Xn+1),(2)p^{*}_{L,n+1} = \frac{\sum_{i\in\mathcal{C}\cup\{n+1\}} H(X_i,X_{n+1})\mathbb{I}\{V_{n+1}\le V_i\}}{\sum_{i\in\mathcal{C}\cup\{n+1\}} H(X_i,X_{n+1})}, \tag*{(2)}

where H(⋅,⋅)H(\cdot,\cdot) is a kernel function characterizing closeness between covariate values. Note that pL,n+1∗p^{*}_{L,n+1} captures the effect of localized regions around the test sample as the kernel H(Xn+1,⋅)H(X_{n+1},\cdot) takes larger value on samples closer to Xn+1X_{n+1}. However, similar to the property of localized prediction interval in Guan [9], pL,n+1∗p^{*}_{L,n+1} is not valid in finite samples.

Wu et al. (2025) proposed the localized conformal p-value as a counterpart of localized prediction intervals in Hore and Barber [10]:

pL,n+1=∑i∈CH(Xi,X~n+1)I{Vn+1≤Vi}+ξH(Xn+1,X~n+1)∑i∈CH(Xi,X~n+1)+H(Xn+1,X~n+1)p_{L,n+1} = \frac{\sum_{i\in\mathcal{C}} H(X_i,\widetilde{X}_{n+1})\mathbb{I}\{V_{n+1}\le V_i\}+\xi H(X_{n+1},\widetilde{X}_{n+1})}{\sum_{i\in\mathcal{C}} H(X_i,\widetilde{X}_{n+1})+H(X_{n+1},\widetilde{X}_{n+1})}

where ξ\xi follows the uniform distribution U[0,1]\mathrm{U}[0,1]. The X~n+1\widetilde{X}_{n+1} is randomly sampled from the density H(Xn+1,⋅)H(X_{n+1},\cdot). By introducing the random samples X~n+1\widetilde{X}_{n+1}, this localized conformal p-value ensures finite-sample validity, which mirrors the approach used in the randomly localized prediction interval proposed by Hore and Barber [10].

However, as mentioned before, such localization reduces the effective sample size and makes the resulting p-value less efficient, particularly when the calibration set is small.

To resolve this issue, we propose a data-enhanced localized p-value to improve the efficiency. Recall the original localized p-value in (2). We notice that 1−pL,n+1∗1-p^{*}_{L,n+1} is exactly the kernel estimator for the conditional cumulative distribution function (CDF) of V∣XV \mid X evaluated at point (Vn+1,Xn+1)(V_{n+1},X_{n+1}). Although not a valid p-value itself, pL,n+1∗p^{*}_{L,n+1} is permutation-invariant with respect to Dc\mathcal{D}_{c}. This motivates us to consider the conditional CDF estimators as new scores and recalibrate them to construct p-values. To be specific, we obtain those conditional CDF estimators over i∈Dci \in\mathcal{D}_c:

F^i∗=∑k∈C∪{n+1}H(Xk,Xi)I{Vi≤Vk}∑k∈C∪{n+1}H(Xk,Xi).\widehat{F}_i^* = \frac{\sum_{k\in\mathcal{C}\cup\{n+1\}} H(X_k,X_i)\mathbb{I}\{V_i \le V_k\}}{\sum_{k\in\mathcal{C}\cup\{n+1\}} H(X_k,X_i)}.

and then the final recalibrated p-value is given by

prL,n+1=∑i∈CI{F^i∗≤F^n+1∗}+1∣C∣+1.(3)p_{\mathrm{rL},n+1} = \frac{\sum_{i\in\mathcal{C}}\mathbb{I}\{\widehat{F}_i^* \le\widehat{F}_{n+1}^*\}+1}{|\mathcal{C}|+1}. \tag*{(3)}

By the permutation-invariant property, it is easy to prove the exchangeability of {F^i∗}i=1n+1\{\widehat{F}_i^*\}_{i=1}^{n+1} and so the validity of p-value in (3). This provides an approach to construct localized conformal p-value given any permutation-invariant conditional CDF estimator.

As discussed in § 1, those conditional CDF estimators F^i∗\widehat{F}_i^*, which rely only on calibration data, may become unreliable, resulting in inefficient p-values. Motivated by the intuition that a more accurate estimator of the conditional CDF should lead to improved testing performance, we propose to enhance the estimator by incorporating the test data. The similar technique has also been considered by Marandon et al. [23] to boost the power of marginal novelty detection. As we will show in this section, its application in the conditional case is non-trivial and requires more careful design of the methodology.

For each j∈Uj \in\mathcal{U}, denote Dc,j=Dc∪{Zj}\mathcal{D}_{c,j}=\mathcal{D}_c\cup\{Z_j\} and Du,j=Du\{Zj}\mathcal{D}_{u,j}=\mathcal{D}_u\backslash\{Z_j\} with corresponding index sets Cj=C∪{j}\mathcal{C}_j=\mathcal{C}\cup\{j\} and Uj=U\{j}\mathcal{U}_j=\mathcal{U}\backslash\{j\}. The enhanced conditional distribution estimator at (Vj,Xj)(V_j,X_j) for j∈Uj \in\mathcal{U} can then be defined as follows:

F^j(v,x)=∑i∈CjH(Xi,x)I{Vi≤v}+ω∑k∈UjH(Xk,x)r^(Vk,Xk)I{Vk≤v}∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk).(4)\widehat{F}_j(v,x) = \frac{\sum_{i\in\mathcal{C}_j} H(X_i,x)\mathbb{I}\{V_i\le v\}+\omega\sum_{k\in\mathcal{U}_j}H(X_k,x)\widehat{r}(V_k,X_k)\mathbb{I}\{V_k\le v\}} {\sum_{i\in\mathcal{C}_j} H(X_i,x)+\omega\sum_{k\in\mathcal{U}_j}H(X_k,x)\widehat{r}(V_k,X_k)}. \tag*{(4)}

The r^(v,x)\widehat{r}(v,x) is an estimator of the conditional density ratio dQV∣X/dPV∣X(v,x)\mathrm{d}Q_{V\mid X}/\mathrm{d}P_{V\mid X}(v,x) between the conditional distribution V∣XV \mid X of calibration data and test data (Tibshirani et al. [27]) and is introduced to cope with the distribution shift between the calibration and test data since the latter may contain samples not following the null distribution. In practice, it can be estimated by fitting binary classifiers to distinguish {Vi}i∈T\{V_i\}_{i\in\mathcal{T}} and {Vj}j∈C∪U\{V_j\}_{j\in\mathcal{C}\cup\mathcal{U}}. We also introduce a weight parameter ω∈[0,1]\omega\in[0,1] to balance the contribution of the test data in the estimator. If ω=0\omega=0, the estimator F^n+1(v,x)\widehat{F}_{n+1}(v,x) is identical to 1−pL,n+1∗1-p_{\mathrm{L},n+1}^*. Generally, we can take a larger ω\omega when a more accurate r^\widehat{r} can be obtained since the enhanced part in the estimator could be reliable in such case.

Remark 1 When r^\widehat{r} is perfectly estimated, it could serve as an efficient score function for conditional novelty detection. However, this is extremely difficult since it is equivalent to distinguish two conditional distributions that are very similar. Since it leads to deteriorated performance in finite samples, we do not consider this score function.

Remark 2 The kernel function HH can be selected from any commonly used kernel functions in kernel density estimation. In this paper, we primarily consider Gaussian kernel H(x,x′)=h−(d−1)K(∥x−x′∥2/h)H(x,x') = h^{-(d-1)}K(\lVert x-x'\rVert_2/h) with standard normal density function K(⋅)K(\cdot), which is the most common in kernel methods. This is also the choice in Guan [9] and Hore and Barber [10].

Given the enhanced estimator, we can define the data-enhanced localized conformal p-value for j∈Uj \in\mathcal{U} by a similar recalibration step:

pDE,j=∑i∈CI{F^j(Vj,Xj)≤F^j(Vi,Xi)}+1∣C∣+1.(5)p_{\mathrm{DE},j} = \frac{\sum_{i\in\mathcal{C}} I\{\widehat{F}_j(V_j,X_j) \leq\widehat{F}_j(V_i,X_i)\}+1}{|\mathcal{C}|+1}. \tag*{(5)}

Since we do not break the permutation-invariant property when constructing the enhanced estimator, this p-value is still valid in finite samples.

Theorem 1 Suppose that the density ratio estimator r^\widehat{r} is permutation invariant with respect to DC∪DU\mathcal{D}_{\mathcal{C}}\cup\mathcal{D}_{\mathcal{U}}. For any j∈Uj \in\mathcal{U} such that DC,j\mathcal{D}_{\mathcal{C},j} are exchangeable, the corresponding p-value satisfies

Pr⁡(pDE,j≤t)≤t,0≤t≤1.\Pr(p_{\mathrm{DE},j} \leq t) \leq t,\qquad0 \leq t \leq1.

Besides the exchangeable assumption on the data, the theorem only requires a permutation invariant density ratio estimator r^\widehat{r}. This holds easily if we train r^\widehat{r} by fitting a binary classifier to distinguish between Dt\mathcal{D}_{t} and DC∪DU\mathcal{D}_{\mathcal{C}}\cup\mathcal{D}_{\mathcal{U}}.

We also prove the enhanced estimator converges faster to the true conditional distribution by leveraging the test data for kernel estimation, which serves as a circumstantial evidence of higher efficiency. We need the following regularity assumptions.

Assumption 2 Assume that: (1) The density ratio r(v,x)r(v,x) and the density of PXP_X are bounded and continuous; (2) The conditional distribution of V=V(X,W)V = V(X,W) satisfies

∥FV∣X=x(v)−FV∣X=x′(v)∥∞≤L⋅∥x−x′∥2β\lVert F_{V\mid X=x}(v)-F_{V\mid X=x'}(v)\rVert_{\infty} \leq L\cdot\lVert x-x'\rVert_2^{\beta}

for some constant $L > 0, 0 < \beta \leq 1.

Theorem 3 Suppose Assumption 2 holds. If we take the kernel function H(x,x′)=h−dK(∥x−x′∥2h)H(x,x') = h^{-d}K\left(\frac{\lVert x-x'\rVert_2}{h}\right) with Gaussian kernel KK, the estimator F^j\widehat{F}_j evaluated at any fixed data point z=(x,w)z=(x,w) satisfies

∣F^j(v,x)−Fj(v,x)∣=Op(hβ+1(n+ωm)hd)+Op(ωmn+ωmh−d/2E[(r^−r)2]).\left|\widehat{F}_j(v,x)-F_j(v,x)\right| = O_p\left(\sqrt{h^{\beta}+\frac{1}{(n+\omega m)h^d}}\right)+O_p\left(\frac{\omega m}{n+\omega m}h^{-d/2}\sqrt{\mathbb{E}\left[(\widehat{r}-r)^2\right]}\right).

From the theorem, we can see that the convergence rate for the nonparametric estimation improves with the sample size nn replaced by n+ωmn+\omega m. The second term accounts for the accuracy of r^\widehat{r} and is controlled by the parameter ω\omega. This also provides theoretical support for the recommendation on how to choose ω\omega.

Conditional novelty detection algorithm

In this section, we derive novelty detection algorithms by utilizing the data-enhanced p-value. § 3.1 presents a detection algorithm with finite-sample FDR control. § 3.2 introduces our data-driven bandwidth selection method, which boosts the power of the detection procedure.

Novelty detection

When applying data-enhanced p-values to novelty detection problems, a direct application of BH procedure is insufficient, as the PRDS property no longer holds for them. Instead, we employ the conditional calibration technique (Fithian and Lei [7]), which is commonly used in conformalized multiple testing methods. This technique allows to control the FDR even when the p-values do not exhibit the PRDS property.

Here, we consider the functions VV, HH, r^\hat{r} and the parameter ω\omega as fixed. For ease of notation, we denote the set of p-values computed with calibration data Dc\mathcal{D}_c, test data Du\mathcal{D}_u and bandwidth hh as A(Dc,Du,h)\mathcal{A}(\mathcal{D}_c,\mathcal{D}_u,h). For each j∈Uj \in U and k∈Ujk \in U_j, define the set of auxiliary p-values pDE,k(j)p_{\mathrm{DE},k}^{(j)} as

{pDE,k(j)}k∈Uj=A(Dc,j,Du,j,h).(6)\{p_{\mathrm{DE},k}^{(j)}\}_{k\in U_j}=\mathcal{A}(\mathcal{D}_{c,j},\mathcal{D}_{u,j},h). \tag*{(6)}

Let Rj\mathcal{R}_j denote the rejection set obtained by applying the BH procedure to auxiliary p-values:

Rj=BH⁡α({pDE,k(j)}k∈Uj∪{0}).(7)\mathcal{R}_j=\operatorname{BH}_{\alpha}\left(\{p_{\mathrm{DE},k}^{(j)}\}_{k\in U_j}\cup\{0\}\right). \tag*{(7)}

The final rejection set R\mathcal{R} is then defined by letting

γ∗=max⁡{γ:∑j∈U1{pDE,j≤α∣Rj∣/m, ζj∣Rj∣≤γ}≥γ},\gamma^*=\max\left\{\gamma:\sum_{j\in U}\mathbb{1}\left\{p_{\mathrm{DE},j}\leq\alpha|\mathcal{R}_j|/m,\ \zeta_j|\mathcal{R}_j|\leq\gamma\right\}\geq\gamma\right\},
R={j:pDE,j≤α∣Rj∣m, ζj∣Rj∣≤γ∗}.(8)\mathcal{R}=\left\{j:p_{\mathrm{DE},j}\leq\frac{\alpha|\mathcal{R}_j|}{m},\ \zeta_j|\mathcal{R}_j|\leq\gamma^*\right\}. \tag*{(8)}

where ζj∼U[0,1]\zeta_j\sim U[0,1] are independent uniform random variables. The full Data-Enhanced Localization procedure for novelty detection is summarized in Algorithm 1.

By introducing auxiliary p-values and rejection set Rj\mathcal{R}_j, the conditional calibration procedure decouples the dependency between the p-value and the rejection number, which allows for a term-wise analysis of the FDR. The following theorem shows that the detected novelty set R\mathcal{R} by Algorithm 2 ensures the FDR control in finite samples, which is an instantiation of the result in Fithian and Lei [7] with conditional sets specifically designed in our procedure.

Theorem 4 Suppose PX=QXP_X=Q_X and the density ratio estimator r^\hat{r} is permutation invariant with respect to Dc∪Du\mathcal{D}_c\cup\mathcal{D}_u. The final rejection set R\mathcal{R} output by Algorithm 1 ensures FDR≤α\mathrm{FDR}\leq\alpha.

Remark 3 The condition PX=QXP_X=Q_X is introduced to ensure exchangeability between calibration and null test samples, as required by Theorem 1. In practice, the DEL procedure remains robust and controls the FDR under the nominal level despite certain shifts between PXP_X and QXQ_X (see Appendix D.7).

Algorithm 1 Novelty detection with DEL

Input: Calibration data Dc\mathcal{D}_c and test data Du\mathcal{D}_u with index sets C\mathcal{C} and U\mathcal{U}; FDR target level α∈(0,1)\alpha\in(0,1); Kernel function H(⋅,⋅)H(\cdot,\cdot) with bandwidth hh; Score function VV; Density ratio estimator r^\hat{r}; Weight parameter ω\omega

  1. Compute p-value set {pDE,j}j∈U=A(Dc,Du,h)\{p_{\mathrm{DE},j}\}_{j\in\mathcal{U}}=\mathcal{A}(\mathcal{D}_c,\mathcal{D}_u,h);

  2. for j∈Uj\in\mathcal{U} do

  3. Compute auxiliary p-values {pDE,k(j)}k∈Uj=A(Dc,j,Du,j,h)\{p_{\mathrm{DE},k}^{(j)}\}_{k\in\mathcal{U}_j}=\mathcal{A}(\mathcal{D}_{c,j},\mathcal{D}_{u,j},h);

  4. Compute Rj=BHα({pDE,k(j)}k∈Uj∪{0})\mathcal{R}_j=\mathrm{BH}_{\alpha}(\{p_{\mathrm{DE},k}^{(j)}\}_{k\in\mathcal{U}_j}\cup\{0\});

  5. end for

  6. Compute the final rejection set R\mathcal{R} as in (8);

Output: Detected novelty set R\mathcal{R}.

Data-driven bandwidth selection

In this section, we introduce a data-driven bandwidth selection procedure for the kernel estimator of the conditional distribution. In conformal inference, Liang et al. (2024) has considered selecting the score function to construct shortest prediction intervals. Here we instead focus on the localization parameter hh in our estimator. While extensive methods exist for bandwidth selection in kernel estimators, including rule-of-thumb approaches (Silverman [25]) and cross-validation, these methods are primarily designed to improve estimation accuracy. As a more target-oriented approach, Guan [9] selects the bandwidth hh by maximizing efficiency of prediction intervals on the training data. In the novelty detection problem, we instead consider maximizing the testing power, which best fits our goal.

Inspired by Zhang et al. [31], the bandwidth which yields the largest number of discoveries is roughly the optimal one with the largest power with FDR control. Hence, the natural approach is running Algorithm 1 with different bandwidth hh in the kernel function HH, recording the corresponding number of rejections and taking the bandwidth that leads to the largest number of rejections. However, directly running Algorithm 1 with the selected bandwidth can lead to inflated FDR due to post-selection effects. To cope with this issue, we need to investigate the structure of the data-enhanced p-value and try to preserve its validity.

Recall that the validity of pDE,jp_{\mathrm{DE},j} hinges on the exchangeability of Dc,j\mathcal{D}_{c,j}. To preserve this property while using a data-driven bandwidth, it is crucial that the bandwidth remains fixed given the unordered set of Dc,j\mathcal{D}_{c,j}. Along this line, we propose a slight modification to the testing procedure when determining the bandwidth for the estimator F^j\widehat{F}_j.

Suppose we have a set of candidate bandwidths Λ\Lambda. For each j∈Uj\in\mathcal{U}, we first treat it as a null sample and consider Dc,j\mathcal{D}_{c,j} and Du,j\mathcal{D}_{u,j} as the new calibration and test datasets. Next, for each candidate h∈Λh\in\Lambda, we compute p-value set

{pDE,h,k(j)}k∈Uj=A(Dc,j,Du,j,h).\{p_{\mathrm{DE},h,k}^{(j)}\}_{k\in\mathcal{U}_j}=\mathcal{A}(\mathcal{D}_{c,j},\mathcal{D}_{u,j},h).

Applying the BH procedure to these p-values yields the number of rejections

γh,j=∣BH⁡α({pDE,h,k(j)}k∈Uj)∣.\gamma_{h,j} = \left|\operatorname{BH}_{\alpha}\left(\{p_{\mathrm{DE},h,k}^{(j)}\}_{k\in U_j}\right)\right|.

The bandwidth for F^j\widehat{F}_j in (4) is selected as the one that results in the largest number of rejections hj=arg⁡max⁡h∈Λγh,jh_j = \arg\max_{h\in\Lambda}\gamma_{h,j}. Note that in Algorithm 1, permuting the calibration set Dc\mathcal{D}_c does not affect the final p-values {pDE,j}j∈U\{p_{\mathrm{DE},j}\}_{j\in U}. Consequently, the number of rejections and optimal bandwidth for F^j\widehat{F}_j remain fixed given the unordered set of Du,j\mathcal{D}_{u,j} in the above procedure.

Once the validity of p-value is preserved, we can compute each pDE,jadap_{\mathrm{DE},j}^{\mathrm{ada}} using its ”optimal” bandwidth hjh_j and proceed with the conditional calibration procedure as usual. We further take this bandwidth hjh_j for computing auxiliary p-values pDE,k(j),adap_{\mathrm{DE},k}^{(j),\mathrm{ada}} for k∈Ujk\in U_j. The complete procedure is summarized in Algorithm 2.

Algorithm 2 Novelty detection with DEL and data-driven bandwidths

Input: Calibration data Dc\mathcal{D}_c and test data Du\mathcal{D}_u with index sets CC and UU; FDR target level α∈(0,1)\alpha\in(0,1); Kernel function H(⋅,⋅)H(\cdot,\cdot) with bandwidth hh; Score function VV; Density ratio estimator r^\widehat{r}; Weight parameter ω\omega; Candidate bandwidth set Λ\Lambda

  1. for j∈Uj\in U do

  2. for h∈Λh\in\Lambda do

  3. Compute p-value set {pDE,h,k(j)}k∈Uj=A(Dc,j,Du,j,h)\{p_{\mathrm{DE},h,k}^{(j)}\}_{k\in U_j}=\mathcal{A}(\mathcal{D}_{c,j},\mathcal{D}_{u,j},h);

  4. Obtain the rejection number of the BH procedure γh,j=∣BH⁡α({pDE,h,k(j)}k∈Uj)∣\gamma_{h,j}=\left|\operatorname{BH}_{\alpha}(\{p_{\mathrm{DE},h,k}^{(j)}\}_{k\in U_j})\right|;

  5. Take hj=arg⁡max⁡h∈Λγh,jh_j=\arg\max_{h\in\Lambda}\gamma_{h,j}.

  6. end for

  7. Compute pDE,jadap_{\mathrm{DE},j}^{\mathrm{ada}} by taking the jj-th value in A(Dc,Du,hj)\mathcal{A}(\mathcal{D}_c,\mathcal{D}_u,h_j);

  8. Compute auxiliary p-values {pDE,k(j),ada}k∈Uj=A(Dc,j,Du,j,hj)\{p_{\mathrm{DE},k}^{(j),\mathrm{ada}}\}_{k\in U_j}=\mathcal{A}(\mathcal{D}_{c,j},\mathcal{D}_{u,j},h_j);

  9. Compute Rjada=BH⁡α({pDE,k(j),ada}k∈Uj∪{0})\mathcal{R}_j^{\mathrm{ada}}=\operatorname{BH}_{\alpha}(\{p_{\mathrm{DE},k}^{(j),\mathrm{ada}}\}_{k\in U_j}\cup\{0\});

  10. end for

  11. Compute the final rejection set Rada\mathcal{R}^{\mathrm{ada}} as in (8) with pDE,jp_{\mathrm{DE},j}, pDE,k(j)p_{\mathrm{DE},k}^{(j)} and Rj\mathcal{R}_j replaced by versions in steps 7-9.

Output: Detected novelty set Rada\mathcal{R}^{\mathrm{ada}}.

Remark 4 Notably, although the computational complexity is O(∣Λ∣⋅m2)O(|\Lambda|\cdot m^2), adopting an adaptive bandwidth does not substantially increase computational complexity. This is because the auxiliary p-values pDE,k(j)p_{\mathrm{DE},k}^{(j)} and kernel function K(Xi,Xj;hs)K(X_i,X_j;h_s) can be reused. Generally, the whole procedure runs up to 30s on a single core with mm on the order of hundreds. The selection procedure also has a clear structure for parallelization. When mm is very large, using parallelization can still control the runtime within several minutes.

As previously illustrated, our procedure with data-driven bandwidths continues to ensure finite-sample FDR control.

Theorem 5. Suppose that the density ratio estimator r^\widehat{r} is permutation invariant with respect to Dc∪Du\mathcal{D}_c \cup\mathcal{D}_u. For any j∈[m]j \in[m] such that Dc,j\mathcal{D}_{c,j} are exchangeable, the data-enhanced pp-value with data-driven bandwidths is valid in that

Pr⁡(pDE,j≤t)≤t,0≤t≤1.\Pr(p_{\mathrm{DE},j} \le t) \le t, \qquad0 \le t \le1.

Furthermore, the rejection set Rada\mathcal{R}^{\mathrm{ada}} output by Algorithm 2 ensures FDR≤α\mathrm{FDR} \le\alpha.

Experiments and evaluation

In this section, we demonstrate the validity and efficiency of our proposed DEL novelty detection procedure through simulated and real-data experiments, as detailed in § 4.1 and § 4.2. Additional experiments are deferred to Appendix D. All experimental results are based on 200 replications.

Simulated experiments

We first validate the performance of our DEL novelty detection procedure on simulated datasets. Here we consider a heterogeneous linear regression model, which is similar to the labeled scenario in Wu et al. (2025).

Data generation: The data vector is Z=(X,W)=(X1,…,Xd,W)∈Rd+1Z = (X, W) = (X_1, \ldots, X_d, W) \in\mathbb{R}^{d+1} with d=10d = 10. The model is W=X−dTβ+5(1+∣Xd∣)−1⋅εW = X_{-d}^{\mathsf{T}}\beta+ 5(1 + \lvert X_d\rvert)^{-1} \cdot\varepsilon, with X1,…,Xd−1∼U[−1,1]X_1, \ldots, X_{d-1} \sim U[-1, 1], Xd∼N(0,1)X_d \sim N(0, 1) and ε∼N(0,1)\varepsilon\sim N(0, 1) independently. The coefficient vector is β=(0.5,−0.5,0.5,−0.5,0.5,0,0,0,0)T\beta= (0.5, -0.5, 0.5, -0.5, 0.5, 0, 0, 0, 0)^{\mathsf{T}}.

The test data contains 20% novelties following the model W=X−dTβ+5{1+(1+∣Xd∣)−1}⋅ξW = X_{-d}^{\mathsf{T}}\beta+ 5\{1 + (1 + \lvert X_d\rvert)^{-1}\} \cdot\xi, where Pr⁡(ξ=±1)=1/2\Pr(\xi= \pm1) = 1/2. We take the nominal level α=0.2\alpha= 0.2, the weight parameter ω=0.25\omega= 0.25 and training sample size ∣T∣=500\lvert\mathcal{T}\rvert= 500. The calibration and test sample sizes are taken as ∣C∣=500\lvert\mathcal{C}\rvert= 500 and m=1000m = 1000 when not varying. Other details of the simulation setting can be found in Appendix § 7.

Comparison with baselines

First, we compare the performance of our method with existing novelty detection methods. We consider the following three methods:

  • CP: the novelty detection method with marginal pp-values in Bates et al. [2].

  • LCP: the novelty detection method with localized pp-values in Wu et al. (2025).

  • DEL: our proposed novelty detection method in Algorithm 2.

Results. Results for comparing DEL to benchmarks with varying mm are summarized in Figure 1-Figure 2. As theoretically guaranteed, all three methods control the FDR below the nominal level. From the power perspective, DEL consistently exhibits higher power compared to the other two methods. When comparing two score functions, DEL maintains high power while the other methods show reduced performance with the residual score. This demonstrates that DEL more effectively captures information from the conditional distribution, performing well even with a homogeneous score function.

Figure 1. FDR and power of different methods under test sample sizes m∈{500,750,1000,1250}m \in\{500, 750, 1000, 1250\}.

Figure 2. FDR and power of different methods under different calibration sample sizes ∣C∣∈{600,800,1000,1200}|C| \in\{600, 800, 1000, 1200\}.

Ablation studies

Here we show the contribution of each part of our methodology by comparing the performance of Algorithm 1, 2 and the method without utilizing the test data:

  • UEL (UnEnhanced Localization): replacing the p-values in Algorithm 1 with the p-value in (3) without enhancement.

  • DEL-fix: Algorithm 1 with a fixed bandwidth.

  • DEL: Algorithm 2 with adaptive bandwidths.

Results. Results for ablation studies are summarized in Figure 3. While all three versions control the FDR below the nominal level, their power exhibits a stepwise increasing pattern. By integrating information from the test data, DEL-fix achieves higher power than the simplified recalibration version with quantile score. Its power further increases with larger test sample sizes, which validates our theoretical conclusion on efficiency. The DEL consistently demonstrates the highest power across both score functions and all sample sizes. This corresponds to our discussion that DEL is more robust with a data-driven bandwidth compared with a fixed one.

Figure 3. FDR and power of different algorithms under test sample sizes m∈{500,750,1000,1250}m \in\{500, 750, 1000, 1250\}.

To further highlight the effect of using adaptive bandwidth, we provide how the selected hjh_j distributes when the test sample size mm and the conditional variance σW\sigma_W of W∣XW \mid X varies. We fix σW=0.1\sigma_W = 0.1 when mm varies and m=200m = 200 when σW\sigma_W varies.

From Figure 4, we observe clear trends in how the optimal bandwidth varies with σW\sigma_W and mm. As the variance σW\sigma_W decreases or the sample size mm increases, the optimal bandwidth becomes smaller; conversely, larger σW\sigma_W or smaller mm lead to a larger optimal bandwidth. These empirical patterns are consistent with the theoretical expression for the optimal bandwidth in kernel estimation.

Figure 4. Distribution of optimal bandwidth hjh_j for each test sample with varying σW\sigma_W and mm. The bandwidth candidate set is Λ={10λ∣C∣−1/(2(2+dcon)):λ∈{−1,−0.5,0,0.5,1}}\Lambda= \{10^\lambda|C|^{-1/(2(2+d_{\mathrm{con}}))} : \lambda\in\{-1,-0.5,0,0.5,1\}\}.

Real world datasets

U.S. house price

Dataset. We further evaluate our method on the publicly available House Prices: Advanced Regression Techniques dataset from Kaggle [17]. The main features include SalePrice, GrLivArea (above-ground living area), TotalBsmtSF (basement area), OverallQual (building quality), and Neighborhood (encoded as high-price or not). We treat SalePrice as the response variable W∈RW \in\mathbb{R}, and the remaining features as X∈RdX \in\mathbb{R}^{d}, d=4d = 4. The goal is to detect novelties regarding the conditional distribution of WW given XX.

Implementation details. Similar to the novelty detection setting in Song et al. [26], we calculate scores by training a prediction model on the full dataset and take outliers as the 10% of samples with the largest nonconformity scores from both the high-price and low-price groups. We take Neighborhood as the variable used for kernel weighting. The nominal FDR level α\alpha is set as 0.2.

Results. The FDR and power results for the U.S. house price dataset are reported in Table 1. All three methods successfully control the FDR below the nominal level, while DEL detects the largest number of novelties among them. These findings demonstrate that DEL is applicable in complex real data.

Table 1 FDR and power for the House Sales dataset. Bold numbers represent the best results. The brackets contain the standard errors.

ScoreValueDELLCPCP
QuanFDR0.140(.006)0.153(.009)0.133(.007)
Power0.642(.010)0.520(.016)0.529(.015)
ResFDR0.152(0.005)0.168(0.006)0.150(0.006)
Power0.792(0.006)0.615(0.009)0.565(0.009)

Table 1.

Bike sharing

Dataset. We use Bike Sharing dataset ([8]) to show the performance of our method on the temporal scenario, which has 17,389 individuals with 13 features. Here we consider the hour in a day as the time feature tt. The variable WW of interest is the number of total rental bikes. The goal is to detect novelties regarding the conditional distribution of WW given the time feature.

Implementation details. For this dataset, we construct 10% synthetic novelties regarding the conditional distribution W∣XW \mid X as

W~i=Wi+εi, εi=0.5⋅Quantile⁡0.8(W∣t=ti)+W‾,\widetilde{W}_i = W_i + \varepsilon_i,\ \varepsilon_i = 0.5 \cdot\operatorname{Quantile}_{0.8}(W \mid t = t_i) + \overline{W},

where W‾\overline{W} is the overall mean value of WW in the whole dataset. We take tt as the variable used for kernel weighting. The bandwidths are chosen as h=2h = 2 for the LCP method and Λ={1,2,3,4,5}\Lambda= \{1, 2, 3, 4, 5\} for the DEL method.

Results. The empirical FDR and power for Bike Sharing dataset are reported in Table 2. Notably, the dataset exhibits some temporal dependency, as indicated by a slightly inflated FDR for the LCP method. In contrast, DEL maintains FDR control below the nominal level α\alpha even under weak dependency and achieves the highest power across both score functions.

Table 2 FDR and power for the Bike Sharing dataset. Bold numbers represent the best results. The brackets contain the standard errors.

ScoreValueDELLCPCP
ResFDR0.158(.006)0.238(.005)0.145(.007)
Power0.573(.021)0.393(.012)0.258(.008)
QuanFDR0.165(.009)0.209(.005)0.149(.007)
Power0.502(.020)0.388(.012)0.383(.018)

Table 2.

Concluding remark

We conclude the paper with two remarks. Firstly, while both LCP and DEL-fix rely on kernel-based conditional distribution estimators to construct p-values, kernel methods do have limitations including boundary effects and inefficiency in high-dimensional settings. Exploring modern machine learning-based approaches for conditional distribution estimation could address these challenges and further enhance performance.

Secondly, the proposed novelty detection procedure with adaptive bandwidth can become computationally burdensome when the candidate set Λ\Lambda is large. To accommodate a broader range of tuning parameters, it is essential to develop more computationally efficient algorithms that do not rely on the conditional calibration step while still ensuring finite-sample FDR control. We leave these two issues as directions for future research.

Related works

Novelty detection Our work is also related to novelty detection problems. Classical novelty detection methods include model-based approaches [16, 4] and machine learning-based algorithms [21, 6, 12]. Most existing works that consider conditional novelties fall into these two categories [26, 11]. Recent studies have explored the use of conformal inference for novelty detection [2, 23] (Liang et al. 2024). While ensuring finite-sample FDR control, these works primarily focus on the marginal case.

Localized conformal inference. This work is closely related to Guan [9] and Hore and Barber [10], both of which emphasize the effect of localized regions to construct conformal prediction intervals that are valid conditional on the covariate. Guan [9] proposed using a kernel-weighted empirical distribution for calibration but required an adjusted quantile level that is difficult to compute. Hore and Barber [10] alleviates this by incorporating a random sampling step. In contrast, our work focuses on testing problems and emphasizes the construction of p-values rather than prediction intervals.

Conformalized multiple testing. Conformalized multiple testing has attracted significant attention in recent years and has been used for novelty detection [2] (Liang et al. 2024) and sample selection (Jin and Candès 2023a,b; Wu et al. 2024). These works primarily use the conformal p-values for multiple testing while controlling the FDR. Bai and Jin [3] further proposes to select the optimal score function that maximizes testing power. In a similar spirit, we focus on selecting optimal bandwidth to maximize the power in novelty detection problem. As an extension to conditional testing, Wu et al. (2025) introduces the localized conformal p-value and applies it to several conditional testing problems. The data-enhanced localized conformal p-value proposed in this paper extends this work in a non-trivial way.

Experiment details

Since our goal is to test for novelties regarding W∣XdW \mid X_d, we only use XdX_d for localization with true conditional dimension dcon=1d_{\mathrm{con}}=1. In all experiments we take the Gaussian kernel H(x,x′)=(2πh2)−dcon/2exp⁡{−∥x−x′∥2/(2h2)}H(x,x')=(2\pi h^2)^{-d_{\mathrm{con}}/2}\exp\{-\lVert x-x'\rVert^2/(2h^2)\} with h=∣C∣−1/(2(2+dcon))h=|\mathcal{C}|^{-1/(2(2+d_{\mathrm{con}}))}, and the candidate bandwidths DEL is take as Λ={10λ∣C∣−1/(2(2+dcon)):λ∈{−1,−0.5,0,0.5,1}}\Lambda=\{10^\lambda|\mathcal{C}|^{-1/(2(2+d_{\mathrm{con}}))}:\lambda\in\{-1,-0.5,0,0.5,1\}\}. For the score function, we consider both the residual score V(x,w)=∣w−μ^(x)∣V(x,w)=|w-\hat{\mu}(x)| with μ^\hat{\mu} trained by the random forest algorithm and the quantile regression score V(x,w)=max⁡{w−q^αhi(x),q^αlo(x)−w}V(x,w)=\max\{w-\hat{q}_{\alpha_{\mathrm{hi}}}(x),\hat{q}_{\alpha_{\mathrm{lo}}}(x)-w\} with αlo=0.1\alpha_{\mathrm{lo}}=0.1, αhi=0.9\alpha_{\mathrm{hi}}=0.9 and q^\hat{q} trained by the quantile forest algorithm. The density ratio estimator r^\hat{r} is fitted by training a GLM model with {Vi}i∈T\{V_i\}_{i\in\mathcal{T}} and {Vj}j∈C∪U\{V_j\}_{j\in\mathcal{C}\cup\mathcal{U}} as two classes. The probability output is taken as the function value of r^\hat{r}.

For the U.S. house price dataset, we first train a randomForest and a quantileForest on the full dataset to obtain residual scores and quantile regression scores, which are then used to identify outliers. After excluding these outliers from the main dataset, we partition the remaining observations into three subsets: 20% are allocated to the null test set, 40% to the calibration set, and the remaining 40% to the training set. Among the defined outliers, we randomly select 60% to serve as outlier observations. Subsequently, the null test set is combined with the selected outliers to construct the final test set. The feature Neighborhood is encoded as a binary indicator of high-price versus low-price areas according to SalePrice: the low-price neighborhoods include Edwards, OldTown and IDOTRR, while the high-price neighborhoods include Sawyer, Timber, NridgHt, CollgCr, NoRidge and StoneBr. The bandwidths are chosen as h=∣C∣−1/(2(dcon+2))h=|\mathcal{C}|^{-1/(2(d_{\mathrm{con}}+2))} with dcon=1d_{\mathrm{con}}=1 for the LCP method, and Λ={10−λ∣C∣−1/(2(2+dcon)):λ∈{−1,−0.5,0,0.5,1}\Lambda=\{10^{-\lambda}|\mathcal{C}|^{-1/(2(2+d_{\mathrm{con}}))}:\lambda\in\{-1,-0.5,0,0.5,1\} for the DEL method.

Proof of theorems

Proof of Theorem 1

Since r^\hat{r} is permutation-invariant w.r.t. Dc∪Du\mathcal{D}_{c}\cup\mathcal{D}_{u} and therefore Dc,j\mathcal{D}_{c,j}, we know the function F^j(v,x)\hat{F}_{j}(v,x) is also fixed if we permute the set Dc,j\mathcal{D}_{c,j}. Combined with the assumption that Dc,j\mathcal{D}_{c,j} are exchangeable, we know {F^j(Vi,Xi)}i∈Cj\{\hat{F}_{j}(V_i,X_i)\}_{i\in\mathcal{C}_j} are also exchangeable since they are obtained by applying a function invariant to permutations on Dc,j\mathcal{D}_{c,j}. The remaining prove follows exactly the same to the proof of finite sample coverage of conformal prediction intervals:

Pr⁡(pDE,j≤t)=Pr⁡(∑i∈C1{F^j(Vj,Xj)≤F^j(Vi,Xi)}+1∣C∣+1≤t)=Pr⁡(F^j(Vj,Xj)≤Q(t,∑k∈Cj1∣C∣+1δF^j(Vk,Xk)))=1∣C∣+1E[∑k∈Cj1{F^j(Vk,Xk)≤Q(t,∑k∈Cj1∣C∣+1δF^j(Vi,Xi))}]=⌊(∣C∣+1)t⌋∣C∣+1≤t.\begin{aligned} \Pr(p_{\mathrm{DE},j}\leq t)=\Pr\left(\frac{\sum_{i\in\mathcal{C}}\mathbb{1}\{\hat{F}_{j}(V_j,X_j)\leq\hat{F}_{j}(V_i,X_i)\}+1}{|\mathcal{C}|+1}\leq t\right) \\ &=\Pr\left(\hat{F}_{j}(V_j,X_j)\leq Q\left(t,\sum_{k\in\mathcal{C}_j}\frac{1}{|\mathcal{C}|+1}\delta_{\hat{F}_{j}(V_k,X_k)}\right)\right) \\ &=\frac{1}{|\mathcal{C}|+1}\mathbb{E}\left[\sum_{k\in\mathcal{C}_j}\mathbb{1}\left\{\hat{F}_{j}(V_k,X_k)\leq Q\left(t,\sum_{k\in\mathcal{C}_j}\frac{1}{|\mathcal{C}|+1}\delta_{\hat{F}_{j}(V_i,X_i)}\right)\right\}\right] \\ &=\frac{\lfloor(|\mathcal{C}|+1)t\rfloor}{|\mathcal{C}|+1}\leq t. \end{aligned}

where the third equality follows from the exchangeability.

Proof of Theorem 3

The estimation F^j(v,x)\widehat{F}_j(v,x) is

F^j(v,x)=∑i∈CjH(Xi,x)I{Vi≤v}+ω∑k∈UjH(Xk,x)r^(Vk,Xk)I{Vk≤v}∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk)\widehat{F}_j(v,x)=\frac{\sum_{i\in C_j}H(X_i,x)\mathbb{I}\{V_i\leq v\}+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)\mathbb{I}\{V_k\leq v\}}{\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)}

Denote Vi∣Xi∼FV∣X=Xi(⋅),i=1,⋯ ,nV_i\mid X_i\sim F_{V\mid X=X_i}(\cdot),i=1,\cdots,n, Vk∣Xk∼FV′∣X=Xk(⋅),k=n+1,⋯ ,n+mV_k\mid X_k\sim F_{V'\mid X=X_k}(\cdot),k=n+1,\cdots,n+m, then the difference is

∣F^j(v,x)−Fj(v,x)∣=∣∑i∈CjH(Xi,x)(I{Vi≤v}−FV∣X=x(v))+ω∑k∈UjH(Xk,x)r^(Vk,Xk)(I{Vk≤v}−FV∣X=x(v))∣∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk)≤∑i∈CjH(Xi,x)∣I{Vi≤v}−FV∣X=x(v)∣+ω∑k∈UjH(Xk,x)r^(Vk,Xk)∣I{Vk≤v}−FV∣X=x(v)∣∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk).\begin{aligned} \left|\widehat{F}_j(v,x)-F_j(v,x)\right|=\frac{\left|\sum_{i\in C_j}H(X_i,x)\left(\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right)+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)\left(\mathbb{I}\{V_k\leq v\}-F_{V\mid X=x}(v)\right)\right|}{\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)} \\ &\leq\frac{\sum_{i\in C_j}H(X_i,x)\left|\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right|+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)\left|\mathbb{I}\{V_k\leq v\}-F_{V\mid X=x}(v)\right|}{\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)}. \end{aligned}

Denote

A=∑i∈CjH(Xi,x)∣I{Vi≤v}−FV∣X=x(v)∣+ω∑k∈UjH(Xk,x)r^(Vk,Xk)∣I{Vk≤v}−FV∣X=x(v)∣,A=\sum_{i\in C_j}H(X_i,x)\left|\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right|+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k)\left|\mathbb{I}\{V_k\leq v\}-F_{V\mid X=x}(v)\right|,
A1=∑i∈CjH(Xi,x)∣I{Vi≤v}−FV∣X=x(v)∣,A_1=\sum_{i\in C_j}H(X_i,x)\left|\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right|,
A2=ω∑k∈UjH(Xk,x)r(Vk,Xk)∣I{Vk≤v}−FV∣X=x(v)∣,A_2=\omega\sum_{k\in U_j}H(X_k,x)r(V_k,X_k)\left|\mathbb{I}\{V_k\leq v\}-F_{V\mid X=x}(v)\right|,
A3=ω∑k∈UjH(Xk,x)(r^(Vk,Xk)−r(Vk,Xk))∣I{Vk≤v}−FV∣X=x(v)∣,A_3=\omega\sum_{k\in U_j}H(X_k,x)\left(\widehat{r}(V_k,X_k)-r(V_k,X_k)\right)\left|\mathbb{I}\{V_k\leq v\}-F_{V\mid X=x}(v)\right|,
B=∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk).B=\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)\widehat{r}(V_k,X_k).

Then

∣F^j(v,x)−FV∣X=x(v)∣≤AB=A1+A2+A3B.\left|\widehat{F}_j(v,x)-F_{V\mid X=x}(v)\right|\leq\frac{A}{B}=\frac{A_1+A_2+A_3}{B}.

In the following steps, E(A12)\mathbb{E}(A_1^2) and E(A22)\mathbb{E}(A_2^2) will be calculated to show their order with Chebyshev’s inequality. For simplicity, we only consider (Xj,Vj)(X_j,V_j) follows H0\mathrm{H}_0 since it only affect H(Xj,x)I{Vj≤v}H(X_j,x)\mathbb{I}\{V_j\leq v\}. For A1A_1, we have

E[A12]=(∣C∣+1)E[H2(Xi,x)(I{Vi≤v}−FV∣X=x(v))2]+∣C∣(∣C∣+1)E2[H(Xi,x)(I{Vi≤v}−FV∣X=x(v))].\mathbb{E}\left[A_1^2\right]=(|C|+1)\mathbb{E}\left[H^2(X_i,x)\left(\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right)^2\right]+|C|(|C|+1)\mathbb{E}^2\left[H(X_i,x)\left(\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right)\right].

Where (Xi,Vi)(X_i,V_i) is a data point in calibration set. For the first term, we have

E[H2(Xi,x)(I{Vi≤v}−FV∣X=x(v))2]≤E[H2(Xi,x)]=∫RdH2(Xi,x)f(Xi) dXi\begin{aligned} \mathbb{E}\left[H^2(X_i,x)\left(\mathbb{I}\{V_i\leq v\}-F_{V\mid X=x}(v)\right)^2\right]\leq\mathbb{E}\left[H^2(X_i,x)\right] \\ &=\int_{\mathbb{R}^d}H^2(X_i,x)f(X_i)\,\mathrm{d}X_i \end{aligned}
=∫Rdh−2dK2(∥Xi−x∥2h)f(Xi) dXi≤(i)∥f(Xi)∥∞∫Rdh−2dK2(∥Xi−x∥2h) dXi=(ii)∥f(Xi)∥∞∫Rdh−2dK2(∥t∥2) d(x+th)≤∥f(Xi)∥∞∫Rdh−dK2(∥t∥2) dt=∥f(Xi)∥∞h−d∫RdK2(∥t∥2) dt.(9)\begin{aligned} &= \int_{\mathbb{R}^{d}} h^{-2d}K^{2}\left(\frac{\lVert X_i-x\rVert_2}{h}\right)f(X_i)\,dX_i\\ &\underset{\text{(i)}}{\leq} \lVert f(X_i)\rVert_{\infty}\int_{\mathbb{R}^{d}}h^{-2d}K^{2}\left(\frac{\lVert X_i-x\rVert_2}{h}\right)\,dX_i\\ &\underset{\text{(ii)}}{=} \lVert f(X_i)\rVert_{\infty}\int_{\mathbb{R}^{d}}h^{-2d}K^{2}(\lVert t\rVert_2)\,d(x+th)\\ &\leq\lVert f(X_i)\rVert_{\infty}\int_{\mathbb{R}^{d}}h^{-d}K^{2}(\lVert t\rVert_2)\,dt\\ &= \lVert f(X_i)\rVert_{\infty}h^{-d}\int_{\mathbb{R}^{d}}K^{2}(\lVert t\rVert_2)\,dt. \tag*{(9)} \end{aligned}

The inequality (i) holds because f(Xi)≤∥f(Xi)∥∞f(X_i) \leq\lVert f(X_i)\rVert_{\infty} and the equality (ii) replace Xi−xh\frac{X_i-x}{h} with tt. For the second term, following the same technique as in the first term we have

E[H(Xi,x)(1{Vi≤v}−FV∣X=x(v))]=E[E[H(Xi,x)(1{Vi≤v}−FV∣X=x(v))∣Xi]]=E[H(Xi,x)(FV∣X=Xi(v)−FV∣X=x(v))]≤∫Rdh−dK(∥Xi−x∥2h)L∥Xi−x∥2βf(Xi) dXi=L∥f(Xj)∥∞∫Rdh−dK(∥Xi−x∥2h)∥Xi−x∥2β dXj=L∥f(Xj)∥∞∫RdK(∥t∥2)hβ dt=L∥f(Xj)∥∞hβ∫RdK(∥t∥2)∥t∥2β dt.(10)\begin{aligned} \mathbb{E}\left[H(X_i,x)\left(1\{V_i\leq v\}-F_{V\mid X=x}(v)\right)\right] &=\mathbb{E}\left[\mathbb{E}\left[H(X_i,x)\left(1\{V_i\leq v\}-F_{V\mid X=x}(v)\right)\mid X_i\right]\right]\\ &=\mathbb{E}\left[H(X_i,x)\left(F_{V\mid X=X_i}(v)-F_{V\mid X=x}(v)\right)\right]\\ &\leq\int_{\mathbb{R}^{d}}h^{-d}K\left(\frac{\lVert X_i-x\rVert_2}{h}\right)L\lVert X_i-x\rVert_2^{\beta}f(X_i)\,dX_i\\ &=L\lVert f(X_j)\rVert_{\infty}\int_{\mathbb{R}^{d}}h^{-d}K\left(\frac{\lVert X_i-x\rVert_2}{h}\right)\lVert X_i-x\rVert_2^{\beta}\,dX_j\\ &=L\lVert f(X_j)\rVert_{\infty}\int_{\mathbb{R}^{d}}K(\lVert t\rVert_2)h^{\beta}\,dt\\ &=L\lVert f(X_j)\rVert_{\infty}h^{\beta}\int_{\mathbb{R}^{d}}K(\lVert t\rVert_2)\lVert t\rVert_2^{\beta}\,dt. \tag*{(10)} \end{aligned}

where FV∣X=x(v)F_{V\mid X=x}(v) is the conditional CDF of VV evaluated at V=vV=v given X=xX=x. Combine (C1) and (C2), with Chebyshev’s inequality, for large enough MM, we can get:

P(∣A1∣≥M[(n+1)∥f(Xi)∥∞(h−d∫RdK2(∥t∥2) dt+nLhβ∫RdK(∥t∥2)∥t∥2β dt)])≤1M.P\left(|A_1|\geq\sqrt{M\left[(n+1)\lVert f(X_i)\rVert_{\infty}\left(h^{-d}\int_{\mathbb{R}^{d}}K^{2}(\lVert t\rVert_2)\,dt+nLh^{\beta}\int_{\mathbb{R}^{d}}K(\lVert t\rVert_2)\lVert t\rVert_2^{\beta}\,dt\right)\right]}\right)\leq\frac{1}{M}.

Then

A1=Op(nh−d+n2hβ).(11)A_1=O_p\left(\sqrt{nh^{-d}+n^{2}h^{\beta}}\right). \tag*{(11)}

For A2A_2, we have

E[A22]=ω2(∣U∣−1)E[H2(Xk,x)r(Vk,Xk)(1{Vk≤v}−FV∣X=x(v))2]+ω2(∣U∣−1)∣U∣E2[H(Xk,x)r(Vk,Xk)(1{Vk≤v}−FV∣X=x(v))].\begin{aligned} \mathbb{E}\left[A_2^2\right] &=\omega^2(|\mathcal{U}|-1)\mathbb{E}\left[H^2(X_k,x)r(V_k,X_k)\left(1\{V_k\leq v\}-F_{V\mid X=x}(v)\right)^2\right]\\ &\quad+\omega^2(|\mathcal{U}|-1)|\mathcal{U}|\mathbb{E}^2\left[H(X_k,x)r(V_k,X_k)\left(1\{V_k\leq v\}-F_{V\mid X=x}(v)\right)\right]. \end{aligned}

Where (Xk,Vk)(X_k,V_k) is a data point in test set. For the first term, we have

E[H2(Xk,x)r(Vk,Xk)(1{Vk≤v}−FV∣X=x(v))2]≤∥r(Vk,Xk)∥∞2E[H2(Xk,x)]≤∥r(Vk,Xk)∥∞2∥f(Xk)∥∞h−d∫RdK2(∥t∥2) dt.(12)\begin{aligned} \mathbb{E}\left[H^2(X_k,x)r(V_k,X_k)\left(1\{V_k\leq v\}-F_{V\mid X=x}(v)\right)^2\right]\leq\lVert r(V_k,X_k)\rVert_{\infty}^{2}\mathbb{E}\left[H^2(X_k,x)\right] \\ &\le\lVert r(V_k,X_k)\rVert_{\infty}^{2}\lVert f(X_k)\rVert_{\infty}h^{-d}\int_{\mathbb{R}^{d}}K^{2}(\lVert t\rVert_{2})\,dt. \tag*{(12)} \end{aligned}

For the second term,

E[H(Xk,x)r(Vk,Xk)(I{Vk≤v}−FV∣X=x(v))]=E[E[H(Xk,x)r(Vk,Xk)(I{Vk≤v}−FV∣X=x(v))∣Xk]]=E[H(Xk,x)E[r(Vk,Xk)(I{Vk≤v}−FV∣X=x(v))∣Xk]]=E[H(Xk,x)(FV∣X=Xk(v)−FV∣X=x(v))]≤L∥f(Xk)∥∞hβ∫RdK(∥t∥2)∥t∥2β dt.(13)\begin{aligned} \mathbb{E}\left[H(X_k,x)r(V_k,X_k)\left(\mathbb{I}\{V_k\le v\}-F_{V\mid X=x}(v)\right)\right] &=\mathbb{E}\left[\mathbb{E}\left[H(X_k,x)r(V_k,X_k)\left(\mathbb{I}\{V_k\le v\}-F_{V\mid X=x}(v)\right)\mid X_k\right]\right]\\ &=\mathbb{E}\left[H(X_k,x)\mathbb{E}\left[r(V_k,X_k)\left(\mathbb{I}\{V_k\le v\}-F_{V\mid X=x}(v)\right)\mid X_k\right]\right]\\ &=\mathbb{E}\left[H(X_k,x)\left(F_{V\mid X=X_k}(v)-F_{V\mid X=x}(v)\right)\right]\\ &\le L\lVert f(X_k)\rVert_{\infty}h^{\beta}\int_{\mathbb{R}^{d}}K(\lVert t\rVert_{2})\lVert t\rVert_{2}^{\beta}\,dt. \tag*{(13)} \end{aligned}

Combine (C4) and (C5), follow the same procedure as A1A_1, we can get

A2=Op(ωmh−d+m2hβ).(14)A_2=O_p\left(\omega\sqrt{mh^{-d}}+m^{2}h^{\beta}\right). \tag*{(14)}

The we find the order of A3A_3 by calculating E[∣A3∣]\mathbb{E}[|A_3|], that is

E[∣A3∣]=ω(m−1)E[∣H(Xk,x)(r^(Vk,Xk)−r(Vk,Xk))(I{Vk≤v}−FV∣X=x(v))∣]≤ω(m−1)E[∣H(Xk,x)(r^(Vk,Xk)−r(Vk,Xk))∣]≤ω(m−1)E[H2(Xk,x)]E[(r^(Vk,Xk)−r(Vk,Xk))2]≤ωmh−d/2E[(r^(Vk,Xk)−r(Vk,Xk))2].\begin{aligned} \mathbb{E}[|A_3|] &=\omega(m-1)\mathbb{E}\left[\left|H(X_k,x)(\hat r(V_k,X_k)-r(V_k,X_k))(\mathbb{I}\{V_k\le v\}-F_{V\mid X=x}(v))\right|\right]\\ &\le\omega(m-1)\mathbb{E}\left[\left|H(X_k,x)(\hat r(V_k,X_k)-r(V_k,X_k))\right|\right]\\ &\le\omega(m-1)\sqrt{\mathbb{E}[H^{2}(X_k,x)]\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^{2}\right]}\\ &\le\omega mh^{-d/2}\sqrt{\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^{2}\right]}. \end{aligned}

So with Markov’s inequality, for large enough MM, we have

P(∣A3∣≥Mωmh−d/2E[(r^(Vk,Xk)−r(Vk,Xk))2])≤1M.P\left(|A_3|\ge M\omega mh^{-d/2}\sqrt{\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^{2}\right]}\right)\le\frac{1}{M}.

Then

A3=Op(ωmh−d/2E[(r^(Vk,Xk)−r(Vk,Xk))2]).(15)A_3=O_p\left(\omega mh^{-d/2}\sqrt{\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^{2}\right]}\right). \tag*{(15)}

For BB, we have :

B=∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r^(Vk,Xk)=∑i∈CjH(Xi,x)+ω∑k∈UjH(Xk,x)r(Vk,Xk)+ω∑k∈UjH(Xk,x)(r^(Vk,Xk)−r(Vk,Xk)).(16)\begin{aligned} B&=\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)\hat r(V_k,X_k)\\ &=\sum_{i\in C_j}H(X_i,x)+\omega\sum_{k\in U_j}H(X_k,x)r(V_k,X_k)\\ &\quad+\omega\sum_{k\in U_j}H(X_k,x)(\hat r(V_k,X_k)-r(V_k,X_k)). \tag*{(16)} \end{aligned}

In equality (C8), item of the first term and the second term have bounded expectation and item of the third term is op(1)o_p(1), so by LLN, we derive B/(n+ωm)→E[H(Xi,x)]B/(n+\omega m) \to\mathbb{E}[H(X_i,x)]. For E[H(Xi,x)]\mathbb{E}[H(X_i,x)], we have

E[H(Xi,x)]=∫Rdh−dK(∥Xi−x∥2h)f(Xi) dXi=∫RdK(∥t∥2)(f(x)+o(1)) dt=(i)f(x)+o(1)≥f(x)2.(17)\begin{aligned} \mathbb{E}[H(X_i,x)] &= \int_{\mathbb{R}^d} h^{-d}K\left(\frac{\lVert X_i-x\rVert_2}{h}\right)f(X_i)\,\mathrm{d}X_i\\ &= \int_{\mathbb{R}^d}K(\lVert t\rVert_2)(f(x)+o(1))\,\mathrm{d}t\\ &\overset{(i)}{=} f(x)+o(1)\\ &\ge\frac{f(x)}{2}. \tag*{(17)} \end{aligned}

The equation (i) relies on the continuity of density function. Combine (C3), (C6), (C7) and (C9), we have

AB=Op(nh−d+n2hβ+ωmh−d+m2hβ+ωmh−d/2E[(r^(Vk,Xk)−r(Vk,Xk))2]n+ωm)=Op(hβ+1(n+ωm)hd+ωmn+ωmh−d/2E[(r^(Vk,Xk)−r(Vk,Xk))2]).\begin{aligned} \frac{A}{B}=O_p\left(\frac{\sqrt{nh^{-d}+n^2h^\beta+\omega\sqrt{mh^{-d}+m^2h^\beta}+\omega m h^{-d/2}\sqrt{\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^2\right]}}}{n+\omega m}\right) \\ &=O_p\left(\sqrt{h^\beta+\frac{1}{(n+\omega m)h^d}}+\frac{\omega m}{n+\omega m}h^{-d/2}\sqrt{\mathbb{E}\left[(\hat r(V_k,X_k)-r(V_k,X_k))^2\right]}\right). \end{aligned}

Then the proof is completed. □

Proof of Theorem 4

Given the validity of data-enhanced p-values, the remaining proof is similar to the general proof of conditional calibration (Fithian and Lei [7]; Liang et al. 2024). Define the conditional statistic Φj=([(Xi,Wi)]i∈Cj,{(Xk,Wk)}k∈Uj)\Phi_j=([(X_i,W_i)]_{i\in C_j},\{(X_k,W_k)\}_{k\in U_j}) where [(Xi,Wi)]i∈Cj[(X_i,W_i)]_{i\in C_j} denotes the unordered set of {(Xi,Wi)}i∈Cj\{(X_i,W_i)\}_{i\in C_j}. We first prove that pDE,jp_{\mathrm{DE},j} is still super-uniform given Φj\Phi_j under the jj-th null hypothesis. This is obviously by the fact that {(Xi,Wi)}i∈Cj\{(X_i,W_i)\}_{i\in C_j} are i.i.d. under the jj-th null hypothesis and conditional on the unordered set does not break the exchangeability.

Then we notice that the rejection set Rj\mathcal{R}_j is fixed given Φj\Phi_j. Given the unordered set [(Xi,Wi)]i∈Cj[(X_i,W_i)]_{i\in C_j} and each test point (Xn+k,Wn+k)(X_{n+k},W_{n+k}) with k≠jk\ne j, the value of pDE,l(j)p_{\mathrm{DE},l}^{(j)} is fixed. So we have {pDE,l(j)}l≠j\{p_{\mathrm{DE},l}^{(j)}\}_{l\ne j} fixed given Φj\Phi_j. Since Rj\mathcal{R}_j is obtained by applying BH on (pDE,1(j),…,pDE,j−1(j),0,pDE,j+1(j),…,pDE,m(j))(p_{\mathrm{DE},1}^{(j)},\ldots,p_{\mathrm{DE},j-1}^{(j)},0,p_{\mathrm{DE},j+1}^{(j)},\ldots,p_{\mathrm{DE},m}^{(j)}), it is also fixed given Φj\Phi_j.

Now we can analyse the FDR term-wisely. For each j∈Ij\in\mathcal{I}, let γ0∗j\gamma_{0}^{*j} be the number of rejections of the algorithm if we replace pDE,jp_{\mathrm{DE},j} with 00. We have

E(I{j∈R}∣R∣∨1)=E(I{pDE,j≤α∣Rj∣/m}⋅I{ζj≤γ∗/∣Rj∣}∣R∣∨1)=E(I{pDE,j≤α∣Rj∣/m}⋅I{ζj≤γj0∗/∣Rj∣}γj0∗)=E(I{pDE,j≤α∣Rj∣/m}∣Rj∣)=E{E(I{pDE,j≤α∣Rj∣/m}∣Rj∣∣Φj)}≤(i)E{E(I{pDE,j≤α∣Rj∣/m}∣Φj)1∣Rj∣}≤(ii)αm.\begin{aligned} \mathbb{E}\left(\frac{\mathbb{I}\{j\in\mathcal{R}\}}{|\mathcal{R}|\vee1}\right) = \mathbb{E}\left(\frac{\mathbb{I}\{p_{\mathrm{DE},j}\le\alpha|\mathcal{R}_j|/m\}\cdot\mathbb{I}\{\zeta_j\le\gamma^*/|\mathcal{R}_j|\}}{|\mathcal{R}|\vee1}\right) \\ &= \mathbb{E}\left(\frac{\mathbb{I}\{p_{\mathrm{DE},j} \le\alpha|\mathcal{R}_j|/m\}\cdot\mathbb{I}\{\zeta_j \le\gamma_{j0}^{*}/|\mathcal{R}_j|\}}{\gamma_{j0}^{*}}\right) \\ = \mathbb{E}\left(\frac{\mathbb{I}\{p_{\mathrm{DE},j} \le\alpha|\mathcal{R}_j|/m\}}{|\mathcal{R}_j|}\right) \\ = \mathbb{E}\left\{\mathbb{E}\left(\left.\frac{\mathbb{I}\{p_{\mathrm{DE},j} \le\alpha|\mathcal{R}_j|/m\}}{|\mathcal{R}_j|}\right|\Phi_j\right)\right\} \\ \underset{(i)}{\leq} \mathbb{E}\left\{\mathbb{E}\left(\left.\mathbb{I}\{p_{\mathrm{DE},j} \le\alpha|\mathcal{R}_j|/m\}\right|\Phi_j\right)\frac{1}{|\mathcal{R}_j|}\right\} \\ \underset{(ii)}{\leq} \frac{\alpha}{m}. \end{aligned}

Here (i) and (ii) follows from conclusions that pDE,jp_{\mathrm{DE},j} is valid given Φj\Phi_j and Rj\mathcal{R}_j is fixed given Φj\Phi_j. Taking summation over j∈Uj \in\mathcal{U} leads to the FDR control conclusion. □

Proof of Theorem 5

By Algorithm 2, the optimal bandwidth hjh_j is measureable with respect to Φj\Phi_j. This indicates that pDE,jadap_{\mathrm{DE},j}^{\mathrm{ada}} with bandwidth hjh_j is still super-uniform conditional on Φj\Phi_j under the assumption that Du,j\mathcal{D}_{u,j} are exchangeable. Since the following conditional calibration procedure is exactly the same and each auxiliary p-value vector (pDE,1(j),ada,…,pDE,j−1(j),ada,0,pDE,j+1(j),ada,…,pDE,m(j),ada)(p_{\mathrm{DE},1}^{(j),\mathrm{ada}},\ldots,p_{\mathrm{DE},j-1}^{(j),\mathrm{ada}},0,p_{\mathrm{DE},j+1}^{(j),\mathrm{ada}},\ldots,p_{\mathrm{DE},m}^{(j),\mathrm{ada}}) is computed with hjh_j, the rejection set Rjada\mathcal{R}_j^{\mathrm{ada}} is still fixed given Φj\Phi_j. Therefore, the remaining proof follows exactly the same to the proof of Theorem 4. □

Additional experiments

In this section we provide more experimental results to further illustrate the performance of different methods considered in this paper. Section D.1-D.8 contain additional simulation results. All simulations are performed on the same setting to that in § 4.1.1- § 4.1.2 with different varying parameters or algorithms. If not otherwise stated, the parameters will be the same to those in the main text.

Estimation of r^\hat{r}

We evaluate the performance of our methods with the density ratio function r^\hat{r} estimated using the SVM algorithm, in contrast to the GLM algorithm used in the main text. All other settings remain identical to those in the main text, with a fixed test sample size of m=1000m = 1000.

Results in Table D1 show that SVM algorithm could lead to a worse estimator than the GLM for the residual score since DEL and DEL-fix both have power reduced with this algorithm. Although DEL-fix is severely influenced with the residual score, DEL mitigates this issue with an adaptive bandwidth. For the quantile score, DEL shows quite similar power across two algorithms, while DEL-fix is still negatively affected. For both scores, DEL is more robust compared with DEL-fix, showing the advantage of using adaptive bandwidths.

AlgorithmValueResidual scoreQuantile score
DELDEL-fixUELDELDEL-fixUEL
GLMFDR0.1530.1130.1080.1530.1340.119
Power0.6810.3440.3330.8020.6170.384
SVMFDR0.1060.0190.1120.1540.1180.126
Power0.4900.0120.3120.8390.4090.413

Table D1. FDR and power results with r^\hat{r} estimated by two kinds of algorithms. Bold numbers represent the best results.

Paramter ω\omega

We investigate the influence of ω\omega in our proposed methods by showing performance under different values of ω∈{0.25,0.5,0.75}\omega\in\{0.25, 0.5, 0.75\}. The rest settings are fixed with m=1000m = 1000.

From Table D2 we can see the value of ω\omega only slightly influence the performance of our methods. Among all three values, DEL still achieves the highest power in most cases except for ω=0.75\omega= 0.75 combined with the quantile score. In this case, the power of DEL and DEL-fix are quite close.

ω\omegaValueResidual scoreQuantile score
DELDEL-fixUELDELDEL-fixUEL
0.25FDR0.1570.1200.1180.1540.1400.125
Power0.7530.3390.3490.7910.6480.397
0.5FDR0.1540.1340.1160.1540.1480.140
Power0.7450.3750.3350.7520.7490.384
0.75FDR0.1510.1390.1170.1600.1530.138
Power0.7440.4320.3170.7830.8060.440

Table D2. FDR and power results under different values of ω\omega. Bold numbers represent the best results.

Relationship between r^1\hat{r}_1 and ww

In § 2.2, we briefly discussed the choice of ww, noting that a larger ww should be preferred when the estimator r^1\hat{r}_1 is believed to be accurate. Here, we empirically validate this intuition using simulated evidence. Under the same setting as in § 4.1.2 with m=500m = 500, we compare DEL with a variant that uses an oracle rr. Because obtaining the exact distribution of machine-learning–based scores is infeasible, we approximate the oracle rr by training it on an extensive leave-out dataset whose size is ten times larger than that used in the main experiments. We then record and compare the power curves of the two methods across different values of ww.

Figure D1 shows that DEL achieves relatively higher power when equipped with the oracle density ratio function compared to the estimated one. We also observe that the optimal choice of ww is around 0.6 for the oracle version, substantially larger than the optimal value of 0.1 obtained with the estimated version. This pattern provides empirical support for our proposed rule for selecting the parameter ww.

Figure D1. Power comparison of DEL using the estimated density ratio rr and its oracle counterpart. The dotted lines highlight the highest power attained by each method.

Novelty ratio

We compare our DEL method both with LCP, CP and our two simplified versions under different novelty ratios. We consider ratio in the range {0.1,0.15,0.2}\{0.1, 0.15, 0.2\} and keep the remaining settings as fixed with m=1000m = 1000.

Table D3–Table D4 contains results under different novelty ratios in the test data. As the ratio increases, the signal becomes stronger and all methods have their power improved. Except for this pattern, the relative performance in all comparisons remain the same to simulation results in the main text.

RatioValueResidual scoreQuantile score
DELLCPCPDELLCPCP
0.1FDR0.1530.1480.1080.1530.2000.119
Power0.1160.0460.0690.2550.0600.136
0.15FDR0.1460.2060.0950.1450.1930.143
Power0.4670.3410.2610.6070.4180.432
0.2FDR0.1550.1930.1310.1580.1790.163
Power0.7550.6200.5670.8390.7020.727

Table D3. FDR and power results under different novelty ratios for DEL, LCP and CP. Bold numbers represent the best results.

RatioValueResidual scoreQuantile score
DELDEL-fixUELDELDEL-fixUEL
0.1FDR0.0800.0390.0380.0980.0470.057
Power0.1190.0350.0260.2170.0930.045
0.15FDR0.1420.0820.0870.1550.1170.106
Power0.4770.1400.1350.5940.3510.173
0.2FDR0.1420.1120.1260.1530.1370.134
Power0.6680.3460.3290.7990.6110.399

Table D4. FDR and power results under different novelty ratios for DEL, DEL-fix and UEL. Bold numbers represent the best results.

Comparison with AdaDetect

We compare our proposed DEL method with AdaDetect under the same setting as Appendix § 4.1.1. In this experiment, we focus on the quantile scores, and both methods successfully control the FDR at the target level α\alpha.

Figure D2 display the power of both methods under different test sample sizes. Since AdaDetect is designed for marginal novelty detection and does not incorporate conditional distributional information, its statistical power is substantially lower than that of DEL.

Figure D2. Power of DEL and AdaDetect under different test sample sizes m∈{500,750,1000,1250,1500}m \in\{500, 750, 1000, 1250, 1500\}.

Training sample size ∣Dt∣|\mathcal{D}_t|

We compare our DEL method with LCP, CP, and AdaDetect under varying training sample sizes ∣Dt∣∈{500,750,1000,1250,1500}|\mathcal{D}_t| \in\{500, 750, 1000, 1250, 1500\}, while fixing the test sample size at

m=1000m = 1000 and keeping the other settings unchanged. Here we focus on the quantile scores, and all methods successfully control the FDR at the target level.

Figure D3 shows that as the training sample size increases, all methods derive higher power since the prediction model becomes more accurate. In addition, DEL consistently achieves the highest power across different training sample size.

Figure D3. Power of different methods under varying training sample sizes ∣Dt∣∈{500,750,1000,1250,1500}\lvert D_t\rvert\in\{500, 750, 1000, 1250, 1500\}.

Influence of covariate shift

In Theorem 1, we require the marginal distributions satisfy PX=QXP_X = Q_X to ensure the DEL is valid in finite sample. Here we illustrate DEL is robust against certain degree of covariate shift. We take m=1000m = 1000 and consider both mean and variance shifts on the conditional variable XdX_d. That is, instead of N(0,1)N(0,1), we have Xd∼N(μ,1)X_d \sim N(\mu,1) or Xd∼N(0,σX2)X_d \sim N(0,\sigma_X^2) for the test data. The distribution of clean labeled data is still fixed as Xd∼N(0,1)X_d \sim N(0,1). The score function is taken as the quantile score.

Figure D4-Figure D5 show that even the condition PX=QXP_X = Q_X does not hold, the DEL procedure can still control the FDR within a certain range of covariate shift. It can be observed from the figures that mean shift and enlarged variance do not result in FDR increase. If the variance is reduced, the FDR will tend to inflate the nominal level. However, it is still controlled around the nominal level α\alpha even with a halved variance.

Figure D4. FDR and power of DEL when there is mean shift in the test covariates.

Figure D5. FDR and power of DEL when there is variance shift in the test covariates.

Categorical responses

Since we focus on regression settings in the main text, here we provide an example where W=0,1W = 0,1 is categorical. The data is generated as follows:

  • X∼U[0,1]X \sim U[0,1]

  • For inliers, Pr⁡(W=0∣X=x)=11+exp⁡{−10(x−0.5)}\Pr(W = 0 \mid X = x) = \frac{1}{1+\exp\{-10(x-0.5)\}}

  • For outliers, Pr⁡(W=0∣X=x)=1−11+exp⁡{−10(x−0.5)}\Pr(W = 0 \mid X = x) = 1-\frac{1}{1+\exp\{-10(x-0.5)\}}

Therefore, there is conditional distribution drift between the inliers and outliers. We take ∣T∣=∣C∣=500|\mathcal{T}| = |\mathcal{C}| = 500 with varying mm. The score function is taken as the probability output of a random-forest model trained on Dt\mathcal{D}_t. The bandwidth for RLCP is taken as h=0.5h = 0.5, and the candidate set for DEL is taken as Λ={0.25,0.5,0.75,1}\Lambda= \{0.25, 0.5, 0.75, 1\}. All the remaining parameters are the same to experiments in the main text.

Figure D6 exhibits the same qualitative pattern as Figure 1 in the main text. The key difference is that all methods show reduced power in this setting. This degradation is primarily due to the discrete nature of WW. Once WW becomes categorical, its conditional distribution given XX contains only two point masses, which substantially limits the amount of exploitable information in the detection procedure. Consequently, even when the inlier and outlier distributions differ significantly, the power is still below 0.5. In such scenarios, employing a well-calibrated predictive model with accurate probability estimates can be particularly beneficial.

Figure D6. FDR and power of different methods under the classification scenario.

References

  1. [1]Angelopoulos, A.N., Bates, S., et al.: Conformal prediction: A gentle introduction. Foundations and Trends® in Machine Learning 16(4), 494–591 (2023)
  2. [2]Bates, S., Candès, E., Lei, L., Romano, Y., Sesia, M.: Testing for outliers with conformal p-values. The Annals of Statistics 51(1), 149–178 (2023)
  3. [3]Bai, T., Jin, Y.: Optimized conformal selection: Powerful selective inference after conformity score optimization. arXiv preprint arXiv:2411.17983 (2024)arxiv.org/abs/2411.17983
  4. [4]Boukerche, A., Zheng, L., Alfandi, O.: Outlier detection: Methods, models, and classification. ACM Computing Surveys (CSUR) 53(3), 1–37 (2020)
  5. [5]Del Buono, F., Calabrese, F., Baraldi, A., Paganelli, M., Guerra, F.: Novelty detection with autoencoders for system health monitoring in industrial environments. Applied Sciences 12(10), 4931 (2022)DOI
  6. [6]Erfani, S.M., Rajasegarar, S., Karunasekera, S., Leckie, C.: High-dimensional and large-scale anomaly detection using a linear one-class svm with deep learning. Pattern Recognition 58, 121–134 (2016)DOI
  7. [7]Fithian, W., Lei, L.: Conditional calibration for false discovery rate control under dependence. The Annals of Statistics 50(6), 3091–3118 (2022)arxiv.org/abs/2007.10438
  8. [8]Fanaee-T, H.: Bike Sharing. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5W894 (2013)
  9. [9]Guan, L.: Localized conformal prediction: A generalized inference framework for conformal prediction. Biometrika 110(1), 33–50 (2023)arxiv.org/abs/2106.08460
  10. [10]Hore, R., Barber, R.F.: Conformal prediction with local weights: randomization enables robust guarantees. Journal of the Royal Statistical Society Series B: Statistical Methodology, 103 (2024)DOI
  11. [11]Hong, C., Hauskrecht, M.: Mcode: Multivariate conditional outlier detection. arXiv preprint arXiv:1505.04097 (2015)arxiv.org/abs/1505.04097
  12. [12]Hariri, S., Kind, M.C., Brunner, R.J.: Extended isolation forest. IEEE transactions on knowledge and data engineering 33(4), 1479–1489 (2019)DOI
  13. [13]Hall, P., Wolff, R.C., Yao, Q.: Methods for estimating a conditional distribution function. Journal of the American Statistical association 94(445), 154–163 (1999)DOI
  14. [16]Jobe, J.M., Pokojovy, M.: A cluster-based outlier detection scheme for multivariate data. Journal of the American Statistical Association 110(512), 1543–1551 (2015)DOI
  15. [17]Kaggle: House Prices: Advanced Regression Techniques. https://www.kaggle.com/c/house-prices-advanced-regression-techniques. Accessed: 2025-08-31 (2016)
  16. [18]Lei, J., G’Sell, M., Rinaldo, A., Tibshirani, R.J., Wasserman, L.: Distribution-free predictive inference for regression. Journal of the American Statistical Association 113(523), 1094–1111 (2018)arxiv.org/abs/1604.04173
  17. [21]Liu, F.T., Ting, K.M., Zhou, Z.-H.: Isolation forest. In: Proceedings of the 2008 Eighth IEEE International Conference on Data Mining, pp. 413–422. IEEE Computer Society, Los Alamitos, CA (2008)DOI
  18. [23]Marandon, A., Lei, L., Mary, D., Roquain, E.: Adaptive novelty detection with false discovery rate guarantee. The Annals of Statistics 52(1), 157–183 (2024)arxiv.org/abs/2208.06685
  19. [24]Röch­ner, P., Rothlauf, F.: Unsupervised anomaly detection of implausible electronic health records: a real-world evaluation in cancer registries. BMC Medical Research Methodology 23(1), 125 (2023)DOI
  20. [25]Silverman, B.W.: Density Estimation for Statistics and Data Analysis vol. 26. CRC press, Boca Raton, FL (1986)
  21. [26]Song, X., Wu, M., Jermaine, C., Ranka, S.: Conditional anomaly detection. IEEE Transactions on Knowledge and Data Engineering 19(5), 631–645 (2007)DOI
  22. [27]Tibshirani, R.J., Foygel Barber, R., Cands, E., Ramdas, A.: Conformal prediction under covariate shift. In: Advances in Neural Information Processing Systems, vol. 32 (2019)arxiv.org/abs/1904.06019
  23. [28]Vovk, V., Gammerman, A., Shafer, G.: Algorithmic Learning in a Random World. Springer, New York (2005)
  24. [31]Zhang, Y., Jiang, H., Ren, H., Zou, C., Dou, D.: Automats: Automatic model selection for novelty detection with error rate control. In: Advances in Neural Information Processing Systems, vol. 35, pp. 19917–19929 (2022)DOI

AI tools statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

No code, data or supplementary files were declared for this version.

Pick where to look, or just type