1

I would like to know how to find the expected squared distance to the origin of a $d$-dimensional spherical Gaussian centered at the origin with variance $\sigma^2$. Thanks for the help

1 Answers1

1

By using spherical coordinates it is a one dimensional problem, where the density function is $f(r)=Kr^{d-1}e^{-\frac{r^2}{2\sigma^2}}$ for $r\ge0$ The expected square distance is then $\frac{\int\limits_0^\infty r^2f(r)dr}{\int\limits_0^\infty f(r)dr}=d\sigma^2$.

  • Hi Steinberg, thanks for your answer. I have some questions about this. Where can I find the density function as you stated above. Once I have density function, I take derivative w.r.t $r$ and set to zero, I got $r^2 = \sigma^2(d-1)$ and I think this is the expected squared distance to the origin. Am I right? – Eden Willy Apr 04 '21 at 09:01
  • The integral table appears to be in error. I have corrected the answer using integration by parts. – herb steinberg Apr 04 '21 at 09:44
  • To get the density function use $r^2=\sum x_k^2$ and convert to spherical coordinates. Spherical symmetry means all the angles can be integrated out.. d-1 in your answer can't be right. d=1 leads to $0$ – herb steinberg Apr 04 '21 at 09:59
  • I read in a book and it had for case $\sigma=1$, $r^2=d-1$ and it said that for general case, the result can be scaled up by $\sigma$. Are you sure your integration is correct? – Eden Willy Apr 04 '21 at 10:54
  • Simpler direct derivation: $r^2=\sum x_k^2$ Gaussian density $g(x)=\frac{1}{\sqrt{2\pi \sigma^2}}e^{-\frac{x^2}{2\sigma^2}}$ Your question: is $\int_{R^d} r^2 \prod g(x_n)dA$ which is the sum of $d$ terms each of which is $\int_{R^d}x^2_k\prod g(x_n)dA=\int_Rx^2_kg(x_k)dx_k=\sigma^2$. (Note that the integral $=1$ over all $x_n$ for $n\ne k$.) Since there are $d$ terms for $r^2$, the final result is $d\sigma^2$. (Note my comment for $d=1$ your expression leads to $0$, obviously wrong). – herb steinberg Apr 04 '21 at 13:30
  • Thank you, i will consider your solution. – Eden Willy Apr 04 '21 at 13:45
  • Your question is for $r^2$, not $r$. If $r=0$ you have a point mass at the origin, not a Gaussian distributed. – herb steinberg Apr 04 '21 at 13:46
  • So if I take the derivative of your density function w.r.t $r$ and set to zero, then I can find the value $r^2=\sigma^2(d-1)$ which makes the density function maximum. What this $r^2$ means? – Eden Willy Apr 04 '21 at 14:36
  • I have no idea where you got that approach. In general you are looking for $\int_Rx^2f(x)dx$, where $f(x)$ is the density function, which is the derivative of the distribution function. Are you mixing up these two functions? – herb steinberg Apr 04 '21 at 15:34
  • Oh maybe I misunderstood something here. I will have a look carefully. Anyway, thanks for your answer – Eden Willy Apr 05 '21 at 01:30