# Wrapped distribution

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Wrapped_distribution
> Markdown URL: https://mediated.wiki/source/Wrapped_distribution.md
> Source: https://en.wikipedia.org/wiki/Wrapped_distribution
> Source revision: 1294930380
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Probability distribution on a hypersphere}}
In [probability theory](/source/probability_theory) and [directional statistics](/source/directional_statistics), a '''wrapped probability distribution''' is a continuous [probability distribution](/source/probability_distribution) that describes data points that lie on a unit [''n''-sphere](/source/n-sphere). In one dimension, a wrapped distribution consists of points on the [unit circle](/source/unit_circle). If <math>\phi</math> is a random variate in the interval <math>(-\infty,\infty)</math> with [probability density function](/source/probability_density_function) (PDF) <math>p(\phi)</math>, then <math>z = e^{i\phi}</math> is a circular variable distributed according to the wrapped distribution <math>p_{wz}(\theta)</math> and <math>\theta = \arg(z)</math> is an angular variable in the interval <math>(-\pi,\pi]</math> distributed according to the wrapped distribution <math>p_w(\theta)</math>.

Any probability density function <math>p(\phi)</math> on the line can be "wrapped" around the circumference of a circle of unit radius.<ref name="Mardia99">{{cite book |title=Directional Statistics |last=Mardia |first=Kantilal |author-link=Kantilal Mardia |author2=Jupp, Peter E.  |year=1999|publisher=Wiley |isbn=978-0-471-95333-3 }}</ref> That is, the PDF of the wrapped variable

:<math>\theta=\phi \mod 2\pi</math> in some interval of length <math>2\pi</math>

is
: <math>
p_w(\theta)=\sum_{k=-\infty}^\infty {p(\theta+2\pi k)}
</math>

which is a [periodic sum](/source/periodic_summation) of period <math>2\pi</math>. The preferred interval is generally <math>(-\pi<\theta\le\pi)</math> for which <math>\ln(e^{i\theta})=\arg(e^{i\theta})=\theta</math>.

==Theory==
In most situations, a process involving [circular statistics](/source/circular_statistics) produces angles (<math>\phi</math>) which lie in the interval <math>(-\infty,\infty)</math>, and are described by an "unwrapped" probability density function <math>p(\phi)</math>. However, a measurement will yield an angle <math>\theta</math> which lies in some interval of length <math>2\pi</math> (for example, 0 to <math>2\pi</math>). In other words, a measurement cannot tell whether the true angle <math>\phi</math> or a wrapped angle <math>\theta = \phi+2\pi a</math>, where <math>a</math> is some unknown integer, has been measured.

If we wish to calculate the [expected value](/source/expected_value) of some function of the measured angle it will be:

:<math>\langle f(\theta)\rangle=\int_{-\infty}^\infty p(\phi)f(\phi+2\pi a)d\phi</math>.

We can express the integral as a sum of integrals over periods of <math>2\pi</math>:

:<math>\langle f(\theta)\rangle=\sum_{k=-\infty}^\infty \int_{2\pi k}^{2\pi(k+1)} p(\phi)f(\phi+2\pi a)d\phi</math>.

Changing the variable of integration to <math>\theta'=\phi-2\pi k</math> and exchanging the order of integration and summation, we have

