Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0026/kolmo.doc
There are 2 other files named kolmo.doc in the archive. Click here to see a list.
SUBROUTINE KOLMO

PURPOSE
   TESTS THE DIFFERENCE BETWEEN EMPIRICAL AND THEORETICAL
   DISTRIBUTIONS  USING THE KOLMOGOROV-SMIRNOV TEST

USAGE
   CALL KOLMO(X,N,Z,PROB,IFCOD,U,S,IER)

DESCRIPTION OF PARAMETERS
   X	- INPUT VECTOR OF N INDEPENDENT OBSERVATIONS.  ON
	  RETURN FROM KOLMO, X HAS BEEN SORTED INTO A
	  MONOTONIC NON-DECREASING SEQUENCE.
   N	- NUMBER OF OBSERVATIONS IN X
   Z	- OUTPUT VARIABLE CONTAINING THE GREATEST VALUE WITH
	  RESPECT TO X OF  SQRT(N)*ABS(FN(X)-F(X)) WHERE
	  F(X) IS A  THEORETICAL DISTRIBUTION FUNCTION AND
	  FN(X) AN EMPIRICAL DISTRIBUTION FUNCTION.
   PROB - OUTPUT VARIABLE CONTAINING THE PROBABILITY OF
	  THE STATISTIC BEING GREATER THAN OR EQUAL TO Z IF
	  THE HYPOTHESIS THAT X IS FROM THE DENSITY UNDER
	  CONSIDERATION IS TRUE.  E.G., PROB = 0.05 IMPLIES
	  THAT ONE CAN REJECT THE NULL HYPOTHESIS THAT THE SET
	  X IS FROM THE DENSITY UNDER CONSIDERATION WITH 5 PER
	  CENT PROBABILITY OF BEING INCORRECT.	PROB = 1. -
	  SMIRN(Z).
   IFCOD- A CODE DENOTING THE PARTICULAR THEORETICAL
	  PROBABILITY DISTRIBUTION FUNCTION BEING CONSIDERED.
	  = 1---F(X) IS THE NORMAL PDF.
	  = 2---F(X) IS THE EXPONENTIAL PDF.
	  = 3---F(X) IS THE CAUCHY PDF.
	  = 4---F(X) IS THE UNIFORM PDF.
	  = 5---F(X) IS USER SUPPLIED.
   U	- WHEN IFCOD IS 1 OR 2, U IS THE MEAN OF THE DENSITY
	  GIVEN ABOVE.
	  WHEN IFCOD IS 3, U IS THE MEDIAN OF THE CAUCHY
	  DENSITY.
	  WHEN IFCOD IS 4, U IS THE LEFT ENDPOINT OF THE
	  UNIFORM DENSITY.
	  WHEN IFCOD IS 5, U IS USER SPECIFIED.
   S	- WHEN IFCOD IS 1 OR 2, S IS THE STANDARD DEVIATION OF
	  DENSITY GIVEN ABOVE, AND SHOULD BE POSITIVE.
	  WHEN IFCOD IS 3, U - S SPECIFIES THE FIRST QUARTILE
	  OF THE CAUCHY DENSITY.  S SHOULD BE NON-ZERO.
	  IF IFCOD IS 4, S IS THE RIGHT ENDPOINT OF THE UNIFORM
	  DENSITY.  S SHOULD BE GREATER THAN U.
	  IF IFCOD IS 5, S IS USER SPECIFIED.
   IER	- ERROR INDICATOR WHICH IS NON-ZERO IF S VIOLATES ABOVE
	  CONVENTIONS.	ON RETURN NO TEST HAS BEEN MADE, AND X
	  AND Y HAVE BEEN SORTED INTO MONOTONIC NON-DECREASING
	  SEQUENCES.  IER IS SET TO ZERO ON ENTRY TO KOLMO.
	  IER IS CURRENTLY SET TO ONE IF THE USER-SUPPLIED PDF
	  IS REQUESTED FOR TESTING.  THIS SHOULD BE CHANGED
	  (SEE REMARKS) WHEN SOME PDF IS SUPPLIED BY THE USER.

REMARKS
   N SHOULD BE GREATER THAN OR EQUAL TO 100.  (SEE THE
   MATHEMATICAL DESCRIPTION GIVEN FOR THE PROGRAM SMIRN,
   CONCERNING ASYMPTOTIC FORMULAE)  ALSO, PROBABILITY LEVELS
   DETERMINED BY THIS PROGRAM WILL NOT BE CORRECT IF THE
   SAME SAMPLES ARE USED TO ESTIMATE PARAMETERS FOR THE
   CONTINUOUS DISTRIBUTIONS WHICH ARE USED IN THIS TEST.
   (SEE THE MATHEMATICAL DESCRIPTION FOR THIS PROGRAM)
   F(X) SHOULD BE A CONTINUOUS FUNCTION.
   ANY USER SUPPLIED CUMULATIVE PROBABILITY DISTRIBUTION
   FUNCTION SHOULD BE CODED BEGINNING WITH STATEMENT 26 BELOW,
   AND SHOULD RETURN TO STATEMENT 27.

   DOUBLE PRECISION USAGE---IT IS DOUBTFUL THAT THE USER WILL
   WISH TO PERFORM THIS TEST USING DOUBLE PRECISION ACCURACY.
   IF ONE WISHES TO COMMUNICATE WITH KOLMO IN A DOUBLE
   PRECISION PROGRAM, HE SHOULD CALL THE FORTRAN SUPPLIED
   PROGRAM SNGL(X) PRIOR TO CALLING KOLMO, AND CALL THE
   FORTRAN SUPPLIED PROGRAM DBLE(X) AFTER EXITING FROM KOLMO.
   (NOTE THAT SUBROUTINE SMIRN DOES HAVE DOUBLE PRECISION
   CAPABILITY AS SUPPLIED BY THIS PACKAGE.)


SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   SMIRN, NDTR, AND ANY USER SUPPLIED SUBROUTINES REQUIRED.

METHOD
   FOR REFERENCE, SEE (1) W. FELLER--ON THE KOLMOGOROV-SMIRNOV
   LIMIT THEOREMS FOR EMPIRICAL DISTRIBUTIONS--
   ANNALS OF MATH. STAT., 19, 1948.  177-189,
   (2) N. SMIRNOV--TABLE FOR ESTIMATING THE GOODNESS OF FIT
   OF EMPIRICAL DISTRIBUTIONS--ANNALS OF MATH. STAT., 19,
   1948.  279-281.
   (3) R. VON MISES--MATHEMATICAL THEORY OF PROBABILITY AND
   STATISTICS--ACADEMIC PRESS, NEW YORK, 1964.	490-493,
   (4) B.V. GNEDENKO--THE THEORY OF PROBABILITY--CHELSEA
   PUBLISHING COMPANY, NEW YORK, 1962.	384-401.