Permutation p-values
(WIP, personal notes)

I need to clarify permutation tests in their diverse forms, and how to best prove their p-values. For this, I need also to look at order statistics in more details.

TODO:

Order vectors

If x=(x0,,xn)x = (x_0,…,x_n) is a vector, let o(x)=x()o(x) = x_{()} its order vector. TODO:

Claim B

For a vector t=(t0,,tm)t = (t_0,…,t_m), and any xx∈ℝ: x>t(k){i:x>ti}k+1. x>t_{(k)}\quad ⇔\quad  ♯\{i: x > t_i\} ≥ k+1.

Proof of claim B.

TODO!!

Claim A

For a vector t=(t0,,tm)t = (t_0,…,t_m) {i:t0ti}kt0>t(mk) ♯\{i: t_0 ≤ t_i\} ≤ k \quad ⇔\quad t_0 > t_{(m-k)}

Proof of claim A

{i:t0ti}k{i:t0>ti}(m+1)k( {i:t0>ti}{i:t0ti}={0,,m})t0>t(mk)([claim B])\begin{aligned} &♯\{i: t_0 ≤ t_i\} ≤ k \\ ⇔ \quad &♯\{i: t_0 > t_i\} ≥ (m+1)-k \quad & \text{( $\{i:t_0>t_i\}⊔\{i:t_0≤t_i\}=\{0,…,m\}$)} \\ ⇔ \quad &t_0 > t_{(m-k)} \quad & \text{([claim B])} \\ \end{aligned}

Order statistics

An order statistics is the order vector associated to a random vector. TODO:

Finite group of permutations

Let GG be a finite group and U(G)U(G) the uniform distribution on GG. Assume that GG acts on some space 𝓧𝓧.

Claim G2

If XX is a random variable with value in 𝓧𝓧, then the following are equivalent:

Claim G1

Fix g,g1,,gmg,g_1,…,g_m random elements of GG.

Proof of Claim G1

TODO P(g=a,gig=aii1)=P(g=a,gi=a¹aii1)=P(g=a)iP(gi=a¹ai)=P(g=a)iP(gia=ai)=P(g=a)iP(gig=ai)? P(g = a, g_ig = a_i ∀i≥1) = P(g=a, g_i = a⁻¹a_i ∀i≥1) = P(g=a) ∏_i P(g_i = a⁻¹a_i) = P(g=a) ∏_i P(g_ia = a_i) = P(g=a) ∏_i P(g_ig = a_i) … ?

Permutation tests

Let T=(T0,,Tm)T = (T_0,…,T_m) be a random vector, and let T()=(T(0),,T(m))T_{()} = (T_{(0)},…,T_{(m)}) its order statistics2

Consider the following condition, call it (C): i,j,k:P(TiT(k))=P(TjT(k)). ∀i,j,k:\ P(T_i ≤ T_{(k)}) = P(T_j ≤ T_{(k)}).

Recall also that TT is called exchangeable iff TσTT ∼ σT for any permutation σSnσ ∈ S_n (where (σT)i=Tσi(σT)_i = T_{σi} by definition). 3 We have that exchangeability implies condition (C): Take σσ with σi=jσi = j: P(TiT(k))=P((σT)i(σT)(k))(exchangeability)=P((T)σi(σT)(k))(def)=P((T)j(σT)(k))(choice of σ)=P((T)j(T)(k))(order vectors are stable for permutation).\begin{aligned} & P(T_i ≤ T_{(k)}) \\ =\quad & P((σT)_i ≤ (σT)_{(k)}) \quad & \text{(exchangeability)}\\ =\quad & P((T)_{σi} ≤ (σT)_{(k)}) \quad & \text{(def)}\\ =\quad & P((T)_{j} ≤ (σT)_{(k)}) \quad & \text{(choice of $σ$)}\\ =\quad & P((T)_{j} ≤ (T)_{(k)}) \quad & \text{(order vectors are stable for permutation)}. \end{aligned}

Question

Is exchangeability actually equivalent to condition (C)?

Claim 1

Under (C), we have P(T0T(k))(k+1)(m+1). P(T_0 ≤ T_{(k)}) ≥ \frac{(k+1)}{(m+1)}. with equality if 4 the coordinates of TT are distinct almost surely.

Proof of claim 1