:<math>\langle f(\theta)\rangle= \int_0^{2\pi} p_w(\theta')f(\theta'+2\pi a')d\theta'</math>

where <math>p_w(\theta')</math> is the PDF of the wrapped distribution and <math>a'</math> is another unknown integer <math>(a'=a+k)</math>. The unknown integer <math>a'</math> introduces an ambiguity into the expected value of <math>f(\theta)</math>, similar to the problem of calculating [angular mean](/source/angular_mean). This can be resolved by introducing the parameter <math>z=e^{i\theta}</math>, since <math>z</math> has an unambiguous relationship to the true angle <math>\phi</math>:

:<math>z=e^{i\theta}=e^{i\phi}</math>.

Calculating the expected value of a function of <math>z</math> will yield unambiguous answers:

:<math>\langle f(z)\rangle= \int_0^{2\pi} p_w(\theta')f(e^{i\theta'})d\theta'</math>.

For this reason, the <math>z</math> parameter is preferred over measured angles <math>\theta</math> in circular statistical analysis. This suggests that the wrapped distribution function may itself be expressed as a function of <math>z</math> such that:

:<math>\langle f(z)\rangle= \oint p_{wz}(z)f(z)\,dz</math>

where <math>p_w(z)</math> is [defined](/source/Probability_density_function) such that <math>p_w(\theta)\,|d\theta|=p_{wz}(z)\,|dz|</math>. This concept can be extended to the multivariate context by an extension of the simple sum to a number of <math>F</math> sums that cover all dimensions in the feature space:
: <math>
p_w(\vec\theta)=\sum_{k_1,...,k_F=-\infty}^{\infty}{p(\vec\theta+2\pi k_1\mathbf{e}_1+\dots+2\pi k_F\mathbf{e}_F)}
</math>
where <math>\mathbf{e}_k=(0,\dots,0,1,0,\dots,0)^{\mathsf{T}}</math> is the <math>k</math>th Euclidean basis vector.

==Expression in terms of characteristic functions==
A fundamental wrapped distribution is the [Dirac comb](/source/Dirac_comb), which is a wrapped [Dirac delta function](/source/Dirac_delta_function):

:<math>\Delta_{2\pi}(\theta)=\sum_{k=-\infty}^{\infty}{\delta(\theta+2\pi k)}</math>.

Using the delta function, a general wrapped distribution can be written

:<math>p_w(\theta)=\sum_{k= -\infty}^{\infty}\int_{-\infty}^\infty p(\theta')\delta(\theta-\theta'+2\pi k)\,d\theta'</math>.

Exchanging the order of summation and integration, any wrapped distribution can be written as the convolution of the unwrapped distribution and a Dirac comb:

:<math>p_w(\theta)=\int_{-\infty}^\infty p(\theta')\Delta_{2\pi}(\theta-\theta')\,d\theta'</math>.

The Dirac comb may also be expressed as a sum of exponentials, so we may write:

:<math>p_w(\theta)=\frac{1}{2\pi}\,\int_{-\infty}^\infty p(\theta')\sum_{n=-\infty}^{\infty}e^{in(\theta-\theta')}\,d\theta'</math>.

Again exchanging the order of summation and integration:

:<math>p_w(\theta)=\frac{1}{2\pi}\,\sum_{n=-\infty}^{\infty}\int_{-\infty}^\infty p(\theta')e^{in(\theta-\theta')}\,d\theta'</math>.

Using the definition of <math>\phi(s)</math>, the [characteristic function](/source/Characteristic_function_(probability_theory)) of <math>p(\theta)</math> yields a [Laurent series](/source/Laurent_series) about zero for the wrapped distribution in terms of the characteristic function of the unwrapped distribution:

:<math>p_w(\theta)=\frac{1}{2\pi}\,\sum_{n=-\infty}^{\infty} \phi(n)\,e^{-in\theta} </math>

or

:<math>p_{wz}(z)=\frac{1}{2\pi}\,\sum_{n=-\infty}^{\infty} \phi(n)\,z^{-n} </math>

Analogous to linear distributions, <math>\phi(m)</math> is referred to as the characteristic function of the wrapped distribution (or more accurately, the characteristic [sequence](/source/sequence)).<ref name="Mardia72">{{Cite book|title=Statistics of Directional Data |last=Mardia |first=K. |year=1972 |publisher=Academic press |location=New York|isbn=978-1-4832-1866-3 |url=https://books.google.com/books?id=_pbiBQAAQBAJ}}
</ref> This is an instance of the [Poisson summation formula](/source/Poisson_summation_formula), and it can be seen that the coefficients of the [Fourier series](/source/Fourier_series) for the wrapped distribution are simply the coefficients of the [Fourier transform](/source/Fourier_transform) of the unwrapped distribution at integer values.

==Moments==
The moments of the wrapped distribution <math>p_w(z)</math> are defined as:

:<math>
\langle z^m \rangle = \oint p_{wz}(z)z^m \, dz
</math>.

Expressing <math>p_w(z)</math> in terms of the characteristic function and exchanging the order of integration and summation yields:

:<math>
\langle z^m \rangle = \frac{1}{2\pi}\sum_{n=-\infty}^\infty \phi(n)\oint z^{m-n}\,dz
</math>.

From the [residue theorem](/source/residue_theorem) we have

:<math>
\oint z^{m-n}\,dz = 2\pi \delta_{m-n}
</math>

where <math>\delta_k</math> is the [Kronecker delta](/source/Kronecker_delta) function. It follows that the moments are simply equal to the characteristic function of the unwrapped distribution for integer arguments:

:<math>
\langle z^m \rangle = \phi(m)
</math>.

== Generation of random variates ==

If <math>X</math> is a random variate drawn from a linear probability distribution <math>P</math>, then <math>Z=e^{i X}</math> is a circular variate distributed according to the wrapped <math>P</math> distribution, and <math>\theta=\arg(Z)</math> is the angular variate distributed according to the wrapped <math>P</math> distribution, with <math>-\pi < \theta \leq \pi</math>.

== Entropy ==
The [information entropy](/source/Entropy_(information_theory)) of a circular distribution with probability density <math>p_w(\theta)</math> is defined as:

:<math>H = -\int_\Gamma p_w(\theta)\,\ln(p_w(\theta))\,d\theta</math>

where <math>\Gamma</math> is any interval of length <math>2\pi</math>.<ref name="Mardia99"/> If both the probability density and its logarithm can be expressed as a [Fourier series](/source/Fourier_series) (or more generally, any [integral transform](/source/integral_transform) on the circle), the [orthogonal basis](/source/orthogonal_basis) of the series can be used to obtain a [closed form expression](/source/closed_form_expression) for the entropy.

The moments of the distribution <math>\phi(n)</math> are the Fourier coefficients for the Fourier series expansion of the probability density:

:<math>p_w(\theta)=\frac{1}{2\pi}\sum_{n=-\infty}^\infty \phi_n e^{-in\theta}</math>.

If the logarithm of the probability density can also be expressed as a Fourier series:

:<math>\ln(p_w(\theta))=\sum_{m=-\infty}^\infty c_m e^{im\theta}</math>

where

:<math>c_m=\frac{1}{2\pi}\int_\Gamma \ln(p_w(\theta))e^{-i m \theta}\,d\theta</math>.

Then, exchanging the order of integration and summation, the entropy may be written as:

:<math>H=-\frac{1}{2\pi}\sum_{m=-\infty}^\infty\sum_{n=-\infty}^\infty c_m \phi_n \int_\Gamma e^{i(m-n)\theta}\,d\theta</math>.

Using the orthogonality of the Fourier basis, the integral may be reduced to:

:<math>H=-\sum_{n=-\infty}^\infty c_n \phi_n</math>.

For the particular case when the probability density is symmetric about the mean, <math>c_{-m}=c_m</math> and the logarithm may be written:

:<math>\ln(p_w(\theta))= c_0 + 2\sum_{m=1}^\infty c_m \cos(m\theta)</math>

and

:<math>c_m=\frac{1}{2\pi}\int_\Gamma \ln(p_w(\theta))\cos(m\theta)\,d\theta</math>

and, since normalization requires that <math>\phi_0=1</math>, the entropy may be written:

:<math>H=-c_0-2\sum_{n=1}^\infty c_n \phi_n</math>.

==See also==
* [Wrapped normal distribution](/source/Wrapped_normal_distribution)
* [Wrapped Cauchy distribution](/source/Wrapped_Cauchy_distribution)
* [Wrapped exponential distribution](/source/Wrapped_exponential_distribution)

==References==
{{More footnotes|date=July 2011}}
<references/>
* {{Cite book|title=Statistics of Earth Science Data |last=Borradaile |first=Graham |year=2003 |publisher=Springer |isbn=978-3-540-43603-4 |url=https://books.google.com/books?id=R3GpDglVOSEC}}
* {{Cite book|title=Statistical Analysis of Circular Data |last=Fisher |first=N. I. |year=1996 |publisher=Cambridge University Press |isbn=978-0-521-56890-6 |url=https://books.google.com/books?id=IIpeevaNH88C}}

==External links==
* [http://www.codeproject.com/Articles/190833/Circular-Values-Math-and-Statistics-with-Cplusplus Circular Values Math and Statistics with C++11], A C++11 infrastructure for circular values (angles, time-of-day, etc.) mathematics and statistics

{{ProbDistributions|directional}}
{{Use dmy dates|date=August 2019}}

{{DEFAULTSORT:Wrapped Distribution}}
Category:Types of probability distributions
Category:Directional statistics

---
Adapted from the Wikipedia article [Wrapped distribution](https://en.wikipedia.org/wiki/Wrapped_distribution) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Wrapped_distribution?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
