distrEx (version 0.4-2)

TotalVarDist: Generic function for the computation of the total variation distance of two distributions

Description

Generic function for the computation of the total variation distance $d_v$ of two distributions $P$ and $Q$ where the distributions may be defined for an arbitrary sample space $(\Omega,{\cal A})$. The total variation distance is defined as $$d_v(P,Q)=\sup_{B\in{\cal A}}|P(B)-Q(B)|$$

Usage

TotalVarDist(e1, e2)

Arguments

e1
object of class "Distribution"
e2
object of class "Distribution"

Value

  • A list containing the following components:
  • e1object of class "Distribution"; distribution 1
  • e2object of class "Distribution"; distribution 2
  • total.variation.distancetotal variation distance of e1 and e2

concept

distance

References

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

See Also

TotalVarDist-methods, ContaminationSize, KolmogorovDist, HellingerDist, Distribution-class

Examples

Run this code
TotalVarDist(Norm(), Gumbel())
TotalVarDist(Norm(), Td(10))
TotalVarDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100)) # mutually singular
TotalVarDist(Pois(10), Binom(size = 20))

Run the code above in your browser using DataCamp Workspace