### 20.5.5 Testing a distribution with the Kolmogorov-Smirnov distribution

The kolmogorovt command uses the Kolmogorov test to compare sample data to a specified continuous distribution.

- kolmogorovt takes two arguments and possibly additional parameters.
  - L, a list of sample data.
  - Optionally, distr. This can be one of:
    - The name of a distribution and the necessary parameters (see Section 20.3.4 for a list of distributions and their parameters).
    - Another list of sample data.
- kolmogorovt(L,distr) returns a list of three values:
  - The D statistic, which is the maximum distance between the cumulative distribution functions of the samples or the sample and the given distribution.
  - The K value, where K=D√n (for a single data set, where n is the size of the data set) or K=D√n1 n2 /(n1 + n2) (when there are two data sets, with sizes n1 and n2). The K value will tend towards the Kolmogorov-Smirnov distribution as the data size approaches infinity.
  - 1-kolmogorovd(K), which will be close to 1 when the distributions look like they match.

#### Examples

kolmogorovt(randvector(100,normald,0,1),normald(0,1))

| ⎡ ⎣ | D=0.112141597243,K=1.12141597243,1−kolmogorovd(K)=0.161616499536 | ⎤ ⎦

kolmogorovt(randvector(100,normald,0,1),student(2))

| ⎡ ⎣ | D=0.112592987625,K=1.12592987625,1−kolmogorovd(K)=0.158375510292 | ⎤ ⎦