Wrapping distributions around the unit circle

$\newcommand{\vp}{\varphi}$$\newcommand{\E}{\operatorname{E}}$$\newcommand{\Exp}{\operatorname{Exp}}$In this post I’ll take a look at wrapped distributions. If $X$ has a continuous distribution on $\mathbb R$ with Lebesgue pdf $f$, I will consider the result of wrapping this distribution around the unit circle. The most convenient way to work with this will be to use complex numbers and take $Y = e^{iX}$ as my circular random variable. I will use $\Theta = \operatorname{Arg} Y$ as the random angle with $\Pi := (-\pi, \pi]$ as the support. By construction $X\equiv \Theta \pmod{2\pi}$ so I can think of $\Theta$ as being $X$ after taking the quotient of the codomain $\mathbb R$ using the equivalence relation $a\sim b \iff a\equiv b \pmod{2\pi}$, and for each equivalence class (each class is countable so there are uncountably many) the value of $\Theta$ is the unique element of that equivalence class intersected with $\Pi$.

I’ll begin by working out the density $g$ of $\Theta$ in terms of $f$, and then I’ll connect the moments of $Y$ to the characteristic function of $X$ which I’ll denote by $\vp_X$. The remainder of the post will explore when the moments of $Y$, and in particular the first moment (which represents the balance point of the circular distribution), are purely real. A physical analogy I’ll be thinking of throughout is that the unit circle is like a piece of wire with varying mass given by the wrapped density, and the first moment of $Y$ is the balance point. The notation $I(\cdot)$ will be used for an indicator function.

In general for a complex number $z$ and $t\in\mathbb R$ the expression $z^t$ is multi-valued, but I’m restricting myself to the integral moments of $Y$ so I won’t have to worry about this.

Density of $\Theta$

Result 1: for $\theta\in\Pi$ the density on the unit circle at that angle is given by
$$
g(\theta) = \sum_{n \in \mathbb Z} f(\theta + 2\pi n)
$$
Pf: I’ll do this by directly verifying that this is the correct Radon-Nikodym derivative (RND) of $P_\Theta$ w.r.t. the Lebesgue measure on $\Pi$ (or at least a version of it, due to possible modifications on null sets). Let $A\subseteq\Pi$ be Borel and consider the set function
$$
Q(A) := \int_A\sum_{n \in \mathbb Z} f(\theta + 2\pi n)\,\text d\lambda(\theta).
$$
By assumption $f$ is a valid RND so it is nonnegative. By Tonelli’s theorem I can then exchange the infinite sum and integral to get
$$
Q(A) = \sum_{n\in\mathbb Z} \int_A f(\theta + 2\pi n)\,\text d\lambda(\theta).
$$
For each $n\in\mathbb Z$ I have
$$
\int_A f(\theta + 2\pi n)\,\text d\lambda(\theta) = \int_{A + 2\pi n} f\,\text d\lambda \\
= P(X \in A + 2\pi n).
$$
Since $A\subseteq \Pi$ for every $n\in\mathbb Z$ the translates $A + 2\pi n$ are disjoint so
$$
Q(A) = \sum_{n\in\mathbb Z} P(X \in A + 2\pi n) \\
= P((X\text{ mod } 2\pi) \in A)
$$
therefore
$$
Q(A) = P_\Theta(A)
$$
for an arbitrary Borel $A$. This means $Q=P_\Theta$, and $g$ is therefore the almost surely unique RND $\frac{\text dP_\Theta}{\text d\lambda}$.

$\square$

Intuitively this makes sense because it’s just saying that the density of a particular angle of $Y$ is the sum of the densities of all unrolled angles $X$ that are equivalent modulo $2\pi$.

Introducing CFs

Using the transformation $Y = e^{iX}$ it’s clear that
$$
\E(Y^k) = \int_{\mathbb R}e^{ikx}f(x)\,\text dx = \vp_X(k)
$$
so the moments of $Y$ can be determined by evaluating the characteristic function of $X$. $x\mapsto e^{ikx}$ is bounded so these expectations exist and are finite for all $k\in\mathbb N$.

