Probability Distributions – Issues in Derivation Using Confluent Hypergeometric Function

hypergeometric functionimproper-integralsprobability distributionsspheres

Edit:

I managed to find the integral representations to solve the integral, but I am getting the wrong answer. So, I must be doing something wrong. It is probably a silly mistake. The steps
are as follows:

  1. Start from the Gaussian integral and expand to get the integral in the first link

\begin{align}
\mathbb{E}\left[ \frac{x \cdot \mu}{\|x\| \|\mu\|}\right] &=
\frac{1}{(2\pi \sigma^2)^{\frac{n}{2}}} \int_{\mathbb{R}^n}
e^{-\frac{1}{2\sigma^2}(x-\mu)^T(x-\mu)} \frac{x \cdot \mu}{\|x\| \|\mu\|} dx = \nonumber \\
&\quad \frac{1}{(2\pi \sigma^2)^{\frac{n}{2}}} e^{-\frac{\mu^2}{2\sigma^2}}
\int_{0}^{\infty} dr \int_{0}^{\pi } r \mathrm{A}_{n-2}(r\sin(\theta))
e^{-\frac{r^2}{2\sigma^2}} e^{\frac{r\|\mu\|}{\sigma^2}\cos(\theta)}
\cos(\theta) d\theta
\end{align}

where $\mathrm{A}_{n-2}(r\sin(\theta)) = \frac{2\pi^{(n-1)/2}}{\Gamma\left(\frac{n-1}{2}\right)}\,r^{n-2} \sin^{n-2}(\theta)$ is the area of the $n-2$ sphere of radius $r\sin(\theta)$.

  1. Use the subtitution and integral representation suggested in the answer by Roland. Substituting $\cos(\theta)=z$,
    $\sin^{n-2}(\theta)=(1-z^2)^{\frac{n-2}{2}}$ and
    $d\theta = -(1-z^2)^{-\frac{1}{2}} dz$

\begin{align}
\int_{1}^{-1} – z e^{\left(\frac{r\|\mu\|}{\sigma^2}\right)z}
(1-z^2)^{\frac{n-2}{2}-\frac{1}{2}} dz = \\
\quad \frac{\sqrt{\pi}}{2} \Gamma\left( \frac{n-1}{2} \right) \frac{\|\mu\| r}{\sigma^2}
{}_0F_1\left(;\frac{n}{2}+1; \left( \frac{\|\mu\| r}{2\sigma^2}\right)^2 \right)
\end{align}

  1. Get all terms that don't depend on $r$ outside of the integral, and simplify.

\begin{align}
\frac{1}{(2\sigma^2)^{\frac{n}{2}}} e^{-\frac{\|\mu\|^2}{2\sigma^2}}
\frac{\|\mu\|}{\sigma^2}
\int_{0}^{\infty} r^n e^{-\frac{r^2}{2\sigma^2}}
{}_0F_1\left(;\frac{n}{2}+1; \left( \frac{\|\mu\| r}{2\sigma^2}\right)^2 \right) dr
\end{align}

  1. Substitute $z=\frac{r^2}{2\sigma^2}$, which implies $r^n=2^{n/2}z^{n/2}\sigma^n$, and $dr=\frac{\sigma}{\sqrt{2z}}dz$ and simplify

\begin{align}
\frac{1}{(2\sigma^2)^{\frac{1}{2}}} e^{-\frac{\|\mu\|^2}{2\sigma^2}} \|\mu\|
\int_{0}^{\infty} z^{\frac{n}{2}-\frac{1}{2}} e^{-z}
{}_0F_1\left(;\frac{n}{2}+1; \frac{\mu^2}{2\sigma^2}z \right) dz
\end{align}

  1. Use the integral representation ${}_1F_1(a;b;z)\Gamma(a) = \int_{0}^{\infty} e^{-t} t^{a-1} {}_0F_1\left(;b;zt\right)dt$ to evaluate the integral

\begin{equation}
\frac{1}{(2\sigma^2)^{\frac{1}{2}}} e^{-\frac{\|\mu\|^2}{2\sigma^2}}
\|\mu\| \Gamma\left(\frac{n+1}{2} \right)
{}_1F_1\left(\frac{n+1}{2}; \frac{n}{2}+1; \frac{\|\mu\|^2}{2\sigma^2}\right)
\end{equation}

  1. Use Kummer's transformation to get rid of the $e^{-\frac{\|\mu\|^2}{2\sigma^2}}$ term

