# Asynchronous Gossip Algorithms for Rank-Based Statistical Methods

Anna van Elst, Igor Colin, Stephan Clémençon

► To cite this version:

Anna van Elst, Igor Colin, Stephan Clémençon. Asynchronous Gossip Algorithms for Rank-Based Statistical Methods. 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA), Oct 2025, Dubrovnik, France. pp.448-455, 10.1109/FLTA67013.2025.11336445. hal-05510217

HAL Id: hal-05510217

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

Submitted on 13 Feb 2026

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 CC BY 4.0 - Attribution - International License
Asynchronous Gossip Algorithms
for Rank-Based Statistical Methods

Anna van Elst

LTCI, Télécom Paris

Institut Polytechnique de Paris

anna.vanelst@telecom-paris.fr

Igor Colin

LTCI, Télécom Paris

Institut Polytechnique de Paris

igor.colin@telecom-paris.fr

Stephan Clémençon

LTCI, Télécom Paris

Institut Polytechnique de Paris

stephan.clemencon@telecom-paris.fr

**Abstract**—As decentralized AI and edge intelligence become increasingly prevalent, ensuring robustness and trustworthiness in such distributed settings has become a critical issue—especially in the presence of corrupted or adversarial data. Traditional decentralized algorithms are vulnerable to data contamination as they typically rely on simple statistics (e.g., means or sum), motivating the need for more robust statistics. In line with recent work on decentralized estimation of trimmed means and ranks, we develop gossip algorithms for computing a broad class of rank-based statistics, including L-statistics and rank statistics—both known for their robustness to outliers. We apply our method to perform robust distributed two-sample hypothesis testing, introducing the first gossip algorithm for Wilcoxon rank-sum tests. We provide rigorous convergence guarantees, including the first convergence rate bound for asynchronous gossip-based rank estimation. We empirically validate our theoretical results through experiments on diverse network topologies.

***Index Terms***—Gossip Algorithms, Distributed Hypothesis Testing, Ranking, Robustness, Rate Bound Analysis

# I. INTRODUCTION

The rise of the Internet of Things (IoT) has led to a surge in connected devices, generating vast amounts of data at the network's edge. At the same time, AI systems are becoming more complex, pushing the need for decentralized approaches. Edge intelligence—processing data close to where it is generated—offers a promising alternative to traditional, centralized AI. In this context, gossip algorithms have emerged as a lightweight, scalable way for devices to collaborate. These algorithms operate by having each node communicate only with its neighbors, making them ideal for environments like peer-to-peer systems or sensor networks, where data is naturally distributed and communication is limited. Gossip methods have been used for tasks such as computing averages, maximum, and sum [2, 9, 12], and they also play a role in decentralized learning and optimization [4, 6]. However, their reliance on local communications makes them vulnerable to corrupted nodes—whether due to hardware failures or malicious attacks. To make gossip algorithms more robust, it is therefore necessary to go beyond simple statistics estimation.

In our recent work [15], we introduced GOTRIM, a gossip algorithm for estimating robust means (i.e., trimmed means), which leverages our GORANK algorithm for rank estimation. In this paper, we build on that foundation by developing gossip algorithms capable of computing a broad class of rank-based statistics. These include L-statistics (linear combinations of

order statistics) and rank statistics (weighted sums of transformed ranks) [14]. This enables us to develop the first gossip algorithm for robust two-sample hypothesis testing. While there is a large body of literature on distributed Bayesian hypothesis testing using belief propagation [1, 11, 13], to the best of our knowledge, no gossip-based algorithm exists for performing rank tests, such as the Wilcoxon rank-sum test [8].

We also observe that GOTRIM converges more slowly to the true trimmed mean when the trimming parameter $\alpha$ is large (i.e., close to 0.5). To address this, we introduce an enhanced version, *Adaptive* GOTRIM which provides more accurate estimates when the trimmed mean approaches the median. Additionally, motivated by our prior work showing that asynchronous communication (i.e., no global clock synchronization) is not only more practical in real-world situations but also yields slightly better performance, all our proposed gossip algorithms are designed for the asynchronous setting.

Another key contribution of this work is the convergence analysis of our gossip algorithms. We begin by analyzing GORANK in the asynchronous setting—a challenging setting that was omitted in our prior work. We then turn to the convergence analysis of our new gossip algorithms, focusing on the synchronous setting for clarity and simplicity. However, similar results can be extended to the asynchronous setting.

Our main contributions are summarized as follows:

* We establish the first theoretical convergence rate for asynchronous gossip-based ranking on arbitrary communication graphs: we prove an $O(1/\sqrt{t})$ convergence rate for the expected absolute error (where $t \ge 1$ denotes the number of iterations), matching the rate in the synchronous setting.

* We propose a novel gossip algorithm for estimating a wide class of rank-based statistics, enabling Wilcoxon rank-sum tests. To the best of our knowledge, this is the first robust gossip algorithm for two-sample distributed hypothesis testing. We prove a convergence rate of order $O(1/t)$ for Wilcoxon statistic estimation in the synchronous setting.

* We introduce *Adaptive* GOTRIM, designed to accelerate convergence when the trimmed mean is close to the median. We first establish an $O(1/\sqrt{t})$ bound on the expected absolute error for the original GOTRIM in the synchronous setting, and obtain the same rate for *Adaptive* GOTRIM.

* Finally, we conduct experiments on various contaminated data distributions and network topologies.
This paper is organized as follows. Section 2 introduces the notation and problem formulation. In Section 3, we analyze the convergence of *Asynchronous GORANK*. Section 4 presents a gossip algorithm for estimating rank-based statistics, along with its application to rank tests and a convergence analysis for the Wilcoxon statistic. Section 5 introduces *Adaptive GOTRIM* and provides its theoretical convergence guarantees. Finally, Section 6 reports numerical experiments.

## II. PRELIMINARIES

This section introduces the necessary notations, describes the setup, and formulates the problem of estimating rank-based statistics (e.g., rank statistics and L-statistics).

a) **Notation:** Let $n \ge 1$. We denote scalars by normal lowercase letters $x \in \mathbb{R}$, vectors (identified as column vectors) by boldface lowercase letters $\mathbf{x} \in \mathbb{R}^n$, and matrices by boldface uppercase letters $\mathbf{X} \in \mathbb{R}^{n \times n}$. The set $\{1, \dots, n\}$ is denoted by $[n]$, $\mathbb{R}_n$'s canonical basis by $\{e_k : k \in [n]\}$, the indicator function of any event $A$ by $\mathbb{I}_A$, the transpose of any matrix $\mathbf{M}$ by $\mathbf{M}^\top$ and the cardinality of any finite set $F$ by $|F|$. By $\mathbf{I}_n$ is meant the identity matrix in $\mathbb{R}^{n \times n}$, by $\mathbf{1}_n = (1, \dots, 1)^\top$ the vector in $\mathbb{R}^n$ whose coordinates are all equal to one, by $\| \cdot \|$ the usual $\ell_2$ norm, by $\| \cdot \|_{op}$ the operator norm, and by $\mathbf{A} \odot \mathbf{B}$ the Hadamard product of matrices $\mathbf{A}$ and $\mathbf{B}$. We model a network of size $n > 0$ as an undirected graph $\mathcal{G} = (V, E)$, where $V = [n]$ denotes the set of vertices and $E \subseteq V \times V$ the set of edges. We denote by $\mathbf{A}$ its adjacency matrix, meaning that for all $(i, j) \in V^2$, $[\mathbf{A}]_{ij} = 1$ iff $(i, j) \in E$, and by $\mathbf{D}$ the diagonal matrix of vertex degrees. The graph Laplacian of $\mathcal{G}$ is defined as $\mathbf{L} = \mathbf{D} - \mathbf{A}$.

