Learn R Programming

distrEx (version 2.9.5)

KolmogorovDist: Generic function for the computation of the Kolmogorov distance of two distributions

Description

Generic function for the computation of the Kolmogorov distance \(d_\kappa\) of two distributions \(P\) and \(Q\) where the distributions are defined on a finite-dimensional Euclidean space \((\R^m,{\cal B}^m)\) with \( {\cal B}^m \) the Borel-\(\sigma\)-algebra on \(R^m\). The Kolmogorov distance is defined as $$d_\kappa(P,Q)=\sup\{|P(\{y\in\R^m\,|\,y\le x\})-Q(\{y\in\R^m\,|\,y\le x\})| | x\in\R^m\}$$ where \(\le\) is coordinatewise on \(\R^m\).

Usage

KolmogorovDist(e1, e2, ...)
# S4 method for AbscontDistribution,AbscontDistribution
KolmogorovDist(e1,e2, ...)
# S4 method for AbscontDistribution,DiscreteDistribution
KolmogorovDist(e1,e2, ...)
# S4 method for DiscreteDistribution,AbscontDistribution
KolmogorovDist(e1,e2, ...)
# S4 method for DiscreteDistribution,DiscreteDistribution
KolmogorovDist(e1,e2, ...)
# S4 method for numeric,UnivariateDistribution
KolmogorovDist(e1, e2, ...)
# S4 method for UnivariateDistribution,numeric
KolmogorovDist(e1, e2, ...)
# S4 method for AcDcLcDistribution,AcDcLcDistribution
KolmogorovDist(e1, e2, ...)

Value

Kolmogorov distance of e1 and e2

Arguments

e1

object of class "Distribution" or class "numeric"

e2

object of class "Distribution" or class "numeric"

...

further arguments to be used in particular methods (not in package distrEx)

Methods

e1 = "AbscontDistribution", e2 = "AbscontDistribution":

Kolmogorov distance of two absolutely continuous univariate distributions which is computed using a union of a (pseudo-)random and a deterministic grid.

e1 = "DiscreteDistribution", e2 = "DiscreteDistribution":

Kolmogorov distance of two discrete univariate distributions. The distance is attained at some point of the union of the supports of e1 and e2.

e1 = "AbscontDistribution", e2 = "DiscreteDistribution":

Kolmogorov distance of absolutely continuous and discrete univariate distributions. It is computed using a union of a (pseudo-)random and a deterministic grid in combination with the support of e2.

e1 = "DiscreteDistribution", e2 = "AbscontDistribution":

Kolmogorov distance of discrete and absolutely continuous univariate distributions. It is computed using a union of a (pseudo-)random and a deterministic grid in combination with the support of e1.

e1 = "numeric", e2 = "UnivariateDistribution":

Kolmogorov distance between (empirical) data and a univariate distribution. The computation is based on ks.test.

e1 = "UnivariateDistribution", e2 = "numeric":

Kolmogorov distance between (empirical) data and a univariate distribution. The computation is based on ks.test.

e1 = "AcDcLcDistribution", e2 = "AcDcLcDistribution":

Kolmogorov distance of mixed discrete and absolutely continuous univariate distributions. It is computed using a union of the discrete part, a (pseudo-)random and a deterministic grid in combination with the support of e1.

Author

Matthias Kohl Matthias.Kohl@stamats.de,
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de

References

Huber, P.J. (1981) Robust Statistics. New York: Wiley.

Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.

See Also

ContaminationSize, TotalVarDist, HellingerDist, Distribution-class

Examples

Run this code
KolmogorovDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
                 mixCoeff=c(0.2,0.8)))
KolmogorovDist(Norm(), Td(10))
KolmogorovDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100))
KolmogorovDist(Pois(10), Binom(size = 20)) 
KolmogorovDist(Norm(), rnorm(100))
KolmogorovDist((rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5), Norm())
KolmogorovDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5))

Run the code above in your browser using DataLab