\begin{equation}
\frac{1}{(2\sigma^2)^{\frac{1}{2}}}
\|\mu\| \Gamma\left(\frac{n+1}{2} \right)
{}_1F_1\left(\frac{1}{2}; \frac{n}{2}+1; -\frac{\|\mu\|^2}{2\sigma^2}\right)
\end{equation}

However, this is different from the correct answer below, which is given in the original link:

\begin{equation}
\mathbb{E}\left[ \frac{x}{\|x\|}\right] = \frac{1}{(2\sigma^2)^{\frac{1}{2}}}
\frac{\Gamma\left(\frac{n+1}{2} \right)}{\Gamma\left(\frac{n}{2}+1 \right)}
{}_1F_1\left(\frac{1}{2}; \frac{n}{2}+1; -\frac{\|\mu\|^2}{2\sigma^2}\right) \mu
\end{equation}

which implies

\begin{equation}
\mathbb{E}\left[ \frac{x \cdot \mu}{\|x\| \|\mu\|}\right] = \frac{1}{(2\sigma^2)^{\frac{1}{2}}}
\frac{\Gamma\left(\frac{n+1}{2} \right)}{\Gamma\left(\frac{n}{2}+1 \right)} \|\mu\|
{}_1F_1\left(\frac{1}{2}; \frac{n}{2}+1; -\frac{\|\mu\|^2}{2\sigma^2}\right)
\end{equation}

Thus, I am missing a $\frac{1}{\Gamma\left(\frac{n}{2}+1\right)}$ factor, but I can't see what I'm doing wrong. I'd really appreciate help spotting the error.

My guess is that the problem is in step 2. I think that the integral representation may be missing some $\Gamma$ factor. I suppose that the answer below used some trigonometric identity to be able to use some representation from this list, but I can't tell what it is.


Original question:

In this answer, someone provided the following closed form equation for the expectation of a projected normal distribution:

$$
\mathbb E\left( \frac{X}{||X||}\right) = \frac{\Gamma\left(\frac{n}{2}+1-\frac{1}{2}\right)}{(2\sigma^2)^{1/2}\Gamma\left(\frac{n}{2}+1\right)}{}_1F_1\left(\frac{1}{2};\frac{n+2}{2};-\frac{|\mu|^2}{2\sigma^2}\right)\,\mu,\tag{$\ast$}
$$

where $X \sim \mathcal{N}(\mu, \sigma^2 I)$ and ${}_1F_1(a;b;z)$ is Kummer's confluent hypergeometric function. Simulations show the formula to work.

As an intermediate step, they provided the following integral for the expectation:

$$
\mathbb E\left( \frac{\mu\cdot X}{||\mu||X||}\right) =(2\pi\sigma^2)^{-n/2}e^{-\frac{\mu^2}{2\sigma^2}}\int_0^\infty dr\int_0^\pi d\theta \,r\,A_{n-2}(r\sin\theta)e^{-\frac{r^2}{2\sigma^2}+\frac{\mu r}{\sigma^2}\cos\theta}\frac{\cos\theta}{r},
$$

where $A_{n-1}(r)=\frac{2\pi^{n/2}}{\Gamma(n/2)}r^{n-1}$ is the area of a $(n-1)$-sphere of radius $r$. However, the jump from the integral to the final formula is obscure to me.

I understand that it will involve some integral representation of ${}_1F_1(a;b;z)$. I looked at lists of such integral representations (e.g. here, or textbooks) but I can't figure out how to connect this integral to the closed-form formula.

