Marginal Distributions obtained by restricting a 2D Gaussian to a circle

geometric-probabilityprobabilityprobability distributionsstatistics

Suppose I have a 2D Gaussian
$$
f(x, y) = \frac{1}{2\pi\,\sqrt{\text{det}(\Sigma)}}\exp\left\{-\frac{1}{2}(\boldsymbol{x}- \boldsymbol{\mu})^\top \Sigma^{-1} (\boldsymbol{x}- \boldsymbol{\mu})\right\} \qquad \text{with } \boldsymbol{\mu}=(\mu_x, \mu_y)^\top
$$

and then I restrict it to be on a circle. For simplicity, I assume the circle is centered at the mean of the Gaussian
$$
\mathcal{C}=\left\{(x, y)\in \mathbb{R}^2\, :\, (x – \mu_x)^2 + (y – \mu_y)^2 = 1\right\}
$$

What does the marginal distributions become? Here's a short picture of what I mean:

  • First, we have a 2D Gaussian, denoted here by light grey contours
  • Then we restrict the distribution to only take values on the unit circle (blue)
  • Finally, we marginalize on the x and y axis.

enter image description here

I have seen here that maybe the distribution on the circle is a Bingham distribution but that's as far as I can go. Any hint?

Following the Answer

I think the idea is that if we have a point $(x, y)\in \mathbb{R}^2$ then we can map this to be on the unit circle centred at the origin using the mapping
$$
g:\mathbb{R}^2 \to \mathbb{R}^2 \qquad (x, y) \longmapsto \left(\frac{x}{\sqrt{x^2+y^2}}, \frac{y}{\sqrt{x^2+y^2}}\right)
$$

The Jacobian of this transformation is given by
$$
J_g(x, y) =
\begin{pmatrix}
\frac{y^2}{(x^2+y^2)^{\frac{3}{2}}} & – \frac{xy}{(x^2+y^2)^{\frac{3}{2}}} \\
– \frac{xy}{(x^2+y^2)^{\frac{3}{2}}} & \frac{x^2}{(x^2+y^2)^{\frac{3}{2}}}
\end{pmatrix} = \begin{pmatrix} \end{pmatrix}
$$

Its determinant is, unfortunately, zero
$$
\text{det}(J_g(x, y)) = \frac{x^2y^2}{(x^2+y^2)^{3}} – \frac{x^2y^2}{(x^2+y^2)^{3}} = 0
$$

Since what we want is the distribution of
$$
u = \frac{x}{\sqrt{x^2+y^2}}
$$

we now instead consider a different function:
$$
g_2:\mathbb{R}^2\to \mathbb{R}^2 \qquad (x, y)\mapsto \left(\frac{x}{\sqrt{x^2+y^2}}, y\right)
$$

This function does not map $\mathbb{R}^2$ into the unit circle centred at the origin. However, conveniently, its first coordinate is the same as the one we want to find the distribution of. Our goal is then this:

  • Use the change of variable formula to find the joint distribution of
    $$
    (u, v) = \left(\frac{x}{\sqrt{x^2+y^2}}, y\right)
    $$
  • Marginalize over $v$ to obtain the distribution for $u$
    $$
    p(u) = \int p(u, v) dv
    $$

The Jacobian of this transformation is
$$
J_{g_2}(x, y) = \begin{pmatrix}
\frac{y^2}{(x^2+y^2)^{\frac{3}{2}}} & – \frac{xy}{(x^2+y^2)^{\frac{3}{2}}} \\
0 & 1
\end{pmatrix}
$$

It's determinant is
$$
\text{det}(J_{g_2}(x, y)) = \frac{y^2}{(x^2+y^2)^{\frac{3}{2}}}
$$

The change of variable formula then tells us
$$
\begin{align}
f_{U\times V}(u, v)
&= f_{X\times Y}(g_2^{-1}(u, v)) \cdot |\text{det}(J_{g_2}(x, y)|^{-1}_{(x, y) = g_2^{-1}(u, v)}
\end{align}
$$

One can easily find $g_2^{-1}(u, v)$ since $y = v$ and
$$
u^2 = \frac{x^2}{x^2+y^2} \quad \implies \quad u^2(x^2 + v^2) = x^2 \quad \implies \quad x^2 = \frac{u^2v^2}{1 – u^2}\quad \implies \quad x = \frac{|uv|}{(1 – u^2)^{\frac{1}{2}}}
$$

Pluggin this into the Jacobian we get
$$
|\text{det}(J_{g_2})(x, y)|_{(x, y) = g_2^{-1}(u,v)} = \frac{y^2}{(x^2+y^2)^{\frac{3}{2}}} = \frac{(1 – u^2)^{\frac{3}{2}}}{|v|}
$$

Thefore the joint distribution on $(u, v)$ is
$$
f_{U\times V}(u, v) = f_{X\times Y}\left(\frac{|uv|}{(1 – u^2)^{\frac{1}{2}}}, v\right) \frac{|v|}{(1 – u^2)^{\frac{3}{2}}}
$$

Since $(x, y) \mapsto \left(\frac{x}{\sqrt{x^2+y^2}}, y\right)$ we can see that this distribution is defined over $[-1, 1]\times \mathbb{R}$. Now we can perform the second step and marginalize with respect to $v$
$$
\begin{align}
f_U(u)
&= \int_{\mathbb{R}} f_{U\times V}(u, v) dv \\
&= \int_{\mathbb{R}} f_{X\times Y}\left(\frac{|uv|}{(1 – u^2)^{\frac{1}{2}}}, v\right) \frac{|v|}{(1 – u^2)^{\frac{3}{2}}} dv
\end{align}
$$

Consider the bivariate normal distribution
$$
{\displaystyle f_{X\times Y}(x,y)={\frac {1}{2\pi \sigma _{X}\sigma _{Y}{\sqrt {1-\rho ^{2}}}}}\mathrm {e} ^{-{\frac {1}{2(1-\rho ^{2})}}\left[({\frac {x-\mu _{X}}{\sigma _{X}}})^{2}-2\rho ({\frac {x-\mu _{X}}{\sigma _{X}}})({\frac {y-\mu _{Y}}{\sigma _{Y}}})+({\frac {y-\mu _{Y}}{\sigma _{Y}}})^{2}\right]}}
$$

Choosing $\Sigma = I_2$ (i.e. $\sigma_x = \sigma_y = 1$ and $\rho=0$) and centered at $\mu = (0, 0)$ we get
$$
f_{X\times Y}(x,y)=\frac{1}{2\pi}\exp\left\{-\frac{\left(x^2+y^2\right)}{2}\right\}
$$

Now plugging in
$$
x^2 + y^2 = \frac{v^2}{1 – u^2}
$$

we obtain
$$
f_{X\times Y}(g_2^{-1}(u, v)) = \frac{1}{2\pi}\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\}
$$

Marginalizing we get
$$
\begin{align}
f_U(u)
&= \int_{\mathbb{R}} \frac{1}{2\pi}\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\} \frac{|v|}{(1 – u^2)^{\frac{3}{2}}} dv \\
&= \frac{1}{2\pi \sqrt{1 – u^2}} \int_{\mathbb{R}}\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\} \frac{|v|}{(1 – u^2)} dv \\
&= – \frac{1}{2\pi \sqrt{1 – u^2}} \int_{-\infty}^{\infty} – \frac{|v|}{(1 – u^2)}\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\} dv \\
&= -\frac{1}{\pi\sqrt{1-u^2}} \int_{0}^{\infty} – \frac{|v|}{(1 – u^2)}\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\} dv && \text{even}\\
&= -\frac{1}{\pi\sqrt{1-u^2}}\left[\exp\left\{-\frac{v^2}{2(1 – u^2)}\right\}\right]_0^{\infty} \\
&= -\frac{1}{\pi\sqrt{1-u^2}}\left[0 – 1\right] \\
&= \frac{1}{\pi\sqrt{1-u^2}}
\end{align}
$$

Best Answer

I assume that $\mu_x=\mu_y=0$ for simplicity. The joint pdf of $U:=X/\sqrt{X^2+Y^2}$ and $V:=Y$ is given by \begin{align} f_{U,V}(u,v)&=\frac{f_{X,Y}(x(u,v),y(u,v))}{|\partial (u,v)/\partial(x,y)|_{x=u|v|/(1-u^2)^{1/2},y=v}} \\ &=f_{X,Y}\!\left(u|v|/(1-u^2)^{1/2},v\right)\times\frac{|v|}{(1-u^2)^{3/2}} \end{align} over $(-1,1)\times\mathbb{R}$. Then the marginal density of $U$ is $$ f_U(u)=\int_{-\infty}^{\infty}f_{X,Y}\!\left(u|v|/(1-u^2)^{1/2},v\right)\times\frac{|v|}{(1-u^2)^{3/2}}\, dv. $$ For example, when $\Sigma=I_2$, $$ f_{U}(u)=\frac{1}{\pi\sqrt{1-u^2}}. $$