psi.rks: Random samples from Kolmogorov distribution

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/psistat.R

Description

Generate random samples from Kolmogorov distribution.

Usage

1
psi.rks(n, df, randgen = runif, cdf = punif, ...)

Arguments

n

number of observations.

df

degrees of freedom of the Kolmogorov distribution

randgen

a function or a name of one that generates random numbers from the hypothesised distribution.

cdf

the cdf of the hypothesised distribution.

...

parameters to be passed down to randgen and cdf

Details

Instances of the D_{df} statistic are obtained by generating random samples of length df from the hypothesised distribution and computing D_{df} on them.

In the case of a simple null hypothesis from a continuous distribution the distribution of the statistic does not depend on the underlying distribution. So, only the arguments n and df are really necessary for the Kolmogorov-Smirnov test. Imaginative settings for this argument may be used to generate samples in the case of composite hypotheses.

Value

a numeric vector representing a sample from the distribution of the Kolmogorov statistic for the specified distribution.

Author(s)

Georgi N. Boshnakov

See Also

psi.pks

Examples

1
2
3
4
5
6
7
x1 <- psi.rks(1000,10)
hist(x1)

plot(ecdf(x1))                   # simulation estimate of the dist of D_10

f1 <- function(x) psi.pks(x,10)
curve(f1,0,1,col="blue",add=TRUE)  # overlay the exact cdf

GeoBosh/psistat documentation built on Nov. 19, 2020, 8:19 p.m.