Kolmogorov_dist {fmx}R Documentation

One-Sample Kolmogorov Distance

Description

To calculate the one-sample Kolmogorov distance between observations and a distribution.

Usage

Kolmogorov_dist(x, null, alternative = c("two.sided", "less", "greater"), ...)

Arguments

x

numeric vector, observations x

null

cumulative distribution function

alternative

character scalar, alternative hypothesis, either 'two.sided' (default), 'less', or 'greater'

...

additional arguments of null

Details

Function Kolmogorov_dist is different from ks.test in the following aspects

Value

Function Kolmogorov_dist returns a numeric scalar.

Examples

# from ?stats::ks.test
x1 = rnorm(50)
ks.test(x1+2, y = pgamma, shape = 3, rate = 2)
Kolmogorov_dist(x1+2, null = pgamma, shape = 3, rate = 2) # exactly the same

# discrete distribution
x2 <- rnbinom(n = 1e2L, size = 500, prob = .4)
suppressWarnings(ks.test(x2, y = pnbinom, size = 500, prob = .4)) # warning on ties
Kolmogorov_dist(x2, null = pnbinom, size = 500, prob = .4) # wont be the same


[Package fmx version 0.1.2 Index]