Re: What are the Parameters for Algorithm AS 62 APPL. STATIST. (1973) VOL.22, NO.2

From: Alan Miller (amiller_at_bigpond.net.au)
Date: 09/10/04


Date: Fri, 10 Sep 2004 02:07:45 GMT

By 'parameters', do you mean the arguments of the routine?
The algorithm was published in the journal Applied Statistics in 1973 in
volume 22.
The description of array FRQNCY given is:
Output: the full sampling distribution for the Mann-Whitney U statistic for
sample sizes
M and N, stored in the first (M*N + 1) elements. The first element of
FRQNCY
holds the sampling frequency for U = 0. Any elements beyond (M*N + 1) are
left
unchanged.

Cheers

--
Alan Miller
Retired
Formerly with CSIRO,
Division of Mathematics & Statistics
"Roland" <roland@nospam> wrote in message
news:ya6dnbC0x8H3n9zcRVn-rg@giganews.com...
> Does anyone know what the parameters mean in this one? I do not have
access
> to the original article.
> Specifically, how do I interpret the FRQNCY array (how is it indexed)?
TIA.
>
> Here is the Fortran algorithm (http://lib.stat.cmu.edu/apstat/62):
>
> c AS 62 generates the frequencies for the Mann-Whitney U-statistic.
> c Users are much more likely to need the distribution function.
> c Code to return the distribution function has been added at the end
> c of AS 62 by Alan Miller.   Remove the C's in column 1 to activate it.
> c
>       SUBROUTINE UDIST(M, N, FRQNCY, LFR, WORK, LWRK, IFAULT)
> C
> C     ALGORITHM AS 62  APPL. STATIST. (1973) VOL.22, NO.2
> C
> C     The distribution of the Mann-Whitney U-statistic is generated for
> C     the two given sample sizes
> C
>       INTEGER M, N, LFR, LWRK, IFAULT
>       REAL FRQNCY(LFR), WORK(LWRK)
> C
> C     Local variables
> C
>       INTEGER MINMN, MN1, MAXMN, N1, I, IN, L, K, J
>       REAL ZERO, ONE, SUM
>       DATA ZERO /0.0/, ONE /1.0/
> C
> C     Check smaller sample size
> C
>       IFAULT = 1
>       MINMN = MIN(M, N)
>       IF (MINMN .LT. 1) RETURN
> C
> C     Check size of results array
> C
>       IFAULT = 2
>       MN1 = M * N + 1
>       IF (LFR .LT. MN1) RETURN
> C
> C     Set up results for 1st cycle and return if MINMN = 1
> C
>       MAXMN = MAX(M, N)
>       N1 = MAXMN + 1
>       DO 1 I = 1, N1
>     1 FRQNCY(I) = ONE
>       IF (MINMN .EQ. 1) GO TO 4
> C
> C     Check length of work array
> C
>       IFAULT = 3
>       IF (LWRK .LT. (MN1 + 1) / 2 + MINMN) RETURN
> C
> C     Clear rest of FREQNCY
> C
>       N1 = N1 + 1
>       DO 2 I = N1, MN1
>     2 FRQNCY(I) = ZERO
> C
> C     Generate successively higher order distributions
> C
>       WORK(1) = ZERO
>       IN = MAXMN
>       DO 3 I = 2, MINMN
>         WORK(I) = ZERO
>         IN = IN + MAXMN
>         N1 = IN + 2
>         L = 1 + IN / 2
>         K = I
> C
> C     Generate complete distribution from outside inwards
> C
>         DO 3 J = 1, L
>           K = K + 1
>           N1 = N1 - 1
>           SUM = FRQNCY(J) + WORK(J)
>           FRQNCY(J) = SUM
>           WORK(K) = SUM - FRQNCY(N1)
>           FRQNCY(N1) = SUM
>     3 CONTINUE
> C
>     4 IFAULT = 0
> C
> C     Code to overwrite the frequency function with the distribution
> C     function.   N.B. The frequency in FRQNCY(1) is for U = 0, and
> C     that in FRQNCY(I) is for U = I - 1.
> C
> C     SUM = ZERO
> C     DO 10 I = 1, MN1
> C       SUM = SUM + FRQNCY(I)
> C       FRQNCY(I) = SUM
> C  10 CONTINUE
> C     DO 20 I = 1, MN1
> C  20 FRQNCY(I) = FRQNCY(I) / SUM
> C
>       RETURN
>       END
>
>


Relevant Pages

  • Re: What are the Parameters for Algorithm AS 62 APPL. STATIST. (1973) VOL.22, NO.2
    ... > c Users are much more likely to need the distribution function. ... SUBROUTINE UDIST(M, N, FRQNCY, LFR, WORK, LWRK, IFAULT) ... REAL ZERO, ONE, SUM ...
    (sci.stat.edu)
  • Re: Pain in the ass
    ... then you can get rid of them since the sum of r_i and the sum of (r_i ... One thing you definitely should say is the distribution for the r_i's. ... distribution is uniform on [0,1/n), then the probability the equation ... is zero, as well.) ...
    (sci.math)
  • Re: using random with constraints
    ... i would like to generate random vectors that have the constraint that the components should sum to zero, and that the components are picked from some distribution. ...
    (comp.soft-sys.matlab)
  • Re: using random with constraints
    ... i would like to generate random vectors that have the ... constraint that the components should sum to zero, ... the only distribution I know is the Von Mises. ...
    (comp.soft-sys.matlab)
  • Re: Energy constrained RL
    ... It has a cost. ... to me that reversible adiabatic computation can approach zero ... Learning cannot be a reversible process (even though ... entropy of this distribution, and 2) a reduction in the uncertainty of the ...
    (comp.ai.philosophy)