P(T0T(k))=(m+1)¹iP(TiT(k))(because of (C))=(m+1)¹iE𝟭(TiT(k))(P(A)=E𝟭(A))=Ei𝟭(TiT(k))m+1(linearity of E)=E{i:TiT(k)}m+1(sum of indicators is count)Ek+1m+1(property of order vector (holds pointwise))=k+1m+1(expectation of a constant).\begin{aligned} P(T_0 ≤ T_{(k)}) &= (m+1)⁻¹ ∑_i P(T_i ≤ T_{(k)}) &&\quad \text{(because of (C))} \\ &= (m+1)⁻¹ ∑_i E 𝟭(T_i ≤ T_{(k)}) &&\quad \text{($P(A) = E𝟭(A)$)} \\ &= E ∑_i \frac{𝟭(T_i ≤ T_{(k)})}{m+1} &&\quad \text{(linearity of $E$)} \\ &= E \frac{♯\{i: T_i ≤ T_{(k)}\}}{m+1} &&\quad \text{(sum of indicators is count)} \\ &≥ E \frac{k+1}{m+1} &&\quad \text{(property of order vector (holds pointwise))} \\ &= \frac{k+1}{m+1} &&\quad \text{(expectation of a constant)}. \end{aligned} Note that for a fixed vector tt, {i:tit(k)}k+1♯\{i: t_i ≤ t_{(k)}\} ≥ k+1 with equality iff t(k)t(k+1)t_{(k)}≠t_{(k+1)}. In particular, if the TiT_is are disjoint almost surely, T(k)T(k+1)T_{(k)}≠T_{(k+1)} holds almost surely, and the inequality above is an equality.

Question

Do we have, in the above claim, that the inequality is an equality iff the coordinates are distinct almost surely? I think what we have is: the coordinates are distinct a.s. iff for each kk, we have an equality. TODO: check this.

Claim 2

Let XX a random variable with values in a space 𝓧𝓧, t:𝓧t:𝓧 → ℝ some statistics, and G{g0,,gm}G ≔ \{g_0,…,g_m\} be a finite group acting on 𝓧𝓧 such that gXXgX ∼ X for all gGg∈G. Define T(X)(t(g0X),,t(gmX))T(X) ≔ (t(g_0X),…,t(g_mX)). Then T(X)T(X) satisfies condition (C).

Proof of claim 2

Note that T(X)()=T(gX)()T(X)_{()} = T(gX)_{()} for all gGg ∈ G. Indeed, this is equivalent to saying that T(X)T(X) and T(gX)T(gX) are permutations of each other, which holds since (g0X,,gmX)(g_0X,…,g_mX) and (g0gX,,gmgX)(g_0gX,…,g_mgX) are permutations of each other (because in turn (g0,,gm)(g_0,…,g_m) and (g0g,,gmg)(g_0g,…,g_mg) are permutations of each other). Fix then i,ji,j and kk, we get: P(T(X)iT(X)(k))=P(T(gi¹gjX)iT(gi¹gjX)(k))(by gi¹gjXX)=P(T(gi¹gjX)iT(X)(k))(by T(X)()=T(gi¹gjX)())=P(T(X)jT(X)(k))(by T(gi¹gjX)i=t(gigi¹gjX)=t(gjX)=T(X)j).\begin{aligned} P(T(X)_i ≤ T(X)_{(k)}) &= P(T(g_i⁻¹g_jX)_i ≤ T(g_i⁻¹g_jX)_{(k)}) &&\quad \text{(by $g_i⁻¹g_jX ∼ X$)} \\ &= P(T(g_i⁻¹g_jX)_i ≤ T(X)_{(k)}) &&\quad \text{(by $T(X)_{()} = T(g_i⁻¹g_jX)_{()}$)} \\ &= P(T(X)_j ≤ T(X)_{(k)}) &&\quad \text{(by $T(g_i⁻¹g_jX)_{i} = t(g_ig_i⁻¹g_jX) = t(g_jX) = T(X)_j$)}. \end{aligned}

Claim 3

Let XX a random variable with values in a space 𝓧𝓧, t:𝓧t:𝓧 → ℝ some statistics, and G{g0,,gm}G ≔ \{g_0,…,g_m\} be a finite group acting on 𝓧𝓧 such that gXXgX ∼ X for all gGg∈G. Let g1,,gmiidU(G)g_1,…,g_m \overset{iid}{∼} U(G)5. Define T(X)(t(X),t(g1X),,t(gmX))T(X) ≔ (t(X),t(g_1X),…,t(g_mX)). Then T(X)T(X) satisfies condition (C).

