7

I have a multidimensional random variable $X \sim \mathcal{N} \left(\mu, I_d \right)$.

Ideally, I would like to know the expected value of the normalized outer product of the latent variable with itself: $ \mathbb{E}\left( \frac{X}{\lVert X \rVert_2} \cdot \frac{X^T}{\lVert X \rVert_2} \right) $

Alternatively, as an approximation, I'd be happy with using: $X \cdot X^T \mathbb{E} \left(\frac{1}{\lVert X \rVert_2^2} \right)$

However, I can't find an answer of what is $\mathbb{E}\left( \frac{1}{\lVert X \rVert_2^2 }\right)$ (i.e. expected value of inverse squared L2 norm) for the non-centered Gaussian case. This question is related (as well as other questions), but it asks for only 0 mean random variables. I can't seem to find an answer for the non-centered case.

Any further approximation that seems sensible would be appreciated.

Thanks!

dherrera
  • 1,258
  • 8
  • 26
  • 2
    Is it a acceptable for you to numerically integrate with respect to the density of the noncentral chi-squared distribution? – Yashaswi Mohanty Feb 16 '23 at 06:53
  • 1
    It helps to simplify your question first. Without any loss of generality you may choose coordinates in which $\mu=(m,0,\ldots,0)$ and write $X=\mu+Z$ where $Z$ is standard multivariate Normal. This leads to four kinds of expectations: $E((m+Z_1)^2/((m+Z_1)^2+Z_2^2+\cdots+Z_d^2)),$ $E(Z_2^2/((m+Z_1)^2+Z_2^2+\cdots+Z_d^2)),$ $E((m+Z_1)Z_2/((m+Z_1)^2+Z_2^2+\cdots+Z_d^2)),$ and $E(Z_2Z_3/((m+Z_1)^2+Z_2^2+\cdots+Z_d^2))$ The symmetry of the marginals of $Z$ implies the latter two are zero. The first two are closely related to non-central F distributions. – whuber Feb 16 '23 at 16:51
  • @YashaswiMohanty, that would not be acceptable, but I hadn't thought of using the noncentral chi-squared distribution (I'm not a statistician). You're comment had me finding this post which may solve my simplified problem. https://stats.stackexchange.com/questions/374315/expectation-of-inverse-non-central-chi-squared – dherrera Feb 16 '23 at 18:49
  • Thanks @whuber , that sounds very useful, and on point to what I want. I'll see if I can turn that into a solution of the problem and then answer the question myself. Although be my guest if you want to post your comment (or an ellaboration) as an answer, which I'll mark as the solution for now. – dherrera Feb 16 '23 at 18:50
  • @whuber to ellaborate on your answer, I see two differences between the first two types of expectations and the non-central F distribution: 1) the numerator and denominator are not independent in this case, being that they share some , 2) The denominator is non-central in this case too, unlike the non-central F distribution (https://en.wikipedia.org/wiki/Noncentral_F-distribution). Does this sound right? – dherrera Feb 16 '23 at 19:42
  • Those are both correct. There is a version of the non-central F distribution that is non-central in the numerator and denominator. You need to perform some algebraic manipulation to separate the terms in the denominator (the reciprocal splits), so you will find that this re-expressed value follows a doubly non-central F distribution, I believe. – whuber Feb 16 '23 at 20:30
  • Just for the record, this seems to be the same question, asked 5 years ago and still without solution https://math.stackexchange.com/questions/2552281/expectation-of-frac-mathbfx-mathbfx-rmt-mathbfx-2-for – dherrera Feb 20 '23 at 21:40

1 Answers1

7

After some work I found the solution to the problem. The solution is the following:

Eq (1). \begin{equation} \mathbb{E}\left[\frac{XX^T}{X^TX}\right] = \frac{1}{n}{}_{1}F_1\left(1; \frac{n}{2}+1; \frac{-||\mu||^2}{2}\right)I + \frac{1}{n+2} {}_{1}F_1\left(1; \frac{n}{2}+2; \frac{-||\mu||^2}{2}\right)\mu\mu^T \end{equation}

for $X\sim\mathcal{N}(\mu, I)$, where $I$ in the formula is the identity matrix, $n$ is the dimensionality of $X$, and ${}_{1}F_1(a;b;c)$ is the confluent hypergeometric function. So, the solution is a weighted sum of the identity matrix and the outer product of the variable mean, with the weights given by the hypergeometric confluent function and dimension of $X$.

The derivation is as follows:

A well studied, related problem, is to find the expectation of ratios of quadratic forms $\mathbb{E}\left[\frac{X^TAX}{X^TX}\right]$, where $X\sim\mathcal{N}(\mu,I)$ and $A$ is a symmetric matrix. In this post, I had asked for an analytic formula to find this last expectation, and I then posted an answer I found. The formula is:

Eq (2). \begin{equation} \mathbb{E}\left[\frac{X^T A X}{X^T X}\right] = \frac{tr(A)}{n} {}_1F_1\left(1; \frac{n}{2}+1; \frac{-||\mu||^2}{2}\right) + \frac{1}{n+2} {}_1F_1\left(1; \frac{n}{2}+2; \frac{-||\mu||^2}{2}\right) \mu^T A \mu \end{equation}

Now, we can use this formula to estimate each individual element $i,j$ of the original expectation by finding a matrix $A$ such that: $$\mathbb{E}\left[\frac{XX^T}{X^TX}\right]_{i,j} = \mathbb{E}\left[\frac{X_iX_j}{X^TX}\right] = \mathbb{E}\left[\frac{X^T A X}{X^T X}\right]$$

It is easy to see that this relation is satisfied for each element $i,j$ by the following matrices:

  • When $i=j$, $A_{i,i}=1$ and 0 elsewhere. In this case $tr(A)=1$ and $\mu^T A \mu = \mu_i^2$
  • When $i \neq j$, $A_{i,j}=A_{j,i}=1/2$ and 0 elsewhere. In this case $tr(A)=0$ and $\mu^T A \mu = \mu_i\mu_j$

Using these matrices in Eq(2), we get, for $i=j$:

$$\mathbb{E}\left[\frac{XX^T}{X^T X}\right]_{i,i} = \frac{1}{n} {}_1F_1\left(1; \frac{n}{2}+1; \frac{-||\mu||^2}{2}\right) + \frac{1}{n+2} {}_1F_1\left(1; \frac{n}{2}+2; \frac{-||\mu||^2}{2}\right) \mu_i^2$$

and for $i\neq j$: $$\mathbb{E}\left[\frac{XX^T}{X^T X}\right]_{i,j} = \frac{1}{n+2} {}_1F_1\left(1; \frac{n}{2}+2; \frac{-||\mu||^2}{2}\right) \mu_i\mu_j$$

With a little of linear algebra, we notice that these two expressions equal the first formula in this answer.

As a computational note, in case it's of use to anyone, the implementation of the confluent hypergeometric function in scipy was blowing up frequently for me. The package mpmath that allows for arbitrary precision computation has an implementation that has worked perfectly so far.

If you find this useful, please consider upvoting the answer and/or question.

dherrera
  • 1,258
  • 8
  • 26