4.5

4.5 | 2 ratings Rate this file 33 downloads (last 30 days) File Size: 6.42 KB File ID: #17931

HZmvntest

by Antonio Trujillo-Ortiz

 

08 Dec 2007 (Updated 01 Jan 2009)

Code covered by BSD License  

Henze-Zirkler's Multivariate Normality Test.

Download Now | Watch this File

File Information
Description

Henze and Zirkler (1990) introduce a multivariate version of the univariate There are many tests for assessing the multivariate normality in the statistical literature (Mecklin and Mundfrom, 2003). Unfortunately, there is no known uniformly most powerful test and it is recommended to perform several test to assess it. It has been found that the Henze and Zirkler test have a good overall power against alternatives to normality.

The Henze-Zirkler test is based on a nonnegative functional distance that measures the distance between two distribution functions: the characteristic function of the multivariate normality and the empirical characteristic function.

The Henze-Zirkler statistic is approximately distributed as a lognormal. The lognormal distribution is used to compute the null hypothesis probability.

According to Henze-Wagner (1997), this test has the desirable properties of,

   --affine invariance
   --consistency against each fixed nonnormal alternative distribution
   --asymptotic power against contiguous alternatives of order n^-1/2
   --feasibility for any dimension and any sample size

If the data is multivariate normality, the test statistic HZ is approximately lognormally distributed. It proceeds to calculate the mean, variance and smoothness parameter. Then, mean and variance are lognormalized and the P-value is estimated.

Also, for all the interested people, we provide the lognormal critical value.
     
Inputs:
X - data matrix (size of matrix must be n-by-p; data=rows,
independent variable=columns)
c - covariance normalized by n (=1, default)) or n-1 (~=1)
alpha - significance level (default = 0.05)

Output:
- Henze-Zirkler's Multivariate Normality Test

Required Products Statistics Toolbox
MATLAB release MATLAB 7 (R14)
Zip File Content  
Other Files HZmvntest/HZmvntest.m,
HZmvntest/irisetdata.mat,
HZmvntest/READMEHZtest.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
15 Dec 2008 Johan

Nice implemetation and sample data to test the file on. However, it runs a bit slow. I recompted the variable Djk by avoiding loops and it runs much faster:
Djk = - 2*Y' + diag(Y')*ones(1,n) + ones(n,1)*diag(Y')';
/J.D.

10 Jan 2009 Antonio Trujillo-Ortiz

Dear Johan,

Your valuable comment (15-12-08)for this m-file runs much faster was taken into account. We thank you.
Antonio

23 Jul 2009 Michael Jimmel

Dear Sir Antonio,

Could you explain/describe the mean and standard deviation arguments to the Log normal cdf? Why not use 'mu' and 'sqrt(si2)' directly?

Thanks/Gracias,

Mike

23 Jul 2009 Antonio Trujillo-Ortiz

Dear Michael,
Thanks for your interest of this m-file. As you know, we only generated the Matlab computational algorithm from the original published paper. If you have any mathematical or statistical fundamentals inquiry you must refer to the author(s). I give you the Dr. Norbert Henze's email address
henze@stoch.uni-karlsruhe.de
and/or
N.Henze@math.uni-karlsruhe.de

However, we don't need the lognormal cdf (logncdf) neither the mean and variance of the lognormal distribution (longnstat) functions. For the used mean (mu) and variance (si2), which are the Henze-Zirkler mean and variance, must, as the author establish, to be converted to the lognormal Henze-Zirkler mean and variance. As you can see, using the provied Iris data example. The mean(mu)=0.7635 and variance(si2)=0.0112. With a Henze-Zirkler lognormal mean: -0.279408 and Henze-Zirkler lognormal variance: 0.1379069. But, if you try to use te mu and si2 values by the longnstat function, you get the incorrect lognormal values of 2.1459 and 5.7768e-004, respecively.

Yours,

Prof. Antonio Trujillo-Ortiz

24 Jul 2009 Michael Jimmel

Dear Prof. Antonio Trujillo-Ortiz,

Thanks for your quick reply. It was helpful. Now I understand. We need to get the LN-mean and LN-standard-deviation in order to get the mean ('mu') and standard deviation ('sqrt(si2)' ) from LNRVs.

Thank you very much/Muchos gracias,

Mike

Please login to add a comment or rating.
Updates
10 Dec 2007

It was added an appropriate format to cite this file.

12 Dec 2007

Text was improved.

14 Feb 2008

Data set file was reentered.

15 Feb 2008

Text was improved.

01 Jan 2009

In order to improve this m-file. The valuable comment of Johan (J.D.) '...avoiding loops and it (the file) runs much faster.' (15/12/08) was taken into account. We thank Johan.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
probability Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
henzezirkler Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
nultivariate normality test Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
multivariate Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
normality te Antonio Trujillo-Ortiz 22 Oct 2008 09:38:27
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com