[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


KUIPERTWO Source code in kuipertwo.pro

KUIPERTWO

Name
       KUIPERTWO
Purpose
       Compute the two-sided Kuiper statistic (invariant Kolmogorov-Smirnov)
Explanation
       Returns the Kuiper statistic and associated probability
       that two arrays of data values are drawn from the same distribution
       Algorithm adapted from KSTWO in "Numerical
       Recipes" by Press et al., 2nd edition (1992), Chapter 14
Calling Sequence
       kuipertwo, data1, data2, D, prob, [ /PLOT ]
Input Parameters
       data1 -  vector of data values, at least 4 data values must be included
               for the Kuiper statistic to be meaningful
       data2 -  second set of data values, does not need to have the same
               number of elements as data1
Output Parameters
       D - floating scalar giving the Kuiper statistic.   It
               specifies the sum of positive and negative deviations between
               the cumulative distributions of the two data sets
       prob - floating scalar between 0 and 1 giving the significance level of
               the Kuiper statistic.   Small values of PROB show that the
               cumulative distribution function of DATA1 is significantly
               different from DATA2
Keyword Parameters
       PLOT - If this keyword is set and non-zero, then KUIPERTWO will display
               a plot of the CDF of the two data sets.
               The data values where the Kuiper statistic is
               computed (i.e. at the maximum difference between the CDF of
               the two data sets) are indicated by vertical dashed lines.
               KUIPERTWO accepts the _EXTRA keyword, so that most plot keywords
               (e.g. TITLE, XTITLE, XSTYLE) can also be passed to KUIPERTWO.
Example
       Test whether two vectors created by the RANDOMN function likely came
       from the same distribution
       IDL> data1 = randomn(seed,40)        ;Create data vectors to be
       IDL> data2 = randomn(seed,70)        ;compared
       IDL> kuipertwo, data1, data2, D, prob   & print,D,prob
Procedures Used
       procedure PROB_KUIPER - computes significance of Kuiper distribution
Revision History
       Written     W. Landsman                August, 1992
       FP computation of N_eff      H. Ebeling/W. Landsman  March 1996
       Converted to IDL V5.0   W. Landsman   September 1997
       Fix for arrays containing equal values J. Ballet/W. Landsman
       Oct. 2001
       Adapted from KSTWO, added PLOT keyword  J. Ballet     July 2004

Last modified by pro2html on 2004 July 31 at 03:56 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically