# Solved – Expected magnitude of a vector from a multivariate normal

What is the expected magnitude, i.e. euclidean distance from the origin, of a vector drawn from a p-dimensional spherical normal \$mathcal{N}_p(mu,Sigma)\$ with \$mu=vec{0}\$ and \$Sigma=sigma^2 I\$, where \$I\$ is the identity matrix?

In the univariate case this boils down to \$E[|x|]\$, where \$x sim mathcal{N}(0,sigma^2)\$. This is the mean \$mu_Y\$ of a folded normal distribution with mean \$0\$ and variance \$sigma^2\$, which can be calculated as:

\$mu_Y = sigma sqrt{frac{2}{pi}} ,, expleft(frac{-mu^2}{2sigma^2}right) – mu , mbox{erf}left(frac{-mu}{sqrt{2} sigma}right) stackrel{mu=0}{=} sigma sqrt{frac{2}{pi}}\$

Since the multivariate normal is spherical, I thought about simplifying the problem by switching to polar coordinates. Shouldn't be the distance from the origin in any direction be given by a folded normal distribution? Could I integrate over all distances, multiply with the (infinitesimal) probability to encounter a sample with that distance (e.g. CDF(radius)-CDF(radius-h), \$h rightarrow 0\$) and finally make the leap to more than one dimension by multiplying with the "number of points" on a hypersphere of dimension \$p\$? E.g. \$2 pi r\$ for a circle, \$4 pi r^2\$ for a sphere? I feel that this might be a simple question, but I'm not sure how to analytically express the probability for \$h rightarrow 0\$.

Simple experiments suggest that the expected distance follows the form \$csqrt{sigma}\$, but I'm stuck on how to make the leap to a multivariate distribution. By the way, a solution for \$p le 3\$ would be fine.

Contents

The sum of squares of \$p\$ independent standard normal distributions is a chi-squared distribution with \$p\$ degrees of freedom. The magnitude is the square root of that random variable. It is sometimes referred to as the chi distribution. (See this Wikipedia article.) The common variance \$sigma^2\$ is a simple scale factor.

The mean of the chi-distribution with \$p\$ degrees of freedom is \$\$ mu=sqrt{2},,frac{Gamma((p+1)/2)}{Gamma(p/2)} \$\$

Special cases as noted:

For \$p=1\$, the folded normal distribution has mean \$frac{sqrt{2}}{Gamma(1/2)}=sqrt{frac{2}{pi}}\$.

For \$p=2\$, the distribution is also known as the Rayleigh distribution (with scale parameter 1), and its mean is \$sqrt{2}frac{Gamma(3/2)}{Gamma(1)}=sqrt{2}frac{sqrt{pi}}{2} = sqrt{frac{pi}{2}}\$.

For \$p=3\$, the distribution is known as the Maxwell distribution with parameter 1; its mean is \$sqrt{frac{8}{pi}}\$.

When the common variance \$sigma^2\$ is not 1, the means must be multiplied by \$sigma\$.

Rate this post