Exchangeability - Conformal Prediction's KEY assumption
Conformal Prediction의 핵심 가정인 Exchangeability(교환가능성)에 대해 알아보자. 이 가정이 어떻게 CP를 가능하게 하는지 수학적 정의와 예시를 확인해보자.
지난 글에서 Conformal Prediction (이하 CP) 에서 최소한의 가정하에 불확실성을 표현할 수 있다고 말했다. 이때 필요한 최소한의 가정이 Exchangeability (교환가능성) 이다. 일단 exchangeability의 정의를 살펴보자.
Definition of Exchangeability

정의를 본다면 이해하기가 쉽다. 결합분포의 랜덤변수를 permutation(순열)을 통해 순서를 바꾸어도 (a.k.a. 결합분포의 변수를 서로 바꾸어도) 분포가 일정하다는 참 간단한 가정이다. 사실 이 가정을 보고 바로 생각날만한 통계에서 많이 쓰는 가정이 하나 더 있다. 바로 i.i.d. (Independent and Identically Distributed, 독립항등분포) 가정이다. 당연하게 i.i.d.이면 exchangeability하고, exchangeability한다고 i.i.d.는 아니라는 것을 정의를 통해 확인할 수 있다.
그렇다면 i.d. (Identically Distributed)는 어떨까? 먼저 exchangeability 하다면 i.d.라고 볼 수 있다. 왜냐하면 순서를 바꿔도 분포가 같다면, 각 변수의 주변분포도 같아야 하기 때문이다. 반대로 i.d. 이면 exchangeability하다고 할 수 있을까? 간단한 반례를 통해 확인해보자.
$$ \begin{align*} \mathbb{P}(X_1=1, X_2=1) = 0.3 \\ \mathbb{P}(X_1=1, X_2=0) = 0.2 \\ \mathbb{P}(X_1=0, X_2=1) = 0.1 \\ \mathbb{P}(X_1=0, X_2=0) = 0.4 \end{align*} $$
으로 정의된 두 확률변수 에 대하여 $X_1, X_2$는 i.d.이지만 exchangeability를 만족하지는 않는다. 그렇다면 세가지 가정에 대해 다음과 같이 정리할 수 있다.
$$ \text{i.i.d. } \Rightarrow \text{ Exchangeability } \Rightarrow \text{ i.d.} $$
다시 말해, Exchangeability는 i.i.d.보단 약하지만 i.d. 보다 강한 가정이라고 볼 수 있다.
Properties of Exchangeability
Exchangeability를 만족하는 확률벡터는 순서통계량을 다루기가 쉬워진다. $\mathcal{Z} = \mathbb{R}$에 대해서, 아래와 같은 분포를 표현할 수 있다. 여기서 $\delta_z$는 delta function을 의미한다.
$$(Z_1, \cdots, Z_n) | (Z_{(1)}, \cdots, Z_{(n)}) \sim \frac1{n!}\sum_{\sigma \in \mathcal{S}_n} \delta_{(Z_{\sigma(1)}, \cdots, Z_{\sigma(n)})} $$
이 식을 직관적으로 설명하자면, 순서통계량이 주어지면 원래 변수는 모든 가능한 permutation에 대해 동일한 확률을 가진다는 것이다. 그럼 이 성질을 단변량에 적용한다면,
$$\begin{align*}&Z_i | (Z_{(1)}, \cdots, Z_{(n)}) \sim \frac1{n}\sum_{j=1}^n \delta_{Z_{\sigma(j)}} & \\ &\Rightarrow \forall k \in [n], \mathbb{P}(Z_i \leq Z_{(k)}) \geq \frac{k}{n} & \cdots \text{[1, Fact 2.15 (i)]}\\ &\Rightarrow \forall \tau \in [0, 1], \mathbb{P}(Z_i \leq Quantile(Z;\tau) \geq \tau & \cdots \text{[1, Fact 2.15 (ii)]} \end{align*}$$
로 볼 수 있다. 특히 [1, Fact 2.15 (ii)]를 주목해야 한다. 분위수의 확률의 하한(과 상한)을 둘수 있기에, 이 부분이 이후 CP를 증명하는데 쓰이게 된다.
참고문헌
- Angelopoulos, Anastasios N., Rina Foygel Barber, and Stephen Bates. 2024. “Theoretical Foundations of Conformal Prediction.” arXiv [Math.ST]. arXiv. https://arxiv.org/abs/2411.11824.
- Angelopoulos, Anastasios N., and Stephen Bates. 2021. “A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification.” arXiv [Cs.LG]. arXiv. https://arxiv.org/abs/2107.07511.