pingouin.multivariate_normality

pingouin.multivariate_normality(X, alpha=0.05)[source]

Henze-Zirkler multivariate normality test.

Parameters
Xnp.array

Data matrix of shape (n_samples, n_features).

alphafloat

Significance level.

Returns
normalboolean

True if X comes from a multivariate normal distribution.

pfloat

P-value.

See also

normality

Test the univariate normality of one or more variables.

homoscedasticity

Test equality of variance.

sphericity

Mauchly’s test for sphericity.

Notes

The Henze-Zirkler test has a good overall power against alternatives to normality and is feasable for any dimension and any sample size.

Adapted to Python from a Matlab code by Antonio Trujillo-Ortiz and tested against the R package MVN.

Rows with missing values are automatically removed using the remove_na() function.

References

1

Henze, N., & Zirkler, B. (1990). A class of invariant consistent tests for multivariate normality. Communications in Statistics-Theory and Methods, 19(10), 3595-3617.

2

Trujillo-Ortiz, A., R. Hernandez-Walls, K. Barba-Rojo and L. Cupul-Magana. (2007). HZmvntest: Henze-Zirkler’s Multivariate Normality Test. A MATLAB file.

Examples

>>> import pingouin as pg
>>> data = pg.read_dataset('multivariate')
>>> X = data[['Fever', 'Pressure', 'Aches']]
>>> normal, p = pg.multivariate_normality(X, alpha=.05)
>>> print(normal, round(p, 3))
True 0.717