KolmogorovTwoSample Class |
Namespace: Imsl.Stat
The KolmogorovTwoSample type exposes the following members.
Name | Description | |
---|---|---|
KolmogorovTwoSample |
Constructs a two sample Kolmogorov-Smirnov goodness-of-fit test.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
MaximumDifference | ,
the maximum difference between the theoretical and empirical CDF's.
| |
MinimumDifference | ,
the minimum difference between the theoretical and empirical CDF's.
| |
NumberMissingX |
Returns the number of missing values in the x sample.
| |
NumberMissingY |
The number of missing values in the y sample.
| |
OneSidedPValue |
Probability of the statistic exceeding D under
the null hypothesis of equality and against the
one-sided alternative. An exact probability
is computed if the number of observation is less than or equal to 80,
otherwise an approximate probability is computed.
| |
TestStatistic |
The test statistic, .
| |
TwoSidedPValue |
Probability of the statistic exceeding D under
the null hypothesis of equality and against the
two-sided alternative. This probability is twice the probability,
,
reported by OneSidedPValue,
(or 1.0 if ).
This approximation is nearly exact when
.
| |
Z |
The normalized D statistic without the continuity correction applied.
|
Class KolmogorovTwoSample computes Kolmogorov-Smirnov two-sample test statistics for testing that two continuous cumulative distribution functions (CDF's) are identical based upon two random samples. One- or two-sided alternatives are allowed. Exact p-values are computed for the two-sided test when , where n is the number of non-missing X observations and m the number of non-missing Y observation.
Let denote the empirical CDF in the X sample, let denote the empirical CDF in the Y sample and let the corresponding population distribution functions be denoted by and , respectively. Then, the hypotheses tested by KolmogorovTwoSample are as follows:
The test statistics are given as follows: Asymptotically, the distribution of the statistic converges to a distribution given by Smirnov (1939).Exact probabilities for the two-sided test are computed when , according to an algorithm given by Kim and Jennrich (1973). When , the very good approximations given by Kim and Jennrich are used to obtain the two-sided p-values. The one-sided probability is taken as one half the two-sided probability. This is a very good approximation when the p-value is small (say, less than 0.10) and not very good for large p-values.