Hi
Out of curiousty i decided to write a small prog to perform the A-D test in
matlab for the gumbel distribution. Obtaining the gumbel parameters is easy.
however the difficulty is in the actual A-D computation formula as stated by
Stephens(1977).
A2=-[Sum(i=1,n)(2i-1){logzi+log(1-zn+1-i)}]/n-n
whats the point of /n and -n since they both cancel out anyway. regardless
of this, i still get extremely large values of A2. I checked my file using a
different distribution and compared that value with SAS and it was totally
wrong.
can anyone point out whats wrong in the m file below
function adtest;
cd c:\
cd data
cd 1k
An=[ ];
x=load('ratio_error_1');
[phat,cov]=wgamfit(x,0); %estimating gumbel parameters
f=wgampdf(x,phat(1,1),phat(1,2)); %creating the gumbel equivalent data based
%upon the above parameters
f=f';
b=1000:-1:1;
minus_f=f(b);
%computing the A-D statistic
A=-1000-(1/1000)*sum((2.*(1:1:1000)-1).*(log(f(1,1:1:1000))+log(1-minus_f(1,
1:1000))))
thanks
veeral
=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
http://jse.stat.ncsu.edu/
=================================================================