b) **Setup:** We study a decentralized setting involving $n \ge 2$ real-valued observations $X_1, \dots, X_n$, each located at a distinct node of a communication network modeled by a connected and non-bipartite graph $\mathcal{G} = (V, E)$; see [5]. Specifically, node $k \in [n]$ holds observation $X_k$. To simplify the analysis, we assume there are no ties: $X_k \ne X_l$ for any $k \ne l$. Communication is pairwise and occurs randomly: at each step, an edge $e \in E$ is selected with probability $p_e$, and the two connected nodes exchange information. We operate in an asynchronous gossip framework, where each node's local clock follows an independent Poisson process with rate 1. This setup is equivalent to a global Poisson clock of rate $n$, with a random edge activated at each tick, similar to the synchronous case (see [2] for clock modeling details). Under this framework, the probability that node $k$'s local clock ticks is $1/n$. Furthermore, each edge $e$ is activated at a tick with probability $p_e$. For simplicity, we assume a uniform selection among neighbors (see Figure 1), yielding

$$p_e = \frac{1}{n} \left( \frac{1}{d_i} + \frac{1}{d_j} \right), \text{ with } e = (i, j) \in E,$$

where $d_i$ and $d_j$ denote the degrees of nodes $i$ and $j$, respectively. We also consider the presence of outliers: under Huber's contamination model [7], a fraction $0 < \varepsilon < 1/2$ of the observations may be corrupted.

<figure><img src="image_2.png" /><figcaption>Fig. 1: Visualization of the Asynchronous Gossip Framework. At each tick, node $i$ wakes up with probability $1/n$ and selects a neighbor uniformly at random (with probability $1/d_i$).</figcaption></figure>

c) **Decentralized Estimation of Rank-based Statistics:** Our objective is to design a gossip-based algorithm that accurately estimates rank-based statistics. Denote $r_k$ is the rank of observation $X_k$, computed as $r_k = 1 + \sum_{l=1}^n \mathbb{I}_{\{X_k > X_l\}}$ in the absence of ties. The problem can be formulated as the following general expression

$$T_n = \sum_{k=1}^{n} f(r_k) g(X_k), \quad (1)$$

where $f$ is a function of the ranks $r_k$, and $g$ is a function of the observations $X_k$. By choosing $g$ as indicator functions of the observations and $f$ as appropriate transformations of the ranks, we recover rank statistics. A notable special case is the Wilcoxon statistic, used in the Wilcoxon rank sum test—a well-known robust nonparametric test for comparing two samples. Assume the dataset $S = \{X_1, \dots, X_N\}$ is partitioned into two disjoint subsets, $S_1$ and $S_2$, i.e., $S = S_1 \cup S_2$, with $|S_1| = n_1$ and $|S_2| = n_2$. The Wilcoxon statistic is given by

$$t_n = \sum_{k=1}^{n} r_k b_k, \quad (2)$$

where $b_k = \mathbb{I}_{\{X_k \in S_1\}}$. This corresponds to a linear rank statistic with no transformation applied to the ranks. More general rank statistics apply a transformation to the ranks, i.e., using $f(r_k)$ for some function $f$. For instance, the van der Waerden statistic employs $f = \Phi^{-1}$, the quantile function of the standard normal distribution.

For $g = \text{id}$ (the identity function) and $f$ a function of the ranks, we obtain L-statistics. Typically, $f$ is an indicator function of the ranks (possibly scaled by a constant). For example, denoting $m = \lfloor \alpha n \rfloor$, the trimmed mean is an L-statistic with function $f$ given by $f(r_k) = \mathbb{I}_{\{r_k \in I_{n,\alpha}\}}/(n-2m)$ and inclusion interval $I_{n,\alpha} = [m+1, n-m]$, see [15].

## III. ASYNCHRONOUS DISTRIBUTED RANKING

In this section, we present the convergence analysis of Asynchronous GORANK, as introduced in prior work [15]. We show that expected absolute error decreases at a rate of $O(1/\sqrt{ct})$, where the constant $c > 0$ (defined in Theorem 1) reflects the connectivity of the graph $\mathcal{G}$. A more connected graph yields
a larger value of c, resulting in a tighter (i.e., smaller) upper bound on the convergence rate.

Asynchronous GORANK, described in Algorithm 1, operates similarly to its synchronous counterpart by exploiting the fact that ranks can be estimated via pairwise comparisons. Specifically, for $k = 1, \dots, n$,

$$r_k = 1 + n \left( \frac{1}{n} \sum_{l=1}^{n} \mathbb{I}_{\{X_k > X_l\}} \right) = 1 + n r'_k. \quad (3)$$

The algorithm proceeds as follows: each node $k \in [n]$ maintains local estimates $R_k(t)$ and $R'_k(t)$ of the rank $r_k$ and its normalized form $r'_k$, respectively, at iteration $t \ge 1$. Additionally, each node keeps a local iteration counter $C_k(t)$ and an auxiliary observation $Y_k(t)$. When nodes $i$ and $j$ are selected, they exchange their auxiliary observations. Then, each node $k \in \{i, j\}$ increments its counter $C_k(t)$ and updates its estimate $R'_k(t)$ by computing the running average of the previous estimate $R'_k(t-1)$ and the indicator function $\mathbb{I}_{\{X_k > Y_k(t-1)\}}$. Finally, $R_k(t)$ is updated using Equation (3).

**Algorithm 1 Asynchronous GoRank**

1. **Init:** For each $k \in [n]$, $Y_k \leftarrow X_k$, $R'_k \leftarrow 0$, $C_k \leftarrow 1$.

2. **for** $t = 0, 1, \dots$ **do**

3. &nbsp;&nbsp;&nbsp;&nbsp;Draw $e = (i, j) \in E$ with probability $p_e > 0$.

4. &nbsp;&nbsp;&nbsp;&nbsp;**for** $k \in \{i, j\}$ **do**

5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $R'_k \leftarrow (1 - 1/C_k) R'_k + (1/C_k) \mathbb{I}_{\{X_k > Y_k\}}$.

6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update rank estimate: $R_k \leftarrow nR'_k + 1$.

7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $C_k \leftarrow C_k + 1$.

8. **end for**

9. Swap auxiliary observation: $Y_i \leftrightarrow Y_j$.

10. **end for**

11. **Output:** Estimate of ranks $R_k$.

This random swapping procedure induces a random walk for each observation on the graph, characterized by the permutation matrix $\mathbf{W}_1(t) = \mathbf{I}_n - (\mathbf{e}_i - \mathbf{e}_j)(\mathbf{e}_i - \mathbf{e}_j)^\top$. Taking the expectation over the edge sampling process yields $\mathbf{W}_1 := \mathbb{E}[\mathbf{W}_1(t)] = \mathbf{I}_n - (1/|E|)\mathbf{L}$. For additional details, see [15]. For each $k \in [n]$, define $\mathbf{h}_k = (\mathbb{I}_{\{X_k > X_1\}}, \dots, \mathbb{I}_{\{X_k > X_n\}})^\top$; the true rank of observation $X_k$ is then given by $r_k = \mathbf{h}_k^\top \mathbf{1}_n + 1$. Let $p_k$ denote the probability that node $k$ is selected at each iteration. Under uniform node sampling, note that $p_k \ge 1/n$. At iteration $t = 0$, the observations have not been swapped yet, we obtain $R'_k(0) = 0$ and $R_k(0) = 1$. For iteration $t \ge 1$, the rank estimates can be expressed as

$$R_k(t) = 1 + n \cdot \left( \frac{1}{C_k(t)} \sum_{s=1}^{t} \delta_k(s) \mathbf{h}_k^\top \mathbf{W}_1(s-1)^\top \mathbf{e}_k \right),$$

where, for $s \ge 1$, the variables $\delta_k(s) \sim \mathcal{B}(p_k)$ are i.i.d. Bernoulli random variables with parameter $p_k$, and $\mathbf{W}_1(s) = \mathbf{W}_1(s) \cdots \mathbf{W}_1(0)$. The normalization factor is given by $C_k(t) = \sum_{s=1}^{t} \delta_k(s)$.

