help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining if samples are normal


From: Henry F. Mollet
Subject: Re: Determining if samples are normal
Date: Mon, 26 Sep 2005 14:37:09 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

Am I doing this correctly? Anderson_darling_test of cdf normal and cdf
logistic give the same result (0.01). Graphs shows that they are different.
Henry

octave:21> x=linspace (-4,4,100);
octave:22> mu=0.0; sigma = 1.0;
octave:23> cnormalx=0.5+0.5.*erf((x-mu)./sigma./sqrt(2));
octave:24> plot (x,cnormalx,"x")
octave:25> anderson_darling_test(cnormalx,'normal')
ans = 0.010000
octave:26> a=0; lambda=2;
octave:27> clogisticx=1.0./(1.0+exp(-lambda.*(x-a)));
octave:28> hold on
octave:30> plot (x,clogisticx,"@33")
octave:31> anderson_darling_test(clogisticx,'normal')
ans = 0.010000



on 9/26/05 12:55 AM, Paul Kienzle at address@hidden wrote:

> The Anderson-Darling test is claimed to be pretty good:
> 
> http://www.itl.nist.gov/div898/handbook/prc/section2/prc213.htm
> http://www.itl.nist.gov/div898/handbook/eda/section3/eda35e.htm
> 
> Here's the relevant section from the R manual:
> 
> http://www.maths.lth.se/help/R/.R/library/nortest/html/ad.test.html
> 
>> The Anderson-Darling test is an EDF omnibus test for the composite
>> hypothesis of normality. The test statistic is
>> 
>> A^2 = -n -frac{1}{n} sum_{i=1}^{n} [2i-1] [ln(p_{(i)}) + ln(1 -
>> p_{(n-i+1)})],
>> 
>> where p_{(i)} = Phi([x_{(i)} - overline{x}]/s). Here, Phi is the
>> cumulative distribution function of the standard normal distribution,
>> and overline{x} and s are mean and standard deviation of the data
>> values. The p-value is computed from the modified statistic
>> 
>> Z=A^2 (1.0 + 0.75/n +2.25/n^{2})
>> 
>> according to Table 4.9 in Stephens (1986).
> 
> Here are the critical values I found elsewhere on the net.
> 
> 90% 0.631
> 95% 0.752
> 97.5% 0.873
> 99% 1.035
> 
> For example, if A^2 > 0.752 you can say that your data set is not
> normally distributed with 95% confidence.
> 
> This is implemented in octave-forge as 1-p =
> anderson_darling_test(x,'normal').  That is, if anderson_darling_test
> returns a value of 0.05 then you can say your data set is not normally
> distributed with 95% confidence.
> 
> - Paul
> 
> On Sep 25, 2005, at 1:59 PM, Søren Hauberg wrote:
> 
>> Hi,
>> Does anybody know how I can test wether or not some samples are
>> normaly distributed? I tried graphical methods, such as looking at
>> histograms and qqplots, but I don't trust my own judgement enough to
>> use graphical methods.
>> 
>> /Søren
> 
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]