BCompare groups · Guide test 164
Henze–Wagner test
Tests multivariate normality using a characteristic function based approach with affine invariance.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Multivariate normality tests — Do several variables jointly follow a multivariate normal distribution?
In Multivariate normality tests, choose Test = Henze–Wagner.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Henze–Wagner test
0 is symmetric.
Below 1: heavier tails than normal.
Your data
Simulated with a known ρIf H₀ were true
- The reference: how z varies across samples when H₀ is true (lognormal approximation).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = < .001).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- Mahalanobis cross-products of the centered rows
- smoothing parameter of the weight function
The verdict
HW = 1.20, z = 3.40, p < .001
p ≤ α = .050: reject H₀
The same BHEP statistic as Henze–Zirkler with a fixed β = 1: more weight on the center of the distribution than on the tails.
- Statistic
- 3.400
- p-value
- 0.0003
Henze–Wagner test on 40 (x, y) pairs: HW = 1.20, z = 3.40, p < .001. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: multivariate normality.
Assumptions
Independent identically distributed p-dimensional observations; positive definite covariance and sufficient n relative to p. The null is a multivariate normal distribution with unknown mean/covariance.
Formula
Parameters and notation
di²=(xi−x̄)ᵀSn⁻¹(xi−x̄); dij²=(xi−xj)ᵀSn⁻¹(xi−xj). The cited MVN Henze–Wagner implementation fixes b=1. This is a member of the same BHEP weighted characteristic-function family as HZ.
Structure of the method
This entry uses the stated BHEP-family characteristic-function discrepancy with the selected Henze–Wagner implementation's fixed smoothing convention. Whitening and pairwise exponential-distance sums create a scalar normality statistic. It is closely related to HZ, so the two p-values should not be presented as independent corroborating experiments.
Estimated and nuisance parameters
Estimated mean and covariance define standardized observations. The covariance rank and eigenvalues also affect numerical behavior. No neural weights are learned; the chosen smoothing convention and calibration specify the statistical procedure.
Settings and design choices
Record package version, population/sample covariance option, inversion tolerance, and whether a bootstrap is used. Some implementations allow a pseudoinverse for singular covariance; this numerical fallback is not evidence that ordinary full-rank null theory remains valid for arbitrary p greater than n.
Fitting and adaptation
Refit the null nuisance quantities in every parametric-bootstrap replicate, retaining the same rank-handling and smoothing algorithm. If dimension reduction is necessary, define it independently or reproduce selection under calibration. Do not silently replace covariance by a regularized estimate while retaining unmodified critical values.
Sensitivity and robustness
Examine covariance conditioning, p-to-n ratio, outliers, and the influence of preprocessing. Related characteristic-function tests may differ because of bandwidth or covariance conventions, not because one dataset has two contradictory truths. For dependent observations use a justified model-based reference; a generic row bootstrap or unrestricted permutation does not establish multivariate-normal null validity.
How to use and calibrate
Use a matching lognormal approximation or a parametric normal bootstrap that re-estimates location and covariance.
Example application
Assess joint normality beyond marginal skewness and kurtosis.
Interpretation and pitfalls
Watch out
Bandwidth and covariance normalization change the statistic. HZ and HW are overlapping family members, not unrelated evidence.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
Current MVN function interface. Mardia prints skewness and kurtosis components together: use the component named in this entry. Covariance must be estimable and observations independent.
Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: MVN
# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
X<-matrix(rnorm(120),ncol=3);Y<-matrix(rnorm(150,mean=.3),ncol=3)
print(MVN::hw(X))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
text=True, capture_output=True)
print(result.stdout)
if result.stderr:
print(result.stderr)
result.check_returncode()
Not run — Syntax checked; runtime not verified in the final environment · needs MVN
set.seed(2026)
X<-matrix(rnorm(120),ncol=3);Y<-matrix(rnorm(150,mean=.3),ncol=3)
print(MVN::hw(X))
Sources
- MVN — MVN · hwAuthor documentation/source reviewed: MVN 6.3.rdrr.io
- hwrdrr.io
- hwsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
- Reference's record:
- Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 164, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT164.