**Remark 1.** Real-world scenarios often contain tied values. When the dataset has many ties, GORANK (which assumes

no ties) exhibits a clear bias. The algorithm can be extended to handle the case of $\ell \ge 2$ tied observations using the mid-rank method: the rank assigned to the $\ell$ tied values is the average of the ranks they would have received in the absence of ties, that is, the average of $p+1, p+2, \dots, p+\ell$, which equals $p + (\ell+1)/2$; see [10]. In the presence of ties, the rank formula can be rewritten as

$$r_k = \frac{1}{2} + n r'_k, \quad r'_k = \frac{1}{n} \sum_{l=1}^{n} \left( \mathbb{I}_{\{X_k > X_l\}} + \frac{1}{2} \mathbb{I}_{\{X_k = X_l\}} \right).$$

This is again an average of indicator functions, and the algorithm update can be modified by replacing $\mathbb{I}_{\{X_k > Y_k\}}$ with $\mathbb{I}_{\{X_k > Y_k\}} + \frac{1}{2}\mathbb{I}_{\{X_k = Y_k\}}$. Note that in our algorithm, the case $\mathbb{I}_{\{X_k = X_k\}}$ occurs naturally since we use auxiliary variables.

We now present a convergence result for the Asynchronous GORANK algorithm, which establishes that the expected absolute error decreases at a rate of $O(1/\sqrt{ct})$.

**Theorem 1 (Convergence of Asynchronous GORANK).** Let $R_k(t)$ denote the estimate in Algorithm 1. Then, we have, for any $t > 0$:

$$\mathbb{E}[|R_k(t) - r_k|] \le \mathcal{O}\left(\frac{1}{\sqrt{ct}}\right) \cdot \sigma_n(r_k),$$

where $c$ represents the connectivity of the graph and corresponds to the spectral gap (or second smallest eigenvalue) of the Laplacian defined as $\mathbf{L}(P) = \sum_{e \in E} p_e \mathbf{L}_e$, and the rank functional $\sigma_n(r_k) = n^{3/2} \cdot \phi((r_k - 1)/n)$ is determined by the score generating function $\phi: u \in (0, 1) \rightarrow \sqrt{u(1-u)}$.

The remainder of this section is dedicated to proving Theorem 1. To this end, it is equivalent to study the convergence of $R'_k(t)$ to $\bar{h}_k = (1/n)\mathbf{h}_k^\top \mathbf{1}_n$. Observe that

$$\mathbb{E}[|R'_k(t) - \bar{h}_k|] = \mathbb{E}[|\tilde{S}_k(t)|/C_k(t)],$$

where $\tilde{S}_k(t) = \sum_{s=1}^t \delta_k(s) \mathbf{h}_k^\top \tilde{\mathbf{W}}_1(s-1)^\top \mathbf{e}_k$, and $\tilde{\mathbf{W}}_1(s-1) = \mathbf{W}_1(s-1) - (1/n)\mathbf{1}_n \mathbf{1}_n^\top$. Thus, the problem reduces to analyzing the expectation of a ratio of random variables. To deal with the non-linear term $1/C_k(t)$, we use the Taylor expansion of the function $f(x) = 1/x$ around $x = a$, where

$$\frac{1}{x} = \frac{1}{a} - \frac{x-a}{a^2} + \frac{(x-a)^2}{xa^2},$$

with $a = \mathbb{E}[C_k(t)] = p_k t$ and $x = C_k(t)$. Multiplying by $\tilde{S}_k(t)$, we obtain

$$\mathbb{E}[|\tilde{S}_k(t)/C_k(t)|] \le (1/p_k t) \mathbb{E}[|\tilde{S}_k(t)|] \quad (4)$$

$$+ (1/p_k^2 t^2) \mathbb{E}[|(C_k(t) - p_k t)\tilde{S}_k(t)|] \quad (5)$$

$$+ (1/p_k^2 t^2) \mathbb{E}[(C_k(t) - p_k t)^2 |\tilde{S}_k(t)|/C_k(t)]. \quad (6)$$

We now bound the terms in Equations (4) to (6) via the following lemmas; proofs are deferred to the technical appendix.

**Lemma 1.** We bound the term in Equation (4) as follows:

$$\frac{1}{p_k t} \mathbb{E}[|\tilde{S}_k(t)|] \le \sqrt{\frac{2n}{ct}} \cdot \|\mathbf{h}_k - \bar{h}_k \mathbf{1}_n\|.$$
**Lemma 2.** We bound the term in Equation (5) as follows:

$$ \frac{1}{(p_k t)^2} \mathbb{E}[(C_k(t) - p_k t) \tilde{S}_k(t)] \leq \frac{\sqrt{2}n}{ct} \cdot \|\mathbf{h}_k - \bar{h}_k \mathbf{1}_n\|. $$

**Lemma 3.** There exists a constant $\kappa > 0$ such that we can bound the term in Equation (6) as follows:

$$ \frac{1}{(p_k t)^2} \mathbb{E}[(C_k(t) - p_k t)^2 | \tilde{S}_k(t) | C_k(t)] \leq \frac{\kappa}{\sqrt{ct}} \cdot \|\mathbf{h}_k - \bar{h}_k\|. $$

Combining all previous lemmas, we obtain

$$ |\mathbb{E}[\tilde{S}_k(t)/C_k(t)]| \leq \mathcal{O}\left(\frac{1}{\sqrt{ct}}\right) \cdot \|\tilde{\mathbf{h}}_k\|. $$

Observe that $n\|\tilde{\mathbf{h}}_k\| = \sigma_n(r_k)$, see [15]. Finally, substituting $\mathbb{E}[R_k(t)] = n\mathbb{E}[R'_k(t)] + 1$ along with $r_k = n\bar{h}_k + 1$, completes the proof. Note that the same convergence guarantees for GO RANK with ties hold when replacing $\mathbf{h}_k$ with $\mathbf{v}_k = (v_{k1}, \dots, v_{kn})^\top$, where $v_{kl} = \mathbb{I}_{\{X_k > X_l\}} + (1/2)\mathbb{I}_{\{X_k = X_l\}}$.

## IV. GOSSIP ESTIMATION OF RANK-BASED STATISTICS

In this section, we introduce an asynchronous gossip algorithm for estimating rank-based statistics (see Algorithm 2), and apply it to the estimation of the Wilcoxon statistic. The proposed algorithm generalizes the GoTRIM algorithm by allowing for arbitrary rank-based weight functions $f$ and transformation functions $g$ applied to the observations.

Let $Z_k(t)$ and $W_k(t)$ denote the local estimates of the statistic and weight, respectively, at node $k$ and iteration $t$. Recall from Equation (1) that a rank-based statistic can be computed using standard gossip averaging:

$$ \frac{1}{n} \sum_{l=1}^{n} W_l(t) \cdot g(X_l), $$

where $W_l(t) = n \cdot f(R_l(t))$, and $R_l(t)$ denotes the rank of node $l$ at time $t$. Since ranks $R_k(t)$ evolve over time, the algorithm dynamically adjusts to account for past estimation errors. At each iteration, it corrects the estimate by injecting the difference term $(W_k(t) - W_k(t-1)) \cdot g(X_k)$ into the averaging process. This update consists of two key components: (1) An averaging step, described by the matrix $\mathbf{W}_2(t) = \mathbf{I}_n - (1/2)(e_i - e_j)(e_i - e_j)^\top$; (2) A correction step based on rank updates.

Putting these together, the evolution of the estimate vector $\mathbf{Z}(t) = (Z_1(t), \dots, Z_n(t))$ can be written as: for $t > 0$, $\mathbf{Z}(t) = \mathbf{W}_2(t) (\mathbf{Z}(t-1) + \delta(t) \odot \tilde{\mathbf{X}})$, where $\delta(t) = (\delta_1(t), \dots, \delta_n(t))$ with $\delta_k(t) = W_k(t) - W_k(t-1)$ and $\tilde{\mathbf{X}} = (g(X_1), \dots, g(X_n))$. Taking the expectation over the edge sampling process yields:

$$ \mathbb{E}[\mathbf{Z}(t)] = \mathbf{W}_2 \left( \mathbb{E}[\mathbf{Z}(t-1)] + \Delta\mathbf{w}(t) \odot \tilde{\mathbf{X}} \right), $$

where $\mathbf{W}_2 = \mathbf{I}_n - (1/2|E|)\mathbf{L}$ and $\Delta\mathbf{w}(t) = \mathbb{E}[\delta(t)]$. After the first iteration, since $Z_k(0) = 0$, the expected estimate becomes

## Algorithm 2 Gossip Estimation of Rank-based Statistics

1: **Input:** Choice of ranking algorithm rank (e.g., Asynchronous GoRank).

2: **Init:** $\forall k, Z_k \leftarrow 0, R_k \leftarrow \text{rank.init}(k), W_k \leftarrow 0$.

3: **for** $t = 0, 1, \dots$ **do**

4: &nbsp;&nbsp;&nbsp;&nbsp;Draw $e = (i, j) \in E$ with probability $p_e > 0$.

5: &nbsp;&nbsp;&nbsp;&nbsp;**for** $k \in \{i, j\}$ **do**

6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update rank: $R_k \leftarrow \text{rank.update}(k)$.

7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update weight: $W'_k \leftarrow n \cdot f(R_k)$.

8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $Z_k \leftarrow Z_k + (W'_k - W_k) \cdot g(X_k)$.

9: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $W_k \leftarrow W'_k$.

10: **end for**

11: Set $Z_i, Z_j \leftarrow (Z_i + Z_j)/2$.

12: Swap auxiliary variables: $\text{swap}(i, j)$.

13: **end for**

14: **Output:** Estimate of statistic $Z_k$.

$\mathbb{E}[\mathbf{Z}(1)] = \mathbf{W}_2 \Delta\mathbf{w}(1) \odot \tilde{\mathbf{X}}$. By recursion, for any $t > 0$, the expected value of the estimates evolves as:

$$ \mathbb{E}[\mathbf{Z}(t)] = \sum_{s=1}^{t} \mathbf{W}_2^{t+1-s} \Delta\mathbf{w}(s) \odot \tilde{\mathbf{X}}. $$

Note that, similar to the convergence analysis of GoTRIM, this gossip algorithm will converge to the correct value, since the averaging matrix can be decomposed as $\mathbf{W}_2 = (1/n)\mathbf{1}_n\mathbf{1}_n^\top + \mathbf{W}_2$, with spectral gap satisfying $0 < c_2 < 1$, where $c_2 = c/2$. Indeed, denoting $\mathbf{S}(s) = \Delta\mathbf{w}(s) \odot \tilde{\mathbf{X}}$, we have

$$ \sum_{s=1}^{t} \frac{1}{n} \mathbf{1}_n \mathbf{1}_n^\top \mathbf{S}(s) = \left( \frac{1}{n} \sum_{k=1}^{n} n \cdot \mathbb{E}[f(R_k(t))] \cdot g(X_k) \right) \mathbf{1}_n. $$

However, the full convergence analysis requires specific assumptions on the functions $f$ and $g$. In the following, we address the special case of the Wilcoxon statistic, see Equation (2). Following the convergence analysis of GoTRIM [15, Theorem 3], we establish that $Z_k(t)$ converges in expectation to the target Wilcoxon statistic at rate $\mathcal{O}(1/c^2t)$.

**Theorem 2 (Convergence of Wilcoxon Statistic Estimation).** Let $t_n$ be defined as in Equation (2), and let $\mathbf{Z}(t)$ denote the output of Algorithm 2 with $f = \text{id}$ and $g(X_k) = \mathbb{I}_{\{X_k \in S_1\}}$. Then, there exists $T^*$, such that for any $t > T^*$, we have

$$ \|\mathbb{E}[\mathbf{Z}(t)] - t_n \mathbf{1}_n\| \leq \mathcal{O}\left(\frac{1}{c^2t}\right), $$

where $c$ is defined in Theorem 1.

The result follows by adapting the proof of Theorem 3 in [15] and is deferred to the technical appendix

**Remark 2.** The Wilcoxon statistic can be used to perform a two-sample test, i.e., to test the null hypothesis that two samples are identically distributed. Intuitively, if the $X_j$ form a sample from a stochastically larger distribution, then the ranks of the $X_j$ in the pooled sample should be relatively large. The Wilcoxon rank sum test proceeds as follows: (1) compute
the mean $\mu = n_1(n+1)/2$ and standard deviation $\sigma = \sqrt{n_1n_2(n+1)/12}$; (2) compute the z-score $z = (t_n - \mu)/\sigma$ and derive the p-value using normal distribution approximation: $p = 2(1 - \Phi(|z|))$ where $\Phi$ denotes the cumulative distribution function of the standard normal distribution.

## V. FASTER GOSSIP FOR TRIMMED MEANS

In this section, we introduce Adaptive GoTRIM, an improved version of GoTRIM designed to accelerate convergence when the trimming parameter $\alpha$ is large (i.e., close to 0.5). The trimmed mean is denoted $\bar{x}_{\alpha}$. The algorithm is outlined in Algorithm 3. Our prior work established that the expected estimates produced by GoTRIM converge to the true trimmed mean at a rate of $O(1/ct)$. Here, we analyze the convergence of the expected absolute error, and show that it satisfies a bound of $O(\sqrt{1/ct})$ in the synchronous setting. We then extend this result to derive the same convergence rate.

**Algorithm 3** Fast Asynchronous GoTrim

1: **Input:** Trimming level $\alpha \in (0, 1/2)$, and choice of ranking algorithm rank (e.g., Asynchronous GoRank).

2: **Init:** $\forall k, Z_k \leftarrow 0, W_k \leftarrow 0$ and $R_k \leftarrow \text{rank}.\text{init}(k)$.

3: **for** $t = 1, 2, \dots$ **do**

4: &nbsp;&nbsp;&nbsp;&nbsp;Draw $e = (i, j) \in E$ with probability $p_e > 0$.

5: &nbsp;&nbsp;&nbsp;&nbsp;**for** $k \in \{i, j\}$ **do**

6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update rank: $R_k \leftarrow \text{rank}.\text{update}(k, t)$.

7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $W'_k \leftarrow w_{n,\alpha}(R_k)$.

8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $N_k \leftarrow N_k + (W'_k - W_k) \cdot X_k$.

9: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $M_k \leftarrow M_k + (W'_k - W_k)$

10: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set $W_k \leftarrow W'_k$.

11: **end for**

12: Set $N_i, N_j \leftarrow (N_i + N_j)/2$.

13: Set $M_i, M_j \leftarrow (M_i + M_j)/2$.

14: Swap auxiliary variables: $\text{swap}(i, j)$

15: **end for**

16: **Output:** Estimate of trimmed mean $N_k/\max(1, M_k)$.

Unlike the original GoTRIM, the proposed algorithm maintains an estimate of the average of the weights, denoted by $M_k$. Instead of returning the raw estimate $N_k$ directly, the algorithm normalizes $N_k$ by dividing it by $\max(1, M_k)$. In theory, this normalization should not significantly affect the outcome since $M_k$ converges to 1 over time. However, in practice, we observe that this adjustment helps mitigate the initial bias present in GoTRIM. Early in the process, when the rank estimates are less precise, the weighted average can be improperly normalized. By scaling $N_k$ with $\max(1, M_k)$, the algorithm corrects for this bias.

We now turn to the convergence guarantees. While bounding the expected value of the estimates is relatively straightforward, obtaining a bound on the expected absolute error requires a more refined convergence analysis.

Denote $Z(t) = N(t)/D(t)$ with element-wise division, where $N(t) = \sum_{s=1}^{t} W_2(t:s) \Delta W(s) \odot X$, with $\Delta W(s) = W(s) - W(s-1)$, and $D(t) = \max(1, M(t))$ defined element-wise, where $M(t) = \sum_{s=1}^{t} W_2(t:s) \Delta W(s) \odot 1_n$.

We begin by establishing a convergence guarantee for $N(t)$, which corresponds to the original GoTRIM estimate in the synchronous setting.

**Theorem 3.** Let $N(t)$ denote the original GoTRIM estimate. Then, there exists $T^* > 0$, such that for any $t > T^*$, we have

$$ \mathbb{E} \| \mathbf{N}(t) - \bar{x}_{\alpha} \mathbf{1}_n \|_2 \le \mathcal{O} \left( \frac{1}{\tilde{c} \sqrt{ct}} \right) \cdot \| \mathbf{K} \odot \mathbf{X} \| $$

where $\mathbf{K} = \left\{ \frac{\sqrt{6\sigma_n(r_i)}}{\gamma_i(1-2\alpha)} \right\}_{i=1}^n$, $\tilde{c} = 1 - \tilde{\lambda}$ with $\tilde{\lambda} = \sqrt{\lambda_2(2)}$, and $c$ is as defined in Theorem 2.

We first present a useful lemma on the convergence of the weights. This lemma extends Lemma 1 in [15] and provides a bound on the expected absolute error rather than on the error of the expected estimate.

**Lemma 4.** For all $k \in [n]$ and $t > 0$, we have

$$ \mathbb{E} |W_k(t) - w_{n,\alpha}(r_k)| \le \frac{3}{ct} \cdot \frac{\sigma_n(r_k)^2}{\gamma_k^2(1-2\alpha)}, \quad (7) $$

where $\gamma_k = \min(|r_k - a|, |r_k - b|) \ge \frac{1}{2}$, with $a = \lfloor \alpha n \rfloor + \frac{1}{2}$ and $b = n - \lfloor \alpha n \rfloor + \frac{1}{2}$ denoting the endpoints of the interval $I_{n,\alpha}$. The constants $c$ and $\sigma_n(\cdot)$ are as defined in Theorem 3.

Using the previous lemma, we can establish the convergence of the expected absolute error of the original GoTRIM estimates. The proofs of Lemma 4 and Theorem 3 are deferred to the technical appendix.

Now, we can prove that adaptive GoTRIM will have converge of the same order, stated in the following Theorem.

**Theorem 4.** Let $Z(t)$ denote the adaptive GoTRIM estimate. Then, there exists $T^* > 0$, such that for any $t > T^*$, we have

$$ \mathbb{E} \| Z(t) - \bar{x}_{\alpha} \mathbf{1}_n \|_2 \le \mathcal{O} \left( \frac{1}{\tilde{c} \sqrt{ct}} \right) \cdot \| \mathbf{K} \odot (\mathbf{X} + |\bar{x}_{\alpha}| \mathbf{1}_n) \| $$

where $\mathbf{K}$, $\tilde{c}$, and $c$ are as defined in Theorem 4.

The proof is deferred to the technical appendix.

## VI. NUMERICAL EXPERIMENTS

a) **Setup:** For Algorithm 1 and Algorithm 3, we conduct experiments on a dataset $S = \{1, \dots, n\}$ with $n = 500$, distributed across nodes of a communication graph. We evaluate Algorithm 1 using the normalized absolute error between estimated and true ranks; that is, for node $k$ at iteration $t$, the error is defined as $\ell_k(t) = |R_k(t) - r_k|/n$. Figure (a) compares the performance of synchronous (see [15]) and asynchronous GoRank on a Watts-Strogatz graph ($c = 3.11 \times 10^{-4}$).

Algorithm 2 is evaluated on the estimation of the Wilcoxon statistic. For this, we consider a dataset $S_1$ of $n_1 = 250$ samples from a Cauchy distribution with location 0.8 and scale 1.0, and a second dataset $S_2$ of $n_2 = 250$ samples from a Cauchy distribution with location 0.0 and scale 1.0. We compute the average relative error defined by $\ell(t) = \frac{1}{n} \sum_k \frac{|Z_k(t) - r_k|}{r_k}$. Figure (c) compares the convergence of Algorithm 3 on three graph topologies: the complete graph ($c = 4.01 \times 10^{-3}$), in which every node is directly connected to all others, yielding
<figure><img src="image_3.png" /><figcaption>Fig. 2: Figure (a) shows that Asynchronous GO{RANK converges slightly faster than its synchronous version. Figure (b) shows fast convergence for the Wilcoxon estimation even on sparse graphs, with convergence speed matching the theoretical bound. Figure (c) shows that adaptive GOTrim slightly outperforms its original version (both improving over the naive mean).</figcaption></figure>

maximal connectivity; a random connected geometric graph ($c = 3.57 \times 10^{-5}$) with radius $\rho = 0.1$; and the Watts-Strogatz network ($c = 3.11 \times 10^{-4}$), a randomized graph with average degree $k = 4$ and rewiring probability $p = 0.2$, offering intermediate connectivity between the complete and geometric graphs.

Algorithm 3 is evaluated on a corrupted dataset. Here, the dataset $S$ is contaminated by replacing a fraction $|\epsilon n|$ with $\epsilon = 0.3$ of the values via scaling: a value $x$ is changed to $sx$ with $s = 10$. While this is a relatively simple form of corruption, it is sufficient to break down the classical mean. We measure performance using the absolute error between the estimated and true trimmed mean. For node $k$ at iteration $t$, the error is given by $\ell(t) = \frac{1}{n} \sum_k |Z_k(t) - \bar{x}_k|$, where $\bar{x}_k$ represents the true trimmed mean with $\alpha = 0.4$. Figure (b) compares the performance of GoTrim with and without the bias correction.

All algorithms are run for $5 \times 10^4$ iterations, averaged over 100 trials. For each trial, the data is randomly distributed across the graph. The plots display the mean error and standard deviation over the iterations. The code for our experiments will be publicly available.

b) Results: Figure (a) shows that the asynchronous variant actually converges faster than synchronous GoRank. While this is not captured in our convergence bounds from Theorem 1, these bounds still guarantee that both synchronous and asynchronous versions share the same order of convergence rates, which is consistent with our empirical observations. Figure (b) demonstrates that our algorithm can efficiently estimate the Wilcoxon statistic even in sparsely connected graphs. Furthermore, the asymptotic behavior aligns with the convergence bounds in Theorem 2: the complete graph achieves the fastest convergence, while the geometric graph is the slowest. Figure (c) shows that GoTrim with bias correction slightly outperforms the vanilla GoTrim, as expected. Both variants quickly improve over the naive (corrupted) mean, but the bias-corrected version yields better overall accuracy.

## VII. CONCLUSION

We presented new gossip algorithms for estimating rank-based statistics, including trimmed means and the Wilcoxon statistic, enabling robust decentralized estimation and hypothesis testing. Our methods operate in the asynchronous setting and are supported by experiments across diverse data distributions and network topologies. We established novel theoretical guarantees, with our asynchronous result for rank estimation being, to the best of our knowledge, the first of its kind. Note that our theoretical results extend to arbitrary edge sampling probabilities, provided that the graph remains connected. Future work will explore adaptive sampling strategies to further enhance convergence speed and robustness.

## VIII. TECHNICAL APPENDIX

In this section, we first present key properties of the transition matrices, essential for our theoretical results. We then provide the proofs of lemmas that were previously omitted.

### A. Preliminary Results

**Lemma 5.** Assume the graph $G = (V, E)$ is connected and non-bipartite. Let $t > 0$. If at iteration $t$, edge $e = (i, j)$ is selected with probability $p_e > 0$, then the transition matrix is given by $W_\alpha(t) = I_n - L_e/\alpha$ where the elementary Laplacian is defined as $L_e = (e_i - e_j)(e_i - e_j)^\top$ and where $\alpha = 1$ corresponds to the swapping matrix and $\alpha = 2$ to the averaging matrix. The following properties hold:

(a) The matrices are symmetric and doubly stochastic, meaning that $W_\alpha(t)1_n = 1_n$ and $1_n^\top W_\alpha(t) = 1_n^\top$. They satisfy: $W_2(t)^2 = W_2(t)$ and $W_1(t)^2 = I_n$.

(b) For $\alpha \in \{1, 2\}$, we have, since $\sum_{e \in E} p_e = 1$,

$$W_\alpha = \mathbb{E}[W_\alpha(t)] = I_n - \frac{1}{\alpha} \sum_{e \in E} p_e L_e. \quad (8)$$

The matrix $W_\alpha$ is also doubly stochastic and it follows that $1_n$ is an eigenvector with eigenvalue 1.
(c) The matrix $\tilde{\mathbf{W}}_{\alpha} \triangleq \mathbf{W}_{\alpha} - \mathbf{1}_n \mathbf{1}_n^{\top} / n$ satisfies, by construction, $\tilde{\mathbf{W}}_1 \mathbf{1}_n = 0$, and it can be shown that $\|\tilde{\mathbf{W}}_{\alpha}\|_{\text{op}} \le \lambda_2(\alpha)$, where $\lambda_2(\alpha)$ is the second largest eigenvalue of $\mathbf{W}_{\alpha}$ and $\| \cdot \|_{\text{op}}$ denotes the operator norm of a matrix. Moreover, the eigenvalue $\lambda_2(\alpha)$ satisfies $0 \le \lambda_2(\alpha) < 1$ and $\lambda_2(\alpha) = 1 - c/\alpha$ where c the spectral gap (or second smallest eigenvalue) of the Laplacian of the weighted graph defined as $\mathbf{L}(\mathbf{P}) = \sum_{e \in E} p_e \mathbf{L}_e$.

*Proof.* These results are analogous to those in [15], with the difference that the uniform edge sampling $p_e = 1/|E|$ is replaced by an arbitrary distribution. The proofs remain valid under the assumption that $p_e > 0$. For more details, we refer the reader to [2, 3]. □

## B. Proof of Lemma 1

*Proof.* Applying Cauchy-Schwarz inequality, we obtain $\mathbb{E}[|\tilde{S}_k(t)|] \le \sqrt{\mathbb{E}[\tilde{S}_k(t)^2]}$. Define the centered vector $\tilde{\mathbf{h}}_k := \mathbf{h}_k - \bar{\mathbf{h}}_k \mathbf{1}_n$. Using the fact that $\tilde{\mathbf{W}}_1(s-1:\mathbf{1}_n = 0$,

$$ \tilde{S}_k(t) = \sum_{s=1}^{t} \delta_k(s) \tilde{\mathbf{h}}_k^{\top} \tilde{\mathbf{W}}_1(s-1:\mathbf{1}_k). $$

The corresponding squared term can then be written as:

$$ \tilde{S}_k(t)^2 = \sum_{s=1}^{t} \delta_k(s) \tilde{\mathbf{h}}_k^{\top} \tilde{\mathbf{W}}_1(s-1:\mathbf{1}_k) \mathbf{e}_k \mathbf{e}_k^{\top} \tilde{\mathbf{W}}_1(s-1:\mathbf{1}_k) + 2 \sum_{s<u} \delta_k(s) \delta_k(u) \tilde{\mathbf{h}}_k^{\top} \tilde{\mathbf{W}}_1(s-1:\mathbf{1}_k) \mathbf{e}_k \mathbf{e}_k^{\top} \tilde{\mathbf{W}}_1(u-1:\mathbf{1}_k) \tilde{\mathbf{h}}_k. $$

We define $v(s) := \delta_k(s) \tilde{\mathbf{h}}_k^{\top} \tilde{\mathbf{W}}_1(s-1:\mathbf{1}_k) \mathbf{e}_k$ and consider the term $\sum_{s=1}^{t} v(s)^2$. Let $\mathbf{J} = (1/n) \mathbf{1}_n \mathbf{1}_n^{\top}$. Since we have $\tilde{\mathbf{h}}_k^{\top} \mathbf{J} = 0$, $\|\mathbf{e}_k \mathbf{e}_k^{\top}\|_{\text{op}} \le 1$, and the permutation matrix is its own inverse, we can bound $v(s)^2$ as follows:

$$ \delta_k(s) \tilde{\mathbf{h}}_k^{\top} \mathbf{W}_1(s-1:\mathbf{1}_k) \mathbf{e}_k \mathbf{e}_k^{\top} \mathbf{W}_1(s-1:\mathbf{1}_k) \tilde{\mathbf{h}}_k \le \delta_k(s) \tilde{\mathbf{h}}_k^{\top} \tilde{\mathbf{h}}_k. $$

Taking expectation and using that $\delta_k(s)$ is a Bernoulli variable with mean $p_k$, we obtain

$$ \mathbb{E} \left[ \sum_{s=1}^{t} v(s)^2 \right] \le p_k t \|\tilde{\mathbf{h}}_k\|^2. $$

Next, we consider the second term: $\sum_{s<u} v(s)v(u)$. Observe that, for $s < u$, the product $v(s)v(u)$ can be expressed as

$$ \delta_k(s) \delta_k(u) \tilde{\mathbf{h}}_k^{\top} \mathbf{W}_1(s-1:\mathbf{1}_k) \mathbf{e}_k \mathbf{e}_k^{\top} \mathbf{W}_1(u-1:s) \mathbf{W}_1(s-1:\mathbf{1}_k) \tilde{\mathbf{h}}_k. $$

Define the vector $\mathbf{y}(s) := \mathbf{W}_1(s-1:\mathbf{1}_k)$. Then, the conditional expectation of the cross term given $\mathbf{W}_1(s-1:\mathbf{1}_k)$ is

$$ p_k \mathbf{y}(s-1)^{\top} \mathbf{e}_k \mathbf{e}_k^{\top} \mathbb{E}[\delta_k(s) \mathbf{W}_1(u-1:s)] \mathbf{y}(s-1). $$

It remains to bound the expectation

$$ \mathbb{E} \left[ \delta_k(s) \tilde{\mathbf{W}}_1(u-1:s) \right] = \tilde{\mathbf{W}}_1^{u-s-1} \mathbb{E} \left[ \delta_k(s) \tilde{\mathbf{W}}_1(s) \right]. $$

Let $L_{ij} = (\mathbf{e}_i - \mathbf{e}_j)(\mathbf{e}_i - \mathbf{e}_j)^{\top}$ denote the elementary Laplacian matrix. Observe that, the term $\mathbb{E}[\delta_k(s)\mathbf{W}_1(s)]$ becomes

$$ \sum_{(i,j) \in E} p_{ij} \mathbb{I}_{\{k \in \{i,j\}\}} (\mathbf{I}_n - \mathbf{L}_{ij}) = p_k \left( \mathbf{I}_n - \frac{1}{p_k} \mathbf{L}_k \right), $$

where $\mathbf{L}_k$ is the Laplacian of the weighted star graph formed by node k and its neighbors j with weight $p_{kj}$. Note that this graph is bipartite. Define $\mathbf{P}_k = \mathbf{I}_n - (1/p_k) \mathbf{L}_k$. Since the matrix $\mathbf{P}_k$ is also doubly stochastic, defining the projection $\tilde{\mathbf{P}}_k = \mathbf{P}_k - (1/n) \mathbf{1}_n \mathbf{1}_n^{\top}$, we have $\|\tilde{\mathbf{P}}_k\|_{\text{op}} \le 1$. We can now bound the conditional expectation of the cross term:

$$ \mathbb{E}[v(s)v(u) | \mathbf{W}_1(s-1:\mathbf{1}_n)] \le p_k^2 \lambda_2(1)^{u-s-1} \mathbf{y}(s-1)^{\top} \mathbf{y}(s-1), $$

where we used the assumptions $\|\tilde{\mathbf{W}}_1\|_{\text{op}} \le \lambda_2(1)$. Similar to the previous bound, we use the properties of the permutation matrices to obtain the following bound:

$$ \mathbb{E}[v(s)v(u)] \le p_k^2 \lambda_2(1)^{u-s-1} \|\tilde{\mathbf{h}}_k\|^2. $$

To bound the sum over all such cross terms, observe that

$$ \sum_{s<u} \lambda_2(1)^{u-s-1} \le \sum_{u=1}^{t} \sum_{d=0}^{u-2} \lambda_2(1)^d \le \frac{t}{1 - \lambda_2(1)}. $$

Setting $c = 1 - \lambda_2(1)$ and combining both terms, we have:

$$ \mathbb{E}[\tilde{S}_k(t)^2] \le \left( p_k t + \frac{2 p_k^2 t}{c} \right) \|\tilde{\mathbf{h}}_k\|^2. $$

Using $c/p_k \le n$, we obtain

$$ \frac{1}{(p_k t)^2} \mathbb{E}[\tilde{S}_k(t)^2] \le \frac{2n}{ct} \cdot \|\tilde{\mathbf{h}}_k\|^2. $$

Taking the square root finishes the proof. □

## C. Proof of Lemma 2

*Proof.* By the Cauchy-Schwarz inequality, we have

$$ \mathbb{E}[|(C_k(t) - p_k t) \tilde{S}_k(t)|] \le \sqrt{\mathbb{E}[(C_k(t) - p_k t)^2]} \cdot \sqrt{\mathbb{E}[\tilde{S}_k(t)^2]}. $$

The first term corresponds to the variance of the binomial random variable $C_k(t) \sim \mathcal{B}(t, p_k)$, which satisfies

$$ \mu_2 = \mathbb{E}[(C_k(t) - p_k t)^2] = tp_k(1 - p_k) \le tp_k. $$

The second term was previously bounded in the proof of Lemma 1:

$$ \frac{1}{(p_k t)^2} \mathbb{E}[\tilde{S}_k(t)^2] \le \frac{2n}{ct} \cdot \|\tilde{\mathbf{h}}_k\|^2. $$

Denoting $m = |E|$ and using that $1/p_k \le n$, we obtain $\sqrt{\mu_2/(p_k t)^2} \le \sqrt{n/ct}$. Combining both bounds finishes the proof. □

## D. Proof of Lemma 3

*Proof.* By the Cauchy-Schwarz inequality and the fact that $1/C_k(t)^2 \le 1$, we obtain

$$ \mathbb{E} \left[ \frac{(C_k(t) - a)^2}{C_k(t)} |\tilde{S}_k(t)| \right] \le \sqrt{\mathbb{E}[(C_k(t) - a)^4]} \cdot \sqrt{\mathbb{E}[\tilde{S}_k(t)^2]}. $$

where we denote $a := p_k t$ for convenience. The first factor corresponds to the fourth central moment $\mu_4$ of the binomial distribution $\mathcal{B}(t, p_k)$, which satisfies

$$ \mu_4 = tp_k(1 - p_k) [1 - 6p_k(1 - p_k) + 3tp_k(1 - p_k)]. $$
Using the bound $\mu_4 \le tp_k + 3t^2p_k^2$, we deduce (in analogy with Lemma 2) that

$$ \frac{1}{(p_k t)^2} \mathbb{E} \left[ (C_k(t) - p_k t)^4 \right] \le 3 + \frac{1}{tp_k} \le 3 + \frac{n}{t}. $$

Combining this with the bound from Lemma 1 on $\mathbb{E}[\tilde{S}_k(t)^2]$, we obtain

$$ \frac{1}{(p_k t)^4} \mathbb{E} \left[ (C_k(t) - p_k t)^4 \right] \mathbb{E}[\tilde{S}_k(t)^2] \le \left(3 + \frac{n}{t}\right) \cdot \frac{2n}{ct} \cdot \|\tilde{\mathbf{h}}_k\|^2. $$

Finally, choosing $\kappa > 0$ such that $\sqrt{6n+2n^2/t} \le \kappa$ completes the proof. $\square$

### E. Proof of Theorem 2

*Proof.* The result follows by adapting the proof of Theorem 3 in [15]. Specifically, we replace $\mathbf{X}$ with $\mathbf{b} := (b_1, \dots, b_n)$, where $\mathbf{b}(t)$ denotes the vector weights for the Wilcoxon statistic, and instead of the convergence bound for the weights, we use the analogous bound for the rank estimates: $|\mathbb{E}[R_k(t)] - r_k| \le \mathcal{O}(1/ct)$. Indeed, denoting $\mathbf{Q}(t)$ the residuals, one has

$$ \|\mathbb{E}[\mathbf{Z}(t)] - t_n \mathbf{1}_n\| \le \left| \sum_{k=1}^{n} (\mathbb{E}[R_k(t)] - r_k) b_k \right| \cdot \|\mathbf{1}_n\| + \|\mathbf{Q}(t)\|. $$

The remainder of the argument proceeds identically to the proof of [15, Theorem 3]. $\square$

### F. Proof of Lemma 4

*Proof.* We note that the argument used in the proof of Lemma 1 in [15] can be directly applied to bound $\mathbb{E}|W_k(t) - w_{n,\alpha}(r_k)|$. Specifically, consider two cases: if $r_k \in I_{n,\alpha}$, the expression simplifies to $\mathbb{E}|\mathbb{I}_{\{R_k(t) \notin I_{n,\alpha}\}}| = \mathbb{P}(R_k(t) \notin I_{n,\alpha})$; if $r_k \notin I_{n,\alpha}$, the expression becomes $\mathbb{E}|\mathbb{I}_{\{R_k(t) \in I_{n,\alpha}\}}| = \mathbb{P}(R_k(t) \in I_{n,\alpha})$. This aligns exactly with the setup of Lemma 1 in [15]. Applying the same reasoning and steps from that proof yields the desired bound. $\square$

### G. Proof of Theorem 3

*Proof.* Let $\mathbf{J} = (1/n)\mathbf{1}_n\mathbf{1}_n^\top$. Define $\bar{x}_\alpha(t) = (1/n) \cdot (\mathbf{W}(t) \odot \mathbf{X})^\top \mathbf{1}_n$. Note that $\sum_{s=1}^t \mathbf{J}(\Delta\mathbf{W}(s) \odot \mathbf{X}) = \bar{x}_\alpha(t)\mathbf{1}_n$. Hence, denoting $\mathbf{S}(s) = \Delta\mathbf{W}(s) \odot \mathbf{X}$, we can write

$$ \mathbb{E} \| \mathbf{N}(t) - \bar{x}_{\alpha} \mathbf{1}_n \|_2 \le \mathbb{E} \| \sum_{s=1}^{t} \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s) \|_2 \\ + \mathbb{E} \| (\bar{x}_{\alpha}(t) - \bar{x}_{\alpha}) \mathbf{1}_n \|_2, $$

where $\tilde{\mathbf{W}}_2(t:s) = \mathbf{W}_2(t:s) - \mathbf{J}$. Denote $v(s) = \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s)$. Analyzing the first term amounts to analyzing $\mathbb{E}[\|v(s)\|_2^2]$, as

$$ \mathbb{E} \left\| \sum_{s=1}^{t} \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s) \right\|_2 \le \sum_{s=1}^{t} \mathbb{E} \left\| \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s) \right\|_2 \\ \le \sum_{s=1}^{t} \sqrt{\mathbb{E} \left\| \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s) \right\|_2^2}. $$

