A test for normality and independence based on characteristic function

In this article we prove a generalization of the Ejsmont characterization (Ejsmont in Stat Probab Lett 114:1–5, 2016) of the multivariate normal distribution. Based on it, we propose a new test for independence and normality. The test uses an integral of the squared modulus of the difference between the product of empirical characteristic functions and some constant. Special attention is given to the case of testing for univariate normality in which we derive the test statistic explicitly in terms of Bessel function and explore asymptotic properties. The simulation study also includes the cases of testing for bivariate and trivariate normality and independence, as well as multivariate normality. We show the quality performance of our test in comparison to some popular powerful competitors. The practical application of the proposed normality and independence test is discussed and illustrated using a real dataset.


Introduction
One of classical and important problems in statistics is testing independence between two of more components of a random vector.The traditional approach is based on Pearson's correlation coefficient, but its lack of robustness to outliers and departures from normality eventually led researchers to consider alternative nonparametric procedures.
To overcome this problem, some rank tests of independence are proposed, such as Savage, Spearman and van der Waerden, that in particular rely on linear rank statistics.The present paper uses another way to test the independence and normality that is based on a distance between the empirical function and a constant e − 1 2 .Many statistical studies deal with the relationship between two random vectors, say (X 1 , . . ., X m ) and (Y 1 , . . ., Y n ), and in particular, with the question whether random variables X i and Y j are independent and have the same normal distribution (see [13]).Assuming multivariate normality of (X 1 , . . ., X m , Y 1 , . . ., Y n ) the problem reduces to testing the null hypothesis that the correlation coefficients are equal to 0. Indeed, it is well known from the general theory of probability that if a random vector has a multivariate normal distribution (joint normality), then any two or more of its components that are uncorrelated, are independent.This implies that any two or more of its components that are pairwise independent, are independent.
A theoretical framework to study this aspect in a general sense was given by Ejsmont [8].Ejsmont proved that the characterizations of a normal law are given by a certain invariance of the noncentral chi-square distribution.Namely in [8] it has been shown that if the random vectors (X 1 , . . ., X m ) and (Y 1 , . . ., Y n ) are independent with all moments, and the distribution of m i=1 X i a i +A+ n j=1 Y j b j +B depends only on m i=1 a 2 i + n j=1 b 2 j , then X 1 , . . ., X m , Y 1 , . . ., Y n are independent and have the same normal distribution.In the above result we especially remove the requirement that corresponding random variables are independent and have the same distribution.
The paper is organized as follows.In Section 2 we state and prove the main results of [8] under the weakened assumption.Next, in Section 3 using this result we propose a new test for normality.Finally, in section 4 we obtain the explicit representation for two random vectors in the language of Bessel functions of the first kind, and in this case we simulate critical values.

