tests: Formal Tests of Multivariate Normality

testsR Documentation

Formal Tests of Multivariate Normality

Description

Compute formal tests based on the Mahalanobis distances and Mahalanobis angles of multivariate normality (including Mardia's kurtosis test and Mardia's skewness test).

Usage

maha2_test(x, type = c("ad.test", "ks.test"), dist = c("chi2", "beta"), ...)
mardia_test(x, type = c("kurtosis", "skewness"), method = c("direct", "chol"))

Arguments

x

(n, d)-matrix of data.

type

character string indicating the type of test:

"ad.test":

Anderson-Darling test as computed by the underlying ad.test().

"ks.test":

Kolmogorov-Smirnov test as computed by the underlying ks.test().

"kurtosis":

Mardia's kurtosis test (based on Mahalanobis distances).

"skewness":

Mardia's skewness test (based on Mahalanobis angles).

dist

distribution to check against.

method

method for computing the Mahalanobis angles.

...

additional arguments passed to the underlying ad.test() or ks.test().

Value

An htest object (for maha2_test the one returned by the underlying ad.test() or ks.test()).

Author(s)

Marius Hofert

Examples

set.seed(271)
U <- matrix(runif(3 * 200), ncol = 3)
X <- cbind(qexp(U[,1]), qnorm(U[,2:3]))
maha2_test(X) # at the 'edge' of rejecting
maha2_test(X, type = "ks.test") # at the 'edge', too
mardia_test(X) # clearly rejects at 5%
mardia_test(X, type = "skewness") # clearly rejects at 5%

qrmtools documentation built on May 29, 2024, 9:35 a.m.