This view lets me get some intuition for what particular values of $\vp_X$ mean. I have a random variable $Y$ on the unit circle, so $\vp_X(1) = \E(Y)$ gives the physical balance point of the weighted circle corresponding to the wrapped distribution. And since $Y^k = e^{ikX}$, I can interpret higher moments as the balance point when I first use the transformation $X \mapsto kX$, so I’m effectively first stretching $X$ and then finding the balance point.

I’ll begin with a couple examples.

Result 2.1: if $X\sim\text{Unif}(a,b)$ with $b\equiv a \pmod{2\pi}$ then $\Theta \sim \text{Unif}(-\pi, \pi]$.

Pf: I can use the summation formula in Result 1 to directly compute the density of a particular angle. By assumption I have $b = a + 2\pi n$ for some $n \geq 1$ so
$$
\begin{aligned}g(\theta) &= I(-\pi < \theta \leq \pi)\sum_{k\in\mathbb Z} f_X(\theta + 2\pi k) \\&
= \frac{I(-\pi < \theta \leq \pi)}{2\pi n}\sum_{k\in\mathbb Z} I(a \leq \theta + 2\pi k \leq a + 2\pi n) .\end{aligned}
$$
For the summation there, this is counting the number of translations of $\theta$ that land in $[a,b]$. I won’t worry about possibly double-counting an endpoint (due to being open or closed) because that’s a set of measure zero and densities can be modified on null sets without affecting anything. For an arbitrary $\theta \in (-\pi, \pi)$ I can add or subtract $2\pi$ until it first lands in $[a,b]$ (and $b-a \geq 2\pi$ so this is guaranteed to be possible), and then I can add $2\pi$ to $\theta$ $n-1$ more times without it leaving $[a,b]$, which shows that $\theta$ lands in $[a,b]$ $n$ times. Thus
$$
g(\theta) = \frac{1}{2\pi}I(-\pi < \theta \leq \pi)
$$
therefore $\Theta$ is uniform over its support.

$\square$

This means that physically I can think of the distribution of $Y$ in this case as being a wire of constant density looped around the origin. Quantities like $\E(Y^k)$ correspond to first stretching the angles involved and then finding the new balance point. But in this case with uniform mass it seems intuitive that the balance point will always remain at the origin unless $t=0$, in which case everything collapses to $1+0i$ and that is also the balance point. I’ll confirm this using characteristic functions in the next result.

Result 2.2: For $X\sim\text{Unif}(a,b)$ if $b\equiv a \pmod{2\pi}$ then $\vp_X(t) = I(t = 0)$.

Pf: For $t \neq 0$ the CF of $X$ is given by
$$
\vp_X(t) = \frac{1}{b-a}\int_a^b e^{itx}\,\text dx \\
= \frac {e^{itb} – e^{ita}}{it(b-a)}
$$
($x \mapsto e^{itx}$ is analytic on all of $\mathbb C$ so I can safely use the fundamental theorem of calculus here). At $t=0$ I have $e^{itX} = 1$ so $\vp_X(0) = 1$ which is also the limit of the above expression as $t\to 0$ (which is good to see since I know $\vp_X$ is continuous). Thus
$$
\vp_X(t) = \begin{cases}
\frac {e^{itb} – e^{ita}}{it(b-a)} & t\neq 0 \\
1 & t = 0
\end{cases}.
$$
If $b\equiv a\pmod{2\pi}$ then $b = a + 2\pi n$ for some positive $n \in \mathbb Z$ so for $t\neq 0$ I have
$$
\vp_X(t) = \frac{e^{it(a+2\pi n) }- e^{ita}}{2it\pi n} = \frac{e^{ita }- e^{ita}}{2it\pi n} = 0 \\
\implies \vp_X(t) = I(t=0)
$$
as desired. This confirms my intuition from Result 2.1 that if $\Theta \sim \text{Unif}(-\pi, \pi]$ then $Y^t$ balances at the origin for any $t\neq 0$.

$\square$

Result 2.3: If for $a>0$ $X\sim\text{Unif}(-a, a)$ then $\vp_X(t)$ is also real-valued for all $t\in\mathbb R$.

Pf: I know $\vp_X(0)$ is always purely real so I’ll assume $t\neq 0$ for this. From Result 2.2 I have
$$
\vp_X(t) = \frac{e^{ita}-e^{-ita}}{2ita} = -\frac{i}{ta}\cdot \frac{e^{ita}-e^{-ita}}{2}.
$$
Noting that $e^{-ita}$ is the complex conjugate of $e^{ita}$,
$$
\frac{e^{ita}-e^{-ita}}{2} = \frac{e^{ita} – \overline{e^{ita}}}{2} = \Im(e^{ita}).
$$
This means
$$
\vp_X(t) = -\frac{i}{ta}\cdot \Im(e^{ita})
$$
which is the product of two purely imaginary numbers and is therefore purely real.

$\square$

This is interesting because for almost all $a>0$ $Y$ will not be uniform on the unit circle, but it still has a real balance point for any moment. Intuitively it seems like this comes from the symmetry of the problem: since there is an equal amount of mass on either side of $\theta=0$, the imaginary parts cancel out. And for any $k \in \mathbb N^+$ $Y^k$ will stretch the distribution but won’t affect the symmetry so I’ll still get this canceling.

This leads me to my main results:

Result 3: if $X$ is symmetric around a point $\mu$ and $\mu \equiv 0 \pmod{\pi}$ then $\vp_X(1) \in \mathbb R$.

Pf: I can do this by showing $\E\left[\Im(Y)\right] = 0$. Using Euler’s formula,
$$
Y = e^{iX} = \cos(X) + i\sin(X)
$$
so
$$
\E\left[\Im(Y)\right] = \E\left[\sin (X)\right] = \int_{\mathbb R} \sin (x) f(x)\,\text dx.
$$
$\sin$ is measurable and bounded so I don’t need to worry about this integral existing. By assumption $f$ is symmetric around a point $\mu$ and $\mu\equiv 0 \pmod {\pi}$. Let $u = x – \mu$ so
$$
\int_{\mathbb R} \sin (x) f(x)\,\text dx = \int_{\mathbb R} \sin(u + \mu) f(u + \mu)\,\text du.
$$
By periodicity $\sin(u + \mu) = \pm \sin(u)$ (the sign depending on if $\mu$ is additionally congruent to $0$ modulo $2\pi$) and $u\mapsto \sin(u)$ is an odd function. Additionally, $f$ is symmetric around $\mu$ so $f(\mu + u) = f(\mu – u)$ which means $u\mapsto f(u+\mu)$ is even. Together this makes $u \mapsto \sin(u + \mu) f(u + \mu)$ an odd function therefore, since $\E(\Im(Y))$ is guaranteed to be well-defined, I know $\E(\Im(Y)) = 0$ as desired.

$\square$

Result 4: if the distribution of $X$ is symmetric about $0$ (i.e. $f$ is even) then $\vp_X$ is purely real.

Pf: I have
$$
\vp_X(t) = \int_{\mathbb R} e^{itx}f(x)\,\text dx = \int_{\mathbb R} \cos(tx)f(x)\,\text dx + i\int\sin(tx)f(x)\,\text dx.
$$
Let $h(x) = \sin(tx)f(x)$ and note that $h(-x) = -\sin(tx)f(x)$ by $\sin$ being odd and $f$ even. This immediately shows that $\Im(\vp_X(t)) = 0$.

Alternatively I could have done this by noting that $\overline{\vp_X(t)}$, the complex conjugate of $\vp_X(t)$, is
$$
\begin{aligned}\overline{\vp_X(t)} &= \int_{\mathbb R} \cos(tx)f(x)\,\text dx – i\int\sin(tx)f(x)\,\text dx \\&
= \int_{\mathbb R} \cos(-tx)f(x)\,\text dx + i\int\sin(-tx)f(x)\,\text dx \\&
= \int_{\mathbb R} e^{-itx}f(x)\,\text dx \\&
= \int_{\mathbb R} e^{itu} f(u)\,\text du = \vp_X(t)\end{aligned}
$$
where I again used $u = -x$, and the only numbers that equal their conjugate are purely real.

$\square$

Another way to think of this is that when $\vp_X$ is purely real, then $f$ can be described in terms of the basis $\{x\mapsto \cos(tx) : t\in\mathbb R\}$, and all those functions are symmetric so the symmetry of $f$ makes sense.

I’ll finish by looking at a couple more examples.

Gaussian and Cauchy case

If $X\sim\mathcal N(\mu,\sigma^2)$ then it is known that
$$
\vp_X(t) = \exp(i\mu t – \sigma^2 t^2/2) = \underbrace{e^{-\sigma^2 t^2/2}}_{\text{radius}}\underbrace{e^{i\mu t}}_{\text{angle}}.
$$
This is very interesting as it shows that the scale $\sigma$ controls the radius of the balance point while the mean $\mu$ controls the angle, and the two don’t interact.

I can immediately see that if $\mu \equiv 0 \pmod \pi$ then when $t\in\mathbb Z$ I’ll have $\mu t\equiv 0 \pmod \pi$ as well so $\vp_X(t)$ will be purely real. And clearly $\mu=0$ implies $\vp_X(t)$ is real for all $t\in\mathbb R$.

For $\sigma$, this form shows explicitly that the radius never exceeds $1$ which reflects how the balance point of any moment always has to be within the circle or on it. As $\sigma \to 0$ the radius approaches $1$ since $Y$ is likely to be closer and closer to just $e^{i\mu}$ and the balance point is closer and closer to being on the circle (and its value will also be $e^{i\mu}$). Similarly, as $\sigma \to \infty$ the radius approaches $0$ since the mass is spread more and more evenly over the circle and so the balance point approaches the origin.

Similarly, if $X\sim\text{Cauchy}(\mu,\sigma)$ so
$$
f(x\mid \mu,\sigma) = \frac{1}{\pi\sigma\left[1 + \left(\frac{x-\mu}{\sigma}\right)^2\right]}
$$
then it can be shown that
$$
\vp_X(t) = \exp(i\mu t – \sigma|t|)
$$
and all the above comments hold. The lack of differentiability at $t=0$ reflects how $X$ does not have a defined mean.

Shifted exponential

My last example will show that there are distributions with a real balance point that are not symmetric about any point. Let $X \sim \Exp(\lambda)$ so $f(x\mid\lambda) = \frac 1\lambda e^{-x/\lambda} I(x\geq 0)$. It is easy to show that
$$
\vp_X(t) = \frac{\lambda}{\lambda – it}.
$$
I can put $\vp_X$ in $a+bi$ form as
$$
\vp_X(t) = \frac{\lambda}{\lambda – it} \cdot \frac{\lambda + it}{\lambda + it} = \frac{\lambda(\lambda+it)}{\lambda^2+t^2} \\
= \frac{\lambda^2}{\lambda^2 + t^2} + \frac{\lambda t}{\lambda^2 + t^2}i.
$$
This will be purely real if and only if $\frac{\lambda t}{\lambda^2 + t^2} = 0$. For the first moment of $Y$ I have $t=1$ and by assumption $\lambda > 0$ so the imaginary part of $\vp_X(1)$ never can be zero. This shows that when an exponential distribution is wrapped around the unit circle the “balance point” is never on the real axis (and in fact is always above the axis since the imaginary part is necessarily positive, which makes sense since the bulk of the mass of $f$ ends up in the first quadrant).

