[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Achtung: ab Mitte Oktober neue Adresse und Telefon-Nummern!
Attention: effective from middle of October new address and telephone numbers!
[Uni logo]


KSTWO Source code in kstwo.pro

KSTWO

Name
       KSTWO
Purpose
       Return the two-sided Kolmogorov-Smirnov statistic
Explanation
       Returns the Kolmogorov-Smirnov statistic and associated probability
       that two arrays of data values are drawn from the same distribution
       Algorithm taken from procedure of the same name in "Numerical
       Recipes" by Press et al., 2nd edition (1992), Chapter 14
Calling Sequence
       kstwo, data1, data2, D, prob
Input Parameters
       data1 -  vector of data values, at least 4 data values must be included
               for the K-S 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 Kolmogorov-Smirnov statistic.   It
               specifies the maximum deviation between the cumulative
               distribution of the data and the supplied function
       prob - floating scalar between 0 and 1 giving the significance level of
               the K-S statistic.   Small values of PROB show that the
               cumulative distribution function of DATA1 is significantly
               different from DATA2
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> kstwo, data1, data2, D, prob   & print,D,prob
Procedures Used
       procedure PROB_KS - computes significance of K-S 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

Last modified by pro2html on 2001 October 12 at 03:41 UTC

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

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