We now analyze $\mathbb{E}[\|v(s)\|_2^2] = \mathbb{E}[v(s)^\top v(s)]$. Taking expectation conditional on $\mathcal{F}_{t-1}$ (natural filtration), for $s < t$,

$$ \mathbb{E}[v(s)^\top v(s) | \mathcal{F}_{t-1}] = v(s-1)^\top \mathbb{E}[\tilde{\mathbf{W}}_2(t)^\top \tilde{\mathbf{W}}_2(t)] v(s-1) \\ \le \lambda_2(2) v(s-1)^\top v(s-1), $$

and by repeatedly conditioning, we have

$$ \mathbb{E}[v(s)^\top v(s)] \le \lambda_2(2)^{t-s} \mathbb{E}[\|\mathbf{S}(s)\|_2^2]. $$

Since $\mathbb{E}[\|\mathbf{S}(s)\|_2^2] = \mathbb{E}[\sum_{k=1}^n [W_k(s) - W_k(s-1)]^2 X_k^2]$, we only need to bound $\mathbb{E}[|W_k(s) - W_k(s-1)|^2]$. Recall that $W_k(s) = \mathbb{I}_{\{R_k(s) \in I_{n,\alpha}\}}/c_{n,\alpha}$, so

$$ \mathbb{E}[|W_k(s) - W_k(s-1)|^2] = \mathbb{E}[|W_k(s) - W_k(s-1)|]/c_{n,\alpha}, $$

