qrmtools (version 0.0-12)

tests: 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()).

Examples

Run this code
# NOT RUN {
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%
# }

Run the code above in your browser using DataLab