But I can get a real balance point if I first translate $X$, so now I’ll consider $Y = \exp(i(X – c))$ for some constant $c\in\mathbb R$. This leads to
$$
\vp_Y(t) = \E(e^{it(X-c)}) = e^{-itc}\vp_X(t).
$$
I will now put $\vp_X$ in polar form. Since I already had it in $a+bi$ form I can use the fact that $r = \sqrt{a^2+b^2}$ and $\theta = \arctan(b/a)$ so
$$
r^2 = \left(\frac{\lambda^2}{\lambda^2 + t^2}\right)^2 + \left(\frac{\lambda t}{\lambda^2 + t^2}\right)^2 \\
\implies r = \frac{\lambda \sqrt{\lambda^2 + t^2}}{\lambda^2 + t^2} = \frac{\lambda}{\sqrt{\lambda^2 + t^2}}.
$$
and
$$
\theta = \arctan\left(t/\lambda\right)
$$
so all together
$$
\vp_X(t) = \frac{\lambda}{\sqrt{\lambda^2 + t^2}} e^{i \arctan\left(t/\lambda\right)}.
$$
This means
$$
\vp_Y(t) = \frac{\lambda}{\sqrt{\lambda^2 + t^2}} \exp\left(i\left[\arctan\left(t/\lambda\right) – tc\right]\right).
$$
This will be purely real if and only if
$$
\arctan\left(t/\lambda\right) – tc \equiv 0 \pmod \pi \\
\iff c \equiv t^{-1}\arctan(t / \lambda) \pmod \pi
$$
For the first moment of $Y$ I’ll have $t=1$ so this means any translation of the form $\arctan(1/\lambda) + \pi n$ for $n\in\mathbb Z$ will work.

But I can also see that there is no translation that will make all of the moments of $Y$ real: I’d need one particular $c$ such that
$$
c \equiv k^{-1}\arctan(k / \lambda) \pmod \pi \hspace{4mm}\forall k \in \mathbb N^+
$$
In particular, this implies
$$
\arctan(1/\lambda)\equiv2\arctan(2/\lambda)\pmod \pi
$$
Let $h(\lambda) = \arctan(1/\lambda) – 2\arctan(2/\lambda)$. As $\lambda\to 0$ I’ll have $h(\lambda)\to\frac{\pi}{2} – \pi = -\frac \pi2$, and $h(\lambda)\to 0$ as $\lambda\to\infty$. Furthermore, using the fact that $\frac{\text d}{\text dx}\arctan(x) = \frac{1}{x^2+1}$, I have
$$
\begin{aligned}h'(\lambda) &= -\frac{\lambda^{-2}}{\lambda^{-2} + 1} + \frac{4\lambda^{-2}}{4\lambda^{-2} + 1} \\&
= \frac{4}{4+\lambda^2} – \frac{1}{1+\lambda^2} \\&
= \frac{4(1+\lambda^2) – 4-\lambda^2}{(4+\lambda^2)(1+\lambda^2)} \\&
= \frac{3\lambda^2}{(4+\lambda^2)(1+\lambda^2)}\end{aligned}
$$
which is strictly positive for $\lambda > 0$. This means that $h$ is strictly increasing from $-\frac \pi 2$ to $0$ without ever attaining that value of $0$. Thus $h$ never hits an element of $\{n\pi : n \in \mathbb Z\}$ and this means that there is no translation $c$ such that $Y$ has a purely real first and second moment.

I’ll visualize what I just found here. Letting $X\sim\Exp(1)$ I can take $c = \arctan(1) = \frac \pi 4$ so $\exp(i(X – \frac \pi 4))$ will have a real balance point. The diagram below shows this. Red indicates the highest density and blue the lowest. The $\times$ symbol shows the balance point. Note that the distribution’s high density region begins at $\theta = -\frac \pi 4$ which matches the translation.

Shifted exponential wrapped around the unit circle

 

Leave a Reply

Your email address will not be published. Required fields are marked *