where we used the fact that indicator functions take values in $\{0, 1\}$. Using the result from the previous lemma, we obtain

$$ \mathbb{E}[|W_k(s) - W_k(s-1)|] \le \frac{2C_k}{cs}, $$

where $C_k = \frac{3\sigma_n^2(r_k)}{\gamma_k^2(1-2\alpha)}$. Denoting $\tilde{C}_k = \frac{\sqrt{6\sigma_n(r_k)}}{\sqrt{c\gamma_k(1-2\alpha)}}$, we obtain,

$$ \mathbb{E}[\|\mathbf{S}(s)\|^2] \le \frac{1}{cs} \sum_{k=1}^{n} \frac{2C_k}{c_{n,\alpha}} X_k^2 = \frac{1}{s} \cdot \|\tilde{\mathbf{C}} \odot \mathbf{X}\|^2. $$

Denoting $\tilde{c} = 1 - \tilde{\lambda}$ with $\tilde{\lambda} = \sqrt{\lambda_2(2)}$, we obtain

$$ \sum_{s=1}^{t} \sqrt{\mathbb{E} \| \tilde{\mathbf{W}}_2(t:s) \mathbf{S}(s) \|_2^2} \le \sum_{s=1}^{t} \frac{\sqrt{\lambda_2(2)^{t-s}}}{\sqrt{s}} \cdot \| \tilde{\mathbf{C}} \odot \mathbf{X} \| \\ \le \| \tilde{\mathbf{C}} \odot \mathbf{X} \| \cdot \sum_{s=1}^{t} \frac{e^{-\tilde{c}(t-s)}}{\sqrt{s}}. $$

