1. Introduction
Comparing the distributions of two samples is a fundamental problem in statistics. This problem is known as two-sample hypothesis test. Under the null hypothesis, the distributions are equal, while under the alternative hypothesis, the distributions are different. In practice, the two-sample hypothesis test has various applications. In the medical field, the two-sample test is widely used in clinic trial experiments [
1]. In the biology field, researchers apply two-sample tests to distinguish the expression of genes [
2]. In manufacturing companies, a two-sample test is carried out to choose more efficient producing processes and examine product quality [
3]. In the social science field, the two-sample test is intended for making comparisons of people with different races, genders, ethnicities, etc. [
4]. The two-sample test problem has been studied extensively in the literature. The classical two-sample hypothesis tests include the two-sample
t test, Hotelling’s T-squared test, the Wilcoxon test, and the Kolmogorov–Smirnov test.
A network is a structure that represents a group of objects and relationships between them. In mathematics, it is known as a graph. A network structure consists of nodes and edges, with nodes representing objects and edges representing the relationships between those objects. In the past decades, network data analysis has received intense attentions.
In many applications, a number of graphs from several populations are available. A natural question is whether the graph samples are from the same distribution. This problem can be formulated as a graph-based two-sample test. Under the null hypothesis, the distributions are the same. Under the alternative hypothesis, the distributions are different. The graph-based two-sample test has wide applications. Ref. [
5] used a graph-based two-sample test to study how different screening rules may influence the diversification benefits of portfolios in asset management and wealth management. In brain network data analysis, a graph-based two-sample test can be employed to distinguish between various brain disorders [
6,
7].
Graph-based two-sample testing has been widely studied. Ref. [
8] considered testing whether two networks have the same distribution and proposed a consistent and minmax optimal two-sample test. Ref. [
9] propose two new tests for a small two-sample setting. Ref. [
10] provide sufficient conditions under which it is possible to test the difference between two populations of inhomogeneous random graphs. Refs. [
11,
12] study the two-sample problem on a regime of random dot product graphs, and their test statistics are based on the kernel function of the spectral decomposition of the adjacency matrix. Refs. [
13,
14] propose a test based on subgraph counts. Ref. [
15] propose a powerful test for a weighted graph-based two-sample test. However, the aforementioned graph-based two-sample tests present drawbacks in the following aspects: (1) Most of the tests are developed for binary (or unweighted) graphs. (2) The independence assumption of edges poses a strong condition which makes the tests conservative in some sense.
In practice, many real-world networks are weighted and the edges are correlated. For example, in brain networks, the edges are constructed based on correlations or other association measures between two brain regions. The association measures are weights of the edges, and they may be correlated [
16]. In this paper, we study a weighted graph-based two-sample test. We propose a novel graph-based two-sample test based on empirical likelihood [
17]. Empirical likelihood is a nonparametric method that does not require the form of the underlying distribution of data, and it retains some of the advantages of likelihood-based inference. We derive the asymptotic distribution of the test statistic under the null hypothesis. We use a simulation to study the power of the proposed test. We apply the proposed method to real-world weighted networks.
The rest of the paper is organized as follows:
Section 2 describes the model and the proposed new graph-based two-sample test.
Section 3 evaluates the performance of the new test using simulations and its application to real data. The proofs are deferred to
Appendix A.
Notations: Let be two positive constants. For two positive sequences , , denote if ; if ; and if . For a sequence of random variables , means is bounded in probability, and means converges to zero in probability.
2. Weighted Graph-Based Two-Sample Empirical Likelihood Test
A graph is defined as = (V, , where V is the set of all vertices (nodes) and E is the set of all edges in the graph. The adjacency matrix A of is defined as follows: if there is an edge between vertices i and j, and otherwise. We assume the graph is undirected and does not have self-loops, that is, and . Then, the adjacency matrix A is symmetric and its diagonal elements are zeroes. If , , we refer to it as an inhomogeneous random graph. Since , the random graph A is said to be binary or unweighted.
To incorporate weights, we define the weighted random graph as follows.
Definition 1. Let be a probability distribution with the parameter θ, and be a symmetric function, that is, . Here, d is a positive integer. Let n be the number of nodes and be an independent sample from the uniform distribution . The random weighted graph is defined as follows. Given U, the edges () are conditionally independent and follow the distribution , that is,Denote . When
is the Bernoulli distribution,
is the well-known random graphon model for unweighted graphs. Further, if
h is a constant between one and zero, it is the Erdős-Rényi random graph. If
is not the Bernoulli distribution, the graph
A is weighted. Since the distributions of
depend on
U, the edges
(
) are not independent. Hence, the random graph
can model weights and correlations in weighted networks.
Figure 1 provides visualizations of two weighted graphs. In
Figure 1,
, where
is the Dirac measure centered on 0, and
is the exponential distribution
. The left weighted graph is constructed based on
with
, and the right weighted graph is constructed based on
with
. The number on an edge represents the weight of the edge. On average, the left graph has larger weights than the right graph.
Let
be two positive integers,
and
be two sequences of positive integers. Given independent networks
with
(
) and independent networks
,…,
with
(
), we are interested in testing whether the two samples have the same distribution, that is, we test the following hypotheses
Under the null hypothesis,
. The two graph samples are drawn from the same distribution. Under the alternative hypothesis,
. The distributions of the two samples are different.
A similar hypothesis test problem to that in (
1) has been studied in several papers. In [
11,
13,
14], the distribution
F is assumed to be the Bernoulli distribution. Ref. [
15] consider (
1) under the assumption that the edges are independent and
. In this work, we investigate (
1) in a more general setting, and we propose a new test based on empirical likelihood.
Empirical likelihood (EL) was introduced by Owen [
17,
18] to construct a confidence region for the mean. It is a nonparametric method that does not require a prespecified distribution for the data. As a counterpart of the parametric likelihood method, it inherits the advantageous properties of the likelihood-based method. The empirical likelihood confidence region respects the shape of the data and usually outperforms the method based on asymptotic normality. Empirical likelihood has also been widely used in hypothesis testing.
Now, we present the empirical likelihood test for (
1). For positive integers
,
,
, define the cycles
In the binary graph case,
represents the density of
k-cycles in graph
, and
for all
. For weighted graphs,
if
. Let
That is,
and
are
d-dimensional vectors with the components
and
, respectively. Let
and
be probability vectors, that is,
Define the empirical likelihood test statistic as
According to the Lagrange multiplier method, the maximizer is given by
where
,
, and
are the solutions to the following nonlinear equations:
The test statistic
is a generalization of the classical two-sample empirical likelihood in [
19,
20]. The difference is that
,
, …,
are not identically distributed and
,
, …,
are not identically distributed as in [
19,
20]. The limiting distribution of
under the null hypothesis is given by the following theorem.
Theorem 1. Suppose are fixed and the -th moment of the distribution F is finite. Assume that , as . Under the null hypothesis, , converges in distribution to as . Here is the chi-square distribution with the degree of freedom d.
According to Theorem 1, we define the empirical likelihood test for (
1) as follows.
where
is the
quantile of the chi-square distribution with the degree of freedom
d. The
p-value of the empirical likelihood test is defined as follows:
The assumption on the finiteness of 4d-th moment of the distribution F is not very restrictive. For unweighted networks, F is the Bernoulli distribution, and all the moments F exist. In modeling weighted networks, the weights are usually assumed to follow a distribution in the exponential family. Many distributions in the exponential family satisfy this assumption, for instance, the normal distribution, the exponential distribution, and the Poisson distribution. In many applications, the weights are usually correlations, which are between −1 and 1. It is reasonable to assume its higher moments exist.
3. Simulations
In this section, we run simulations to evaluate our proposed empirical likelihood test. For binary (or unweighted) graphs, refs. [
13,
14] proposed a two-sample
t test based on
and
. We compare our empirical likelihood test with the
t-test in an unweighted network case. For weighted networks, it is not clear whether the
t-test still works or not. However, as a comparison, we still run a simulation to evaluate its performance. Note that the
t-test statistic is a function of
and
. For weighted networks,
and
. We still plug them into the
t-test statistic and adopt the same rejection rule as in the unweighted network case. Then, we evaluate its performance and compare our empirical likelihood test with it.
In the simulations, we set the Type I error to 0.05 and report the empirical size and power by 2000 trials. The empirical size is calculated as follows. Generate an independent sample , perform the empirical likelihood test, and record whether is rejected or not. Then, repeat the experiment 2000 times, and the rejection rate is the empirical size. The empirical power is calculated as follows. Generate the independent sample and independent sample , perform the empirical likelihood test, and record whether is rejected or not. Then, repeat the experiment 2000 times, and the rejection rate is the empirical power. The empirical size and power of the t-test are similarly calculated.
We take , , and . We consider the following five situations.
In the first simulation,
,
, and
with
.
is the Bernoulli distribution. The result is shown in
Table 1.
In the second simulation,
,
, and
with
.
is the Poisson distribution. The result is shown in
Table 2.
In the third simulation, we consider
,
,
,
, etc.
is the exponential distribution. The result is shown in
Table 3.
In the forth simulation, we study
,
, and
. Here,
is given below
and
are the two-dimensional normal distributions with mean and variance equal to
and
, respectively. The result is given in
Table 4.
In the last simulation, we consider
and the Gamma distribution with the parameter
. Let
and
. Here,
is the same as in the normal distribution case.
is the Gamma distribution with the parameter
, which depend on
as follows:
The result is given in
Table 5.
All the Type I errors (the third columns) are close to 0.05. As m increases, the power of the tests approaches 1, indicating that our empirical results are consistent with Theorem 1. Moreover, our method has higher power and converges to 1 faster than the two-sample t-test.