mvnorm-test.Rd
Performs the E-statistic (energy) test of multivariate or univariate normality.
mvnorm.test(x, R)
mvnorm.etest(x, R)
mvnorm.e(x)
If x
is a matrix, each row is a multivariate observation. The
data will be standardized to zero mean and identity covariance matrix
using the sample mean vector and sample covariance matrix. If x
is a vector, mvnorm.e
returns the univariate statistic
normal.e(x)
.
If the data contains missing values or the sample covariance matrix is
singular, mvnorm.e
returns NA.
The \(\mathcal{E}\)-test of multivariate normality was proposed and implemented by Szekely and Rizzo (2005). The test statistic for d-variate normality is given by $$\mathcal{E} = n (\frac{2}{n} \sum_{i=1}^n E\|y_i-Z\| - E\|Z-Z'\| - \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n \|y_i-y_j\|), $$ where \(y_1,\ldots,y_n\) is the standardized sample, \(Z, Z'\) are iid standard d-variate normal, and \(\| \cdot \|\) denotes Euclidean norm.
The \(\mathcal{E}\)-test of multivariate (univariate) normality
is implemented by parametric bootstrap with R
replicates.
The value of the \(\mathcal{E}\)-statistic for multivariate
normality is returned by mvnorm.e
.
mvnorm.test
returns a list with class htest
containing
description of test
observed value of the test statistic
approximate p-value of the test
description of data
mvnorm.etest
is replaced by mvnorm.test
.
normal.test
for the energy test of univariate
normality and normal.e
for the statistic.
If the data is univariate, the test statistic is formally
the same as the multivariate case, but a more efficient computational
formula is applied in normal.e
.
normal.test
also provides an optional method for the
test based on the asymptotic sampling distribution of the test
statistic.
Szekely, G. J. and Rizzo, M. L. (2005) A New Test for Multivariate Normality, Journal of Multivariate Analysis, 93/1, 58-80, doi:10.1016/j.jmva.2003.12.002 .
Mori, T. F., Szekely, G. J. and Rizzo, M. L. "On energy tests of normality." Journal of Statistical Planning and Inference 213 (2021): 1-15.
Rizzo, M. L. (2002). A New Rotation Invariant Goodness-of-Fit Test, Ph.D. dissertation, Bowling Green State University.
Szekely, G. J. (1989) Potential and Kinetic Energy in Statistics, Lecture Notes, Budapest Institute of Technology (Technical University).
## compute normality test statistic for iris Setosa data
data(iris)
mvnorm.e(iris[1:50, 1:4])
#> [1] 1.203397
## test if the iris Setosa data has multivariate normal distribution
mvnorm.test(iris[1:50,1:4], R = 199)
#>
#> Energy test of multivariate normality: estimated parameters
#>
#> data: x, sample size 50, dimension 4, replicates 199
#> E-statistic = 1.2034, p-value = 0.01005
#>