To bound the sum, similarly to the proof of Theorem 3 in [15], we decompose the sum using an intermediate time step $T = t - \log(\sqrt{t})/\tilde{c}$. Define $T^* = \min\{t > 1 | \tilde{c}t > \log(t)/2\}$. Then, for all $t > T^*$, we have

$$ \sum_{s=1}^{t} \frac{e^{-\tilde{c}(t-s)}}{\sqrt{s}} \le e^{-\tilde{c}(t-T)} \sum_{s=1}^{T} e^{-\tilde{c}(T-s)} + \sum_{s=T+1}^{t} \frac{e^{-\tilde{c}(t-s)}}{\sqrt{T}} \\ \le \frac{1}{\sqrt{\tilde{c}}} \left( \frac{1}{\sqrt{\tilde{c}t}} + \frac{1}{\sqrt{\tilde{c}t - \log(t)/2}} \right). $$

All in all, using the expression of $\mathbf{K}$ concludes the proof. $\square$

### H. Proof of Theorem 4

*Proof.* First, we use the relationship between the $\ell_1$ and $\ell_2$ norms: $\| \cdot \|_2 \le \| \cdot \|_1$. Then, we bound as follows:

$$ \| \mathbf{Z}(t) - \bar{x}_{\alpha} \mathbf{1}_n \|_1 = \sum_{k=1}^{n} \left| \frac{N_k(t)}{D_k(t)} - \bar{x}_{\alpha} \right| \\ = \sum_{k=1}^{n} \left| \frac{N_k(t) - \bar{x}_{\alpha}}{\max(1, M_k(t))} + \frac{(1 - M_k(t)) \mathbb{I}_{\{M_k(t) \ge 1\}} \bar{x}_{\alpha}}{\max(1, M_k(t))} \right| \\ \le \| \mathbf{N}(t) - \bar{x}_{\alpha} \mathbf{1}_n \|_1 + |\bar{x}_{\alpha}| \cdot \| \mathbf{M}(t) - \mathbf{1}_n \|_1. $$

