# Total variation distance of probability measures

In probability theory, the total variation distance is a distance measure for probability distributions. It is an example of a statistical distance metric, and is sometimes called the statistical distance, statistical difference or variational distance.

## Definition

Consider a measurable space ${\displaystyle (\Omega ,{\mathcal {F}})}$ and probability measures ${\displaystyle P}$ and ${\displaystyle Q}$ defined on ${\displaystyle (\Omega ,{\mathcal {F}})}$. The total variation distance between ${\displaystyle P}$ and ${\displaystyle Q}$ is defined as:[1]

${\displaystyle \delta (P,Q)=\sup _{A\in {\mathcal {F}}}\left|P(A)-Q(A)\right|.}$

This is the largest absolute difference between the probabilities that the two probability distributions assign to the same event.

## Properties

The total variation distance is an f-divergence and an integral probability metric.

### Relation to other distances

The total variation distance is related to the Kullback–Leibler divergence by Pinsker’s inequality:

${\displaystyle \delta (P,Q)\leq {\sqrt {{\frac {1}{2}}D_{\mathrm {KL} }(P\parallel Q)}}.}$

One also has the following inequality, due to Bretagnolle and Huber[2] (see, also, Tsybakov[3]), which has the advantage of providing a non-vacuous bound even when ${\displaystyle D_{\mathrm {KL} }(P\parallel Q)>2}$:

${\displaystyle \delta (P,Q)\leq {\sqrt {1-e^{-D_{\mathrm {KL} }(P\parallel Q)}}}.}$

The total variation distance is half of the L1 distance between the probability functions: on discrete domains this is the distance between probability mass functions[4] ${\displaystyle \delta (P,Q)={\frac {1}{2}}\sum _{x}|P(x)-Q(x)|}$, The relationship holds more generally as well:[5] ${\displaystyle \delta (P,Q)={\frac {1}{2}}\int |p(x)-q(x)|\mathrm {d} x}$ when the distributions have standard probability density functions p and q, or the analogous distance between Radon-Nikodym derivatives with any common dominating measure. This result can be shown by noticing that the supremum in the definition is achieved exactly at the set where one distribution dominates the other.[6]

The total variation distance is related to the Hellinger distance ${\displaystyle H(P,Q)}$ as follows:[7]

${\displaystyle H^{2}(P,Q)\leq \delta (P,Q)\leq {\sqrt {2}}H(P,Q).}$

These inequalities follow immediately from the inequalities between the 1-norm and the 2-norm.

### Connection to transportation theory

The total variation distance (or half the norm) arises as the optimal transportation cost, when the cost function is ${\displaystyle c(x,y)={\mathbf {1} }_{x\neq y}}$, that is,

${\displaystyle {\frac {1}{2}}\|P-Q\|_{1}=\delta (P,Q)=\inf\{\mathbb {P} (X\neq Y):{\text{Law}}(X)=P,{\text{Law}}(Y)=Q\}=\inf _{\pi }\operatorname {E} _{\pi }[{\mathbf {1} }_{x\neq y}],}$

where the expectation is taken with respect to the probability measure ${\displaystyle \pi }$ on the space where ${\displaystyle (x,y)}$ lives, and the infimum is taken over all such ${\displaystyle \pi }$ with marginals ${\displaystyle P}$ and ${\displaystyle Q}$, respectively.[8]