The theoretical base for the construction of a test
Notation.The scalar product of vectors t, s ∈ R p is denoted by t, s and the Euclidean norm of t is t = t, t .Throughout this paper X := (X 1 , . . ., X m ) ∈ R m and Y := (Y 1 , . . ., Y n ) ∈ R n are random vectors, where m and n are positive integers.The characteristic functions of X and Y are denoted by ϕ X (•) = Ee i •,X and ϕ Y (•) = Ee i •,Y , respectively.For complex-valued functions f (•), the complex conjugate of f is denoted by f and |f | 2 = f f .In order to simplify notation, we will denote [n] = {1, . . ., n}.We denote (a, b) ∈ R m+n the concatenation of the vectors a ∈ R m and b ∈ R n .
Our construction of a new test of normality is based on the following result.This is a generalization of the main result of [8], under omitted moment assumptions (in [8] we assume that random variables have all moments; our proof is also different).
Theorem 2.1.Let (X 1 , . . ., X m , A) and (Y 1 , . . ., Y n , B) be independent random vectors, where X i and Y j are nondegenerate for i ∈ [m], j ∈ [n], and let statistic Proof.Our proof is based on the analysis of the characteristic function and so we denote by ϕ W (•) the characteristic function of W .We write (a, b) = r(ã, b) where (ã, b) belongs to the unit sphere of R n+m i.e., r = a 2 + b 2 .Thus for r > 0 and t ∈ R, we have By the hypothesis the left hand side of (1) does not depend on (ã, b) (= depend on r), and thus the limit on the right hand side then does not depend on (ã, b).In particular, we have that the distribution of a statistic Because of the independence of X and Y, we may write Evaluating (2) first when a = 0 ∈ R m and then when b = 0 ∈ R n , we get respectively.Substituting this into (2), we obtain Note that h(•) is continuous, hence by multiplicative Cauchy functional equation we get Substituting a = (a 1 , 0, 0, . . ., 0) and b = 0 in this equation, we see that it can be read as Ee iX 1 a 1 = e ca 2 1 , i.e.X 1 have a normal distribution, with zero mean.
Dragging this line of reasoning to other random variables, we see that X i and Y j have the same normal distribution, with zero mean.The independence of random variables X 1 , . . ., X m follows from the observation that, for all a = (a 1 , . . ., The construction of a new test is based directly on the Proposition below, that follows, in a sense, from Theorem 2.1, namely if A = B = 0, then Theorem 2.1 can be rewritten as follows.
Proposition 2.2.Let (X 1 , . . ., X m ) and (Y 1 , . . ., Y n ) be independent random vectors, where X i and Y j are nondegenerate, E( Then the following statements are equivalent: i) statistic a, X + b, Y has a distribution which does not depend on . ., Y n are independent and have the same normal distribution N(0, 1).
Proof.(i) ⇒ (ii).We see that the distribution of depends only on a 2 + b 2 , which by Theorem 2.1 implies that X i and Y j are independent and have the same normal distribution N(0, 1) (because we assume that E( from which we see that condition (i) is satisfied.

The test statistic
In this section we propose a new class of test statistics for testing the null hypothesis that the sample comes from a multivariate normal distribution with independent components.In the univarate case it reduces to the null normality hypothesis.
Our methodology applied in this construction is based on distances between empirical and theoretical quantities.There are many types of distances in theory of hypothesis testing that can be defined between statistical objects.One of the best known and mostly applied is the L 2 distance.If F is the cumulative distribution function (cdf) of a random variable and F n is the empirical function (edf), then their L 2 distance can be expressed as 2 dx, introduced by Cramér [6].Later modifications of this distance lead to Cramér-von Mises test and to Kolmogorov-Smirnov test [18].There is, however, another important distance, if the sample comes from a d-dimensional space, where d ≥ 1.If we want to test multivariate normality then we can use the distance between empirical and theoretical characteristic function; see [3,9].More recently, the characterization of a test for multivariate independence was given in [19,20].Suppose that X ∈ R m , Y ∈ R n are real-valued random vectors with characteristic functions ϕ X and ϕ Y , respectively.Then, for measuring independence, we can use the following distance s)dtds, where w(t, s) is an arbitrary positive weight function for which the integral above exists.We put forward a test that is also based on the distance between the characteristic function and some constant, and it was inspired by the articles [3,19,20,9].Our approach is based on the following reasoning.Condition (i) from Proposition 2.2 simply tells us that we get statement (ii) if the distribution of the statistic a, X + b, Y is constant on the (n + m)-sphere with radius 1.This requirement can be rewritten using the characteristic function, namely, we get statement (ii) if and only if the function is constant on the unit sphere a 2 + b 2 = 1, where a ∈ R m and b ∈ R n .From the proof of Proposition 2.2 we also know that this constant function must equal e − 1 2 , namely where S n+m •dS n+m is the surface integral over Let us assume that we have a simple random sample X = (X 1 , . . ., X N ) from a multivariate distribution with m components, i.e. the data have the following structure: We want to test the null hypothesis 1 : all columns of X are independent, vs. H (m) 0 is not true.and have a normal distribution Let X denote the matrix obtained from X by columnwise standardization.Let ϕ X (a) be the empirical characteristic functions of X defined by where X k is the kth row of the matricex X.Similarly, the empirical counterpart of characteristic function of random variable a, X + b, Y is where a = (a 1 , ..., a m ) T and b = (b 1 , ..., b m ) T .Assuming that X and Y are equally distributed as X 1 , the natural test statistics based on (3) is where a = (a 1 , ..., a m ) T and b = (b 1 , ..., b m ) T such that a, a + b, b = 1.
Clearly, we are interested in one-sided test, that is the right-tailed test, because we see from the above construction that we reject null hypothesis for large values of M m .It is clear that test statistic is location-scale invariant under the null hypothesis, hence we may derive critical values for testing using Monte Carlo approach.

Testing univariate normality
Consider now a univariate simple random sample X = (X 1 , . . ., X n ).In this case test statistic M 1 can be expressed in a simpler form.
where J is the Bessel function (of order zero) of the first kind, namely and d is the distance from origin to point (x, y) i.e., d(x, y) = x 2 + y 2 .
Proof.Let us calculate the integral in the right hand side of (4).
+ sin(a Xi + b Xj ) sin(a Xk + b Xl ) , switching to polar coordinates we obtain Since we need integration over S 2 , we have to focus on computing the following integral 2π 0 cos(x cos α + y sin α)dα, for x, y ∈ R.
By trigonometric identities the linear combination, or harmonic addition, of sine and cosine waves is equivalent to a single cosine wave with a phase shift and scaled amplitude, namely x cos α + y sin α = x 2 + y 2 cos(α − atan2(y, x)), where atan2(y, x) is the generalization of arctan(y/x) that covers the entire circular range (we don't need a formal definition of atan2).Thus for x, y ∈ R and xy = 0 we get If either x = 0 or y = 0, then the formula above is also true because we can use directly equation (6).
In Tables 1 and 2 we present power study results for sample sizes n = 20 and n = 50.The results are obtained using the Monte Carlo method with N = 5000 replicates.
Among the plethora of normality tests we selected to evaluate the performance of our test versus the most popular normality tests ( the Shapiro-Wilk test (SW), see [16], the Shapiro-Francia test (SF), see [17], and the Anderson-Darling test (AD), see [2]).Those tests are implemented in R package nortest by [15].Additionally, we consider recent powerful tests based on empirical characteristic function (BHEP), see [11], quantile correlation test based on the L2 Wasserstein distance, see [7], the moment generating function (HJG β ) proposed in [10] and test based on Stein fixed point characterization proposed in [4].
It can be seen form Tables 1 and 2 that the powers are reasonably high in comparison to other tests for all alternatives except for the uniform and normal mixtures.In the case of the Gumbel distribution our test outperforms the competitors, and for Gamma and Chi-squared it is one of the best.

Testing bivariate normality and independence
Consider now a bivariate simple random sample X = (X 1 , . . ., X N ), where X j = (X j1 , X j2 ), j = 1, . . ., N. Let X = ( X 1 , . . ., X N ) be its standardization.Here, the test statistic (4) becomes   In Table 3 we present powers of the new test and the test KS2, initially proposed in [14] with data driven parameter selection introduced in [13].We have chosen this competitor since it is the only one in the literature known so far, for testing bivariate normality and independence.In [13] it is shown that it outperforms Kolmogorov-Smirnov and Hoeffding test in most cases.The set of alternatives is taken from [13] for some choice of distribution parameters, and is given below.Unless stated otherwise, all distributions are defined for x i ∈ R, i = 1, 2. Distributions derived from the bivariate normal inherit its parameter space • a bivariate normal distribution BivNorm(µ 1 , µ 2 , σ 1 , σ 2 , ρ) with density • a mixture of bivariate normal distributions NMixA(ρ) with density • a mixture of bivariate normal distributions NMixB(ρ) with density • a bivariate lognormal distributions LogN(σ 1 , σ 2 , ρ) with density where • a generalized Burr-Pareto-Logistic distribution GBPL(α, β) with standard normal marginals, with density where Φ(x) and ϕ(x) are the standard normal distributions function and density; • a Morgenstern distribution Morg(α), , with standard normal marginals, with density • a Pearson type VII distribution PearVII(α) with density Methods of generating random variates from these distributions are available in [12] and [5].From Table 3 we can see that our new test is more powerful for the great majority of alternatives.In some cases, such as Normal Mixture B, and Normal Mixture A for negatively correlated components, the difference in powers is outstanding.On the other hand KS2 is consistently slightly better only for the Pearson VII alternative.Worth mentioning is that the powers of our new test are symmetric with respect to the sign of correlation parameter ρ, which doesn't hold in general for the KS2 test.
have a distribution which depends only on a 2 + b 2 , where a ∈ R m and b ∈ R n .Then random variables X 1 , . . ., X m , Y 1 , . . ., Y n are independent and have the same normal distribution with zero means.
) T and b = (b 1 , b 2 ) T such that a, a + b, b = 1.

Table 1 .
Power comparison for testing univariate normality -Part I

Table 2 .
Power comparison for testing univariate normality -Part II