ksTest

Syntax

ksTest(X, Y)

Details

Conduct Kolmogorov-Smirnov test on X and Y.

Note:
DolphinDB's ksTestexclusively accepts numeric vectors and returns a dictionary with a fixed structure. In contrast, SciPy's kstestimplements a more generalized abstract interface, automatically adapting to both one-sample and two-sample scenarios based on input types, while offering finer-grained control parameters for statistical inference.

Parameters

X and Y are numeric vectors indicating the samples for the test.

Returns

A dictionary with the following keys:

  • ksValue: Kolmogorov-Smirnov statistic

  • pValue: p-value of the test

  • D: D-stat

  • method: "Two-sample Kolmogorov-Smirnov test"

Examples

x = norm(0.0, 1.0, 50)
y = norm(0.0, 1.0, 20)
ksTest(x, y);

/* output:
ksValue->0.739301
pValue->0.645199
D->0.19
method->Two-sample Kolmogorov-Smirnov test
*/