27

If $\mathbf{X} \sim \mathcal{N}_N(\mathbf{m}, \mathbf{C})$ is an $N$-dimensional gaussian vector, where $\mathbf{m} \in \mathbb{R}^{N}$ and $\mathbf{C} \in \mathbb{R}^{N \times N}$, what is the distribution of $$ Y = \| \mathbf{X} \|^2 $$ where $\| \cdot \|$ denotes the $L_2$-norm (Euclidean norm) ?

It may be useful to know that the mean can be easily calculated via $$ \mathbb{E}[ \| \mathbf{X} \|^2 ] = \mathbb{E}\left[\sum_{i=1}^N X_i^2 \right] = \sum_{i=1}^N \mathbb{E}[X_i^2] = \sum_{i=1}^N (\sigma^2_i + m_i^2) = \sum_{i=1}^N\sigma_i^2 + \sum_{i=1}^N m_i^2 = \mathrm{tr}(\mathbf{C}) + \| \mathbf{m} \|^2 $$ where $\mathrm{tr}(\cdot)$ denotes the trace of a matrix.

EDIT: Related question: link.

PseudoRandom
  • 1,414
  • 3
    By the way, the mean can also be calculated as $$\mathbb E[| \mathbf X |^2] = \mathbb E[\mathbf X^T \mathbf X] = \mathbb E[\text{tr}(\mathbf X \mathbf X^T)] = \text{tr}(\mathbb E[\mathbf X \mathbf X^T]) = \text{tr}(\mathbf C + \mathbb E[\mathbf X]\mathbb E[\mathbf X]^T) = \text{tr}(\mathbf C) + \mathbb E[\mathbf X]^T \mathbb E[\mathbf X]$$ – Mahmoud Oct 21 '22 at 17:37

1 Answers1

18

If $\mathbf{m}=0$ and $\mathbf{C}$ is the identity matrix, then $Y$ is (by definition) distributed according to a chi-squared distribution.

We can relax the assumption that $\mathbf{m}=0$ and obtain the non-central chi-squared distribution.

On the other hand, if we maintain the assumption that $\mathbf{m}=0$ but allow for general $\mathbf{C}$, we have the Wishart distribution.

Finally, for general $(\mathbf{m},\mathbf{C})$, Y has a generalised chi-squared distribution.

  • 1
    Thank you! I needed the general $(\mathbf{m}, \mathbf{C})$ case. Can you please edit your answer by writing the CDF of the generalized chi-squared distribution? Or some other useful representation. The Wikipedia page doesn't have much information about it. – PseudoRandom Apr 05 '18 at 12:17
  • 1
    @PseudoRandom Unfortunately that's the extent of my knowledge on it! I'd suggest you start looking at the references on the Wikipedia page; that might get you somewhere. I'll try to have a look and update my answer if I find something helpful. Otherwise, you might also want to look at the latest edit to my answer, which might be of some help. – Theoretical Economist Apr 05 '18 at 12:43
  • 1
    Thanks! In my specific case, $\mathbf{m} \neq \mathbf{0}$, but others may find your edit very useful. I will have a look at the references, thanks for that. – PseudoRandom Apr 05 '18 at 17:50
  • I think the last one is called 'non-central Wishart distribution' and the generalized $\chi^2$ refers to the sum of weighted $\chi^2$ with an additional normal distributed RV. –  Nov 30 '21 at 15:26
  • @TheoreticalEconomist how can $\Vert X\Vert_2^2$, a real number, have density of a Wishart distribution, which is defined on the set of positive definite matrices?! – Syd Amerikaner Nov 15 '23 at 18:58
  • 3
    Hello, just saw your answer, but I'm a bit confused about the part of the Wishart distribution, which seems to be the distribution of a certain types of random matrix, but here, the author asked for the distribution of a scalar quantity, namely the norm of a certain vector. What did I miss? Since Wishart distribution arises as the distribution of the sample covariance matrix for a sample from a multivariate normal distribution, should the squared norm of a MVN follow the trace of a Wishart distribution instead? – Mathguest Jan 24 '24 at 11:49
  • @Mathguest is right, the Wishart distribution is not the correct answer in this context.I don't know the answer to OP's question, that's why I landed on this page BTW :-) – András Aszódi May 27 '25 at 12:40