Being a non-mathematician (I'm a biologist), I try to find integral representations that somewhat fit that form as a starting point, but most that I find are either integrals from 0 to 1, or which include Bessel functions of the second kind (like in the link above), which I don't know how to relate to this formula. I also tried starting from other integral expressions for the expectation, such as the one in this other answer to the same question, to no avail.

I would be grateful if someone knowledgeable on these topics could provide some insight into what steps take us from the expected value integral of this variable to the closed-form formula with the confluent hypergeometric function.

Best Answer

I think I can show you another way to prove the following claim :

Claim : $$\mathbb{E}\left(\frac{X}{\|X\|}\right)=\frac{\Gamma(\frac{n+1}{2})}{(2\sigma^2)^{1/2}\Gamma(\frac{n+2}{2})}{}_1F_1\bigg(\frac{1}{2};\frac{n+2}{2};-\frac{\|\mu\|^2}{2\sigma^2}\bigg)\mu$$

Proof :

Using River Li's answer, we have

$$\begin{align} \mathbb{E}\left(\frac{X}{\|X\|}\right) &= \mathbb{E}\left(\frac{X}{(\|X\|^2)^{1/2}}\right) \\\\&=\mathbb{E}\left(X \cdot \frac{1}{\Gamma(1/2)}\int_0^\infty \mathrm{e}^{-z\|X\|^2}z^{-1/2}\,dz \right) \\\\&= \frac{1}{\sqrt{\pi}}\int_0^\infty \mathbb{E}\left(X\mathrm{e}^{-z\|X\|^2}\right)z^{-1/2}\,dz \\\\&= \mu \cdot \frac{1}{\sqrt{\pi}}\int_0^\infty \frac{e^{-\frac{\|\mu\|^2 z}{2\sigma^2 z + 1}} \cdot z^{-1/2}}{(2\sigma^2 z + 1)^{(n+2)/2}}dz\end{align}$$

Letting $t=\frac{1}{2\sigma^2 z + 1}$, we have $\frac{dt}{dz}=-2\sigma^2 t^2$, so we obtain

$$\mathbb{E}\left(\frac{X}{\|X\|}\right)=\mu\cdot \frac{e^{-\frac{\|\mu\|^2}{2\sigma^2}}}{(2\sigma^2)^{1/2} \sqrt{\pi}}\int_0^1 e^{\frac{\|\mu\|^2t}{2\sigma^2}}t^{\frac{n-1}2}(1-t)^{-1/2}dt$$

According to here, we can say that if $\text{Re}(b)\gt \text{Re}(a)\gt 0$, then we have $$\int_0^1e^{zt}t^{a-1}(1-t)^{-a+b-1}dt=\Gamma(a)\Gamma(b-a)\ _{1}\bar{F}_1(a;b;z)$$

So, taking $a=\frac{n+1}{2},b=\frac{n+2}{2}$ and $z=\frac{\|\mu\|^2}{2\sigma^2}$, we have

$$\mathbb{E}\left(\frac{X}{\|X\|}\right)=\mu\cdot\frac{e^{-\frac{\|\mu\|^2}{2\sigma^2}}\Gamma(\frac{n+1}{2})}{(2\sigma^2)^{1/2}}{}_1\bar{F}_1\bigg(\frac{n+1}{2};\frac{n+2}{2};\frac{\|\mu\|^2}{2\sigma^2}\bigg)$$

Since $_{1}\bar{F}_{1}(a;b;z)=\frac{1}{\Gamma(b)}\ _{1}F_{1}(a;b;z)$, we have $$\mathbb{E}\left(\frac{X}{\|X\|}\right)= \mu\cdot\frac{e^{-\frac{\|\mu\|^2}{2\sigma^2}}\Gamma(\frac{n+1}{2})}{(2\sigma^2)^{1/2}\Gamma(\frac{n+2}{2})}{}_1F_1\bigg(\frac{n+1}{2},\frac{n+2}{2};\frac{\|\mu\|^2}{2\sigma^2}\bigg)$$

Since $_{1}F_1(a;b;z)=e^z\ _{1}F_1(b-a;b;-z)$, we finally get

$$\mathbb{E}\left(\frac{X}{\|X\|}\right)=\frac{\Gamma(\frac{n+1}{2})}{(2\sigma^2)^{1/2}\Gamma(\frac{n+2}{2})}{}_1F_1\bigg(\frac{1}{2};\frac{n+2}{2};-\frac{\|\mu\|^2}{2\sigma^2}\bigg)\mu.\ \blacksquare$$


Added :

There is an error in step 2 since it is wrong that $$\int_{1}^{-1} z \left(-e^{a z}\right) \left(1-z^2\right)^{\frac{n}{2}-\frac{1}{2}} dz = \frac{1}{2} \sqrt{\pi }\ a\ \Gamma\left(\frac{n+1}{2}\right) {}_0F_1\left(\frac{n}{2}+2;\frac{a^2}{4}\right)$$ According to WolframAlpha, for $(a,n)=(2,1)$, we have $$LHS=\frac{e^4+3}{4e^2}\not=\frac{3\sqrt{\pi}}{4}\times\frac{e^4+3}{4e^2}=RHS$$

My conjecture is $$\int_{1}^{-1} z \left(-e^{a z}\right) \left(1-z^2\right)^{\frac{n}{2}-\frac{1}{2}} dz = \frac{1}{2}\sqrt{\pi}\ a\ \frac{\Gamma\left(\frac{n+1}{2}\right)}{\color{red}{\Gamma\left(\frac{n+4}{2}\right)}}\ {}_0F_1\left(\frac{n}{2}+2;\frac{a^2}{4}\right)\tag1$$

According to WolframAlpha, for small $n$, $(1)$ holds.

However, I don't know how to prove that the conjecture is true.

Related Question