5
$\begingroup$

I would like to know the normalising constant of a distribution which has the pdf,

$$f(x) \propto \sqrt{\frac{1}{2\pi\sigma^2}}\text{exp}(-\frac{(|x|-r_0)^2}{\sigma^2}),$$

where $x\in\mathbb{R}^d$ and $|x|$ is the Euclidean norm of $x$. This distribution looks like an annulus in two-dimensions,

enter image description here

In higher dimensions, samples from it are normally-distributed centred on the surface of a hypersphere of radius $r_0$ (at least, I hope it is - please tell me if I am wrong).

Intuition (and a previous question), suggests to me that this distribution has an integral over space that equals the surface area of a hypersphere $\mathbb{S}^{n-1}$, multiplied by $r_0^{n-1}$, where $n$ is the number of dimensions of $x$. Basically, this accounts for taking a normal density and smearing it over higher dimensional space.

The trouble is that I am having trouble confirming my results in Mathematica. The following seems to work ok,

volS[n_] := (2 (Pi^(n / 2)) ) / Gamma[n / 2]

fPDF[z_, r0_, sigma_] := 
 Block[{n = Length@z}, (1 / (volS[n] r0^(n - 1)))
                     PDF[NormalDistribution[r0, sigma], Norm[z]]]

NIntegrate[fPDF[{x, y}, 10, 1], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]

1.

But when I vary $r_0$ and $\sigma$ I get different answers. For example,

NIntegrate[fPDF[{x, y}, 20, 2], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]

0.772186

which seems to suggest I am wrong. However, I am not sure because I am a little fearful that the numerical integration is going awry.

Any ideas?

Also, I would have thought that the mean normed distance for this distribution should just be $r_0$ (as long as $r_0>>\sigma$). When I evaluate this, however, I get a different answer,

NIntegrate[Norm[{x,y}] fPDF[{x, y}, 10, 0.5], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]

7.17138

Any idea as to how to calculate the mean normed distance and variance?

Whilst all these examples are in two-dimensions, note that I am after n-dimensional results.

$\endgroup$
5
$\begingroup$

The numerical integration is not the issue. You also have to calculate a radial integral in order to determine the normalization constant. So, let's do it! Again, we apply polar coordinates:

ClearAll[r, r0, σ, n];
f = {r, r0, σ} \[Function] Evaluate[PDF[NormalDistribution[r0, σ], r]];
assumptions = And @@ {n ∈ Integers, n >= 1, r > 0, r0 > 0, σ > 0};
volS[n_] = (2 (Pi^(n/2)))/Gamma[n/2];
normalization[n_, r0_, σ_] = volS[n] Integrate[f[r, r0, σ] r^(n - 1), {r, 0, ∞}, 
  Assumptions -> assumptions];

This defines a routine that creates a PDF for given dimension n, radius r0 and parameter σ:

makePDF[n_, r0_, σ_] := Function[
   z,
   Evaluate[Simplify[
     f[Sqrt[Sum[Indexed[z, i]^2, {i, 1, n}]], r0, σ]/
      normalization[n, r0, σ]
     ]]
   ];

For example, in dimension 2:

ρ = makePDF[2, r0, σ]

$$z \mapsto \frac{e^{\frac{\text{r0}^2-\left(\text{r0}-\sqrt{z_1^2+z_2^2}\right){}^2}{2 \sigma ^2}}}{\sqrt{2} \pi \sigma \left(\sqrt{\pi } \sigma e^{\frac{\text{r0}^2}{2 \sigma ^2}} \sqrt{\frac{\text{r0}^2}{\sigma ^2}} \text{erf}\left(\frac{\sqrt{\frac{\text{r0}^2}{\sigma ^2}}}{\sqrt{2}}\right)+\sqrt{\pi } \text{r0} e^{\frac{\text{r0}^2}{2 \sigma ^2}}+\sqrt{2} \sigma \right)}$$

Integrate[ρ[{x, y}], {x, -∞, ∞}, {y, -∞, ∞}, Assumptions -> assumptions]

1

$\endgroup$
  • $\begingroup$ @ben18785 Good point. Thanks for the edit! $\endgroup$ – Henrik Schumacher Sep 26 '18 at 21:40
  • $\begingroup$ No problem. Thanks for your work here. My differential geometry isn't what it once (or ever) was! $\endgroup$ – ben18785 Sep 26 '18 at 21:49
  • $\begingroup$ You're welcome! $\endgroup$ – Henrik Schumacher Sep 26 '18 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.