![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieAchtung: ab Mitte Oktober neue Adresse und Telefon-Nummern!Attention: effective from middle of October new address and telephone numbers! |
![]() |
KSTWO
Return the two-sided Kolmogorov-Smirnov statistic
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
kstwo, data1, data2, D, prob
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
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
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
procedure PROB_KS - computes significance of K-S distribution
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
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]