The convergence of $\mathbf{M}(t)$ follows from similar arguments to the convergence of $\mathbf{N}(t)$, see proof of Theorem 3. Using that $\| \cdot \|_1 \le \sqrt{n} \cdot \| \cdot \|_2$, we obtain the desired bound. $\square$
REFERENCES

[1] M Alanyali, S Venkatesh, O Savas, and S Aeron. Distributed bayesian hypothesis testing in sensor networks. In *ACC. IEEE*, 2004.

[2] S Boyd, A Ghosh, B Prabhakar, and D Shah. Randomized gossip algorithms. *IEEE Trans. Inf. Theory*, 2006.

[3] I Colin, A Bellet, J Salmon, and S Clémençon. Extending gossip algorithms to distributed estimation of u-statistics. *NeurIPS*, 2015.

[4] I Colin, A Bellet, J Salmon, and S Clémençon. Gossip dual averaging for decentralized optimization of pairwise functions. In *ICML*, 2016.

[5] R Diestel. *Graph Theory*. Springer, 2025.

[6] J C Duchi, A Agarwal, and M J Wainwright. Dual averaging for distributed optimization: Convergence analysis and network scaling. *IEEE Transactions on Automatic control*, 2011.

[7] Peter J Huber. Robust estimation of a location parameter. In *Breakthroughs in statistics: Methodology and distribution*, pages 492–518. Springer, 1992.

[8] Jaroslav Hájek and Zbyněk Šidák. *Theory of Rank Tests*. Probability and Mathematical Statistics. Academic Press, San Diego, second edition edition, 1999.

[9] Márk Jelasity, Alberto Montresor, and Ozalp Babaoglu. Gossip-based aggregation in large dynamic networks. *ACM Transactions on Computer Systems (TOCS)*, 23(3):219–252, 2005.

[10] Maurice G Kendall. The treatment of ties in ranking problems. *Biometrika*, 33(3):239–251, 1945.

[11] Reza Olfati-Saber, Elisa Franco, Emilio Frazzoli, and Je S Shamma. Belief consensus and distributed hypothesis testing in sensor networks. In *Networked Embedded Sensing and Control: Workshop NESC’05: University of Notre Dame, USA October 2005 Proceedings*, pages 169–182. Springer, 2006.

[12] Devavrat Shah et al. Gossip algorithms. *Foundations and Trends® in Networking*, 3(1):1–125, 2009.

[13] Erfan Soltanmohammadi, Mahdi Orooji, and Mort Naraghi-Pour. Decentralized hypothesis testing in wireless sensor networks in the presence of misbehaving nodes. *IEEE Transactions on Information Forensics and Security*, 8(1):205–215, 2012.

[14] Aad W. Van der Vaart. *Asymptotic statistics*, volume 3. Cambridge university press, 2000.

[15] A Van Elst, I Colin, and S Clémençon. Robust distributed estimation: Extending gossip algorithms to ranking and trimmed means. *arXiv preprint arXiv:2505.17836*, 2025.