Proof of claim 3

It suffices to see that T(X)T(X) is exchangeable (since exchangeability implies (C)): Note that if g0,g1,,gmiidU(G)g_0,g_1, …,g_m \overset{iid}{∼} U(G), then (g0X,,gmX)(g_0X,…,g_mX) is exchangeable, since (g0,,gm)(g_0,…,g_m) itself is exchangeable (because an iid vector is always exchangeable). From gXXgX ∼ X with gU(G)g ∼ U(G), we get (X,g1X,,gmX)(gX,g1gX,gmgX). (X,g_1X,…,g_mX) ∼ (gX, g_1gX,…g_mgX). Furthermore, from claim g1, we have that g,g1g,,gmgiidU(G)g, g_1g, …, g_mg \overset{iid}{∼} U(G). It follows that (X,g1X,,gmX)(gX,g1gX,,gmgX) (X,g_1X,…,g_mX) ∼ (gX,g_1gX,…,g_mgX) is exchangeable, and so is then the vector T(X)=(tX,tg1X,,tgmX)(tgX,tg1gX,,tgmgX). T(X) = (tX,tg_1X,…,tg_mX) ∼ (tgX,tg_1gX,…,tg_mgX).

Question

How to deal with sampling the gig_is without replacement instead of with replacement? Does claim 3 hold if (g1,,gm)U(Gm*)(g_1,…,g_m) ∈ U(G^{m*}), with Gm*={(g1,gm)Gm:i,gi1,i,jgigij}G^{m*} = \{(g_1,…g_m) ∈ G^m: ∀i, g_i ≠ 1, ∀i,j g_i≠g_ij\} ? Then

So I think everything holds

Claim 4

In the context of claim 1, letting πr{i:T0Ti}m+1π_r ≔ \frac{♯\{i: T_0 ≤ T_i\}}{m+1}, we have P(πrkm+1)km+1. P\left(π_r ≤ \frac{k}{m+1}\right) ≤ \frac{k}{m+1}.

Proof of claim 4

This essentially follows from claim 1 using also claim a: P(πrkm+1)=P({i:T0Ti}k)=P(T0>T(mk))(Claim A)=1P(T0T(mk))1mk+1m+1(Claim 1)=km+1\begin{aligned} P\left(π_r ≤ \frac{k}{m+1}\right) &= P\left(♯\{i: T_0 ≤ T_i\} ≤ k\right) \quad & \text{} \\ &= P\left(T_0 > T_{(m-k)}\right) \quad & \text{(Claim A)} \\ &= 1 - P\left(T_0 ≤ T_{(m-k)}\right) \quad & \text{} \\ &≤ 1 - \frac{m-k+1}{m+1} \quad & \text{(Claim 1)} \\ &= \frac{k}{m+1} \quad & \text{} \\ \end{aligned}

References

Kallenberg, Olav. 2021. Foundations of Modern Probability. Probability Theory and Stochastic Modelling. Springer International Publishing. https://doi.org/10.1007/978-3-030-61871-1.

  1. If the wording confuses: I say XX is independent from YY, if the pair (X,Y)(X,Y) is independent (i.e. P(XAYB)=P(XA)P(YB)P(X∈A∧Y∈B) = P(X∈A)P(Y∈B)), and (X1,,Xn)(X_1,…,X_n) is independent iff the tuple itself is (i.e. P(i,XiAi)=iP(XiAi)P(∀i,X_i∈A_i) = ∏_i P(X_i ∈ A_i)). It holds then that independence of a tuple can be reduced to independence of pairs. Indeed we have that (X1,,Xn)(X_1,…,X_n) is independent iff X1X_1 is independent from (X2,,Xn)(X_2,…,X_n) and that tuple is independent itself. Note that the direction is direct to verify, but the direction not quite: I think we need to use something like the “grouping” corollary 4.7 of (Kallenberg 2021, p 87).↩︎

  2. That is, T()T_{()} is the unique permutation of TT that is isotonic (=nondecreasing) in its indices. TODO: why is T()T_{()} measurable?↩︎

  3. QUESTION: that is iff TσTT∼σT for σU(Sn)σ∼U(S_n) independent of TT, right?↩︎

  4. is it iff?↩︎

  5. i.e. the gig_is are iid uniformly in GG↩︎