psi.Dn.Rd
Compute the Kolmogorov statistic and its one-sided variants.
psi.Dn(x, cdf = pnorm, type = c("D!=", "D^+", "D^-"), ties.jitter = NULL, ...)
x | numeric; the data vector |
---|---|
cdf | a character string naming a cumulative distribution function or an actual cumulative distribution function such as 'pnorm'. |
type | specifies the required variant of the statistic and must
be one of '" |
ties.jitter | processing of ties: if NULL (default) no check
for ties is done, if TRUE a default jitter is applied to tied values,
a numeric value, say |
... | parameters of the distribution function specified by
|
The same result may be obtained by extracting the statistic
component from the result of ks.test
, see the examples.
psi.Dn
may be convenient for use as part of other calculations
since it only computes \(D\).
When there are ties in the data and ties.jitter
is not NULL the
returned value is random and will vary even if the function is
called with the same data.
the value of the requested statistic, a single number.
#> [1] 0.3340103#> D #> 0.3340103psi.Dn(a1,cdf=pnorm,type="D^+")#> [1] 0.01268561#> D^+ #> 0.01268561psi.Dn(a1,cdf=pnorm,type="D^-")#> [1] 0.3340103#> D^- #> 0.3340103psi.Dn(a1,cdf=pnorm,mean=2,sd=2.3) # pnorm with parameters.#> [1] 0.4647364#> [1] 0.3psi.Dn(a1,cdf=pexp,rate=0.1)#> [1] 0.7996587