Re: A-D in matlab
I used the expression below as suggested by Donald: A2 =( - [long expression]/n) - n but still getting some fairly large values. 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/ =
A-D in matlab
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/ =
Re: A-D in matlab
On Sun, 28 Jan 2001, Veeral Patel wrote in part: 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. Uh-huh. Perhaps you need to consider the difference between A2 = - [long expression]/n - n and A2 = - [long expression]/(n - n). The latter of course is infinitely large. In your program, you appear not to have divided by n, which surely means that your value of A2 will be n times too large, even if you have correctly computed [long expression]. -- DFB. -- Donald F. Burrill[EMAIL PROTECTED] 348 Hyde Hall, Plymouth State College, [EMAIL PROTECTED] MSC #29, Plymouth, NH 03264 (603) 535-2597 Department of Mathematics, Boston University[EMAIL PROTECTED] 111 Cummington Street, room 261, Boston, MA 02215 (617) 353-5288 184 Nashua Road, Bedford, NH 03110 (603) 471-7128 = Instructions for joining and leaving this list and remarks about the problem of INAPPROPRIATE MESSAGES are available at http://jse.stat.ncsu.edu/ =