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, the univariate statistic normal.e(x)
is returned.
If the data contains missing values or the sample covariance matrix is
singular, NA is returned.
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.
If R=0
the summary for the test gives the test statistic only (no p-value).