ks_test {Ecume}R Documentation

Weighted KS Test

Description

Weighted Kolmogorov-Smirnov Two-Sample Test with threshold

Usage

ks_test(x, y, thresh = 0.05, w_x = rep(1, length(x)), w_y = rep(1, length(y)))

Arguments

x

Vector of values sampled from the first distribution

y

Vector of values sampled from the second distribution

thresh

The threshold needed to clear between the two cumulative distributions

w_x

The observation weights for x

w_y

The observation weights for y

Details

The usual Kolmogorov-Smirnov test for two vectors X and Y, of size m and n rely on the empirical cdfs E_x and E_y and the test statistic

D = sup_{t\in (X, Y)} |E_x(x) - E_y(x))

. This modified Kolmogorov-Smirnov test relies on two modifications.

Value

A list with class "htest" containing the following components:

References

Monahan, J. (2011). Numerical Methods of Statistics (2nd ed., Cambridge Series in Statistical and Probabilistic Mathematics). Cambridge: Cambridge University Press. doi:10.1017/CBO9780511977176

Examples

 x <- runif(100)
 y <- runif(100, min = .5, max = .5)
 ks_test(x, y, thresh = .001)

[Package Ecume version 0.9.1 Index]