Previous: stcalc, Up: statistics   [Contents]


13.4 kolmogorov

calculate the probability distribution of Kolmogorov’s goodness-of-fit measure.

Synopsis

#include <suplib/stats.h>

int kolmogorov(
  int n,
  double d,
  double *p
);

Parameters

int n

The number of random variates

double d

The Kolmogorov statistic, D_n

double *p

Output: probability( D_n < d )

Description

kolmogorov calculates the probability distribution of Kolmogorov’s goodness-of-fit measure, D_n, providing P(D_n < d).

This code is taken from G. Marsaglia, Wai Wan Tsang and Jingbo Wong, J.Stat.Software (http://www.jstatsoft.org/v08/i18/). The only changes were to support error returns.

Returns

0

no error

ENOMEM

a memory allocation failed.

Author

Original by G. Marsaglia, Wai Wan Tsang and Jingbo Wong.

Copyright

As per http://www.jstatsoft.org/instructions.php, "papers and code on our servers, will be freely and unrestrictedly available for anonymous ftp".