In statistics, probability theory, and information theory, a statistical distance quantifies the distance between two statistical objects, which can be two random variables, or two probability distributions or samples, or the distance can be between an individual sample point and a population or a wider sample of points.

A distance between populations can be interpreted as measuring the distance between two probability distributions and hence they are essentially measures of distances between probability measures. Where statistical distance measures relate to the differences between random variables, these may have statistical dependence, and hence these distances are not directly related to measures of distances between probability measures. Again, a measure of distance between random variables may relate to the extent of dependence between them, rather than to their individual values.

Statistical distance measures are not typically metrics, and they need not be symmetric. Some types of distance measures, which generalize squared distance, are referred to as (statistical) divergences.

## Terminology

Many terms are used to refer to various notions of distance; these are often confusingly similar, and may be used inconsistently between authors and over time, either loosely or with precise technical meaning. In addition to "distance", similar terms include deviance, deviation, discrepancy, discrimination, and divergence, as well as others such as contrast function and metric. Terms from information theory include cross entropy, relative entropy, discrimination information, and information gain.

## Distances as metrics

### Metrics

A metric on a set X is a function (called the distance function or simply distance) d : X × XR+ (where R+ is the set of non-negative real numbers). For all x, y, z in X, this function is required to satisfy the following conditions:

1. d(x, y) ≥ 0     (non-negativity)
2. d(x, y) = 0   if and only if   x = y     (identity of indiscernibles. Note that condition 1 and 2 together produce positive definiteness)
3. d(x, y) = d(y, x)     (symmetry)
4. d(x, z) ≤ d(x, y) + d(y, z)     (subadditivity / triangle inequality).

### Generalized metrics

Many statistical distances are not metrics, because they lack one or more properties of proper metrics. For example, pseudometrics violate property (2), identity of indiscernibles; quasimetrics violate property (3), symmetry; and semimetrics violate property (4), the triangle inequality. Statistical distances that satisfy (1) and (2) are referred to as divergences.

## Statistically close

The variation distance of two distributions $X$ and $Y$ over a finite domain $D$ , (often referred to as statistical difference or statistical distance in cryptography) is defined as

$\Delta (X,Y)={\frac {1}{2))\sum _{\alpha \in D}|\Pr[X=\alpha ]-\Pr[Y=\alpha ]|$ .

We say that two probability ensembles $\{X_{k}\}_{k\in \mathbb {N} )$ and $\{Y_{k}\}_{k\in \mathbb {N} )$ are statistically close if $\Delta (X_{k},Y_{k})$ is a negligible function in $k$ .