Code covered by the BSD License  

Highlights from
Smirnov Cramer Von Mises Test

3.33333

3.3 | 3 ratings Rate this file 11 Downloads (last 30 days) File Size: 2.14 KB File ID: #3579
image thumbnail

Smirnov Cramer Von Mises Test

by G. Levin

 

09 Jun 2003 (Updated 13 Jun 2003)

Single sample Smirnov-Cramer-Von Mises goodness-of-fit hypothesis test.

| Watch this File

File Information
Description

Single sample Smirnov-Cramer-Von Mises goodness-of-fit hypothesis test.
H = MTEST(X,ALPHA) performs the particular case of Smirnov-Cramer-Von Mises test to determine whether the null hypothesis of composite normality CDF is a reasonable assumption regarding the population distribution of a random sample X with the desired significance level ALPHA. The Smirnov-Cramer-Von Mises test is based on interpolation procedure, so the significance level is restricted to
0.001 <= ALPHA <= 0.10.

H indicates the result of the hypothesis test according to the MATLAB rules of conditional statements:
H=1 => Do not reject the null hypothesis at significance level ALPHA.
H=0 => Reject the null hypothesis at significance level ALPHA.
 
Let S(x) be the empirical c.d.f. estimated from the sample vector X,
F(x) be the corresponding true normal population c.d.f., and CDF be a
normal c.d.f. with zero mean and unit standard deviation. The Smirnov-Cramer-Von Mises hypotheses and test statistic in this particular case are:

Null Hypothesis: F(x) is normal with zero mean and unit variance.
Alternative Hypothesis: F(x) is not normal with zero mean and unit variance.

Test Statistic: W^2 = integral from 0 to 1 of (S(x)-F(x))^2 dF(x)

The decision to reject the null hypothesis is taken when the test statistic exceeds the critical value.

X must be a row vector representing a random sample. ALPHA must be a scalar.
The function doesn't check the formats of X and ALPHA, as well as a number of the input and output parameters.

The asymptotic limit of the Smirnov-Cramer-Von Mises is reached when
LENGTH(X)>=3.

References:
W. T. Eadie, D. Drijard, F. E. James, M Roos and B. Sadoulet, "Statistical Methodsin Experimental Physics", North-Holland, Sec. Reprint, 1982.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
01 Feb 2008 hana aya  
18 Mar 2008 gian paolo impo

The command line
W2=(1/12/N + sum((F-(2*I'- 1)/2/N).^2))/N;
needs the ' after the I, otherwise MatLab gives an error.
Note also that the input vector x needs to have zero mean and unit std. This could be improved as a simple computation

18 Aug 2008 Luyy Luyy

thanks a lot!

Please login to add a comment or rating.
Updates
13 Jun 2003

Open comments.

Tag Activity for this File
Tag Applied By Date/Time
statistics G. Levin 22 Oct 2008 07:02:54
probability G. Levin 22 Oct 2008 07:02:54
smirnov G. Levin 22 Oct 2008 07:02:54
cramer G. Levin 22 Oct 2008 07:02:54
mises G. Levin 22 Oct 2008 07:02:54
statistic G. Levin 22 Oct 2008 07:02:54
distribution G. Levin 22 Oct 2008 07:02:54
normality G. Levin 22 Oct 2008 07:02:54
population G. Levin 22 Oct 2008 07:02:54
mises Glenn Gomes 15 Apr 2010 15:27:03

Contact us at files@mathworks.com