Posts / Exploring the power curve of the Ansari-Bradley test

The Ansari-Bradley test is a popular rank-based nonparametric test for a difference in scale/dispersion parameters. In this post, we explore its power curve in a numerical simulation.

The Ansari-Bradley test

Let $\mathbf{x} = (x_1, x_2, \ldots, x_n)$ and $\mathbf{y} = (y_1, y_2, \ldots, y_m)$ be random samples. Let $N=n+m$. Let $\mathbf{V} = (V_1, V_2, \ldots, V_N)$ be a boolean vector of zeros and ones, where $V_i = 1$ if the $i^\textrm{th}$ order statistic of the pooled sample $(\mathbf{x}, \mathbf{y})$ is come from $\mathbf{x}$.

With this notation, we can define the Ansari-Bradley statistic $\operatorname{AB}$ as follows:

$$ \operatorname{AB} = \frac{1}{2} n (N + 1) - \sum_{i=1}^N \left| i - \frac{1}{2}(N+1) \right| \cdot V_i. $$

The asymptotic approximation is defined by the following normal distribution:

$$ \mu = \begin{cases} \frac{1}{4} n(N + 2), & \;\textrm{if}\;N\;\textrm{is even,}\\ \frac{1}{4} n(N + 1)^2/N, & \;\textrm{if}\;N\;\textrm{is odd,} \end{cases} $$ $$ \sigma^2 = \begin{cases} nm(N^2-4) / (48(N-1)) & \;\textrm{if}\;N\;\textrm{is even,}\\ nm(N+1)(N^2+3) / (48N^2) & \;\textrm{if}\;N\;\textrm{is odd.} \end{cases} $$

Power curve

For exploring the power curve, we compare $\mathcal{N}(0, 1)$ and $\mathcal{N}(0, \sigma^2)$. We enumerate $\sigma$ values (aka “ratio”) in $[1; 10]$. The sample size are in $n \in \{5, 10, 20 \}$, the statistical level $\alpha = 0.05$, all the statistical tests are two-sided. Just for fun, in addition to the Ansari-Bradley test, we also consider Welch’s t-test and Mann-Whitney U test. Here are the power curves:

We can make the following observation:

References (1)