Computing the Mean

Rayleigh distributions pop up here and there, but the procedure outlined here for computing the expected value (i.e. the mean) of a distribution can be applied to any probability distribution function, it is just solving an integral. Sometimes these integrals can be pretty tough though, so it is best to use e.g. mathematica to solve them for you.

The Rayleigh Distribution is defined as follows:

$f(x|\sigma) = \dfrac{x}{\sigma^2} \exp \left( -\dfrac{x^2}{2\sigma^2} \right)$

The expected value of a distribution $$f(x)$$ is defined as follows:

$\mathbb{E}[x] = \int x f(x) dx$

By substituting our desired pdf into the above equation, and solving the integral we get the mean of the distribution:

$\mathbb{E}[x] = \int_0^\infty x \dfrac{x}{\sigma^2} \exp \left( -\dfrac{x^2}{2\sigma^2}\right) dx$

We can now use the Wolfram integral calculator to solve it for us:

$\mathbb{E}[x] = \sigma \sqrt{\dfrac{\pi}{2}}$

We can compare this to the value given on the Rayleigh Distribution page, so we know we got the right answer. Remember, this can be used for any distribution, not just the Rayleigh distribution.

Computing the Variance

Once we have the mean, we can also compute the variance using the following formula:

$Var(x) = \mathbb{E}[x^2] - \mathbb{E}[x]^2$

Substituting in the value of $$\mathbb{E}[x]$$ that we have already computed, we have the following equation:

$Var(x) = \int_0^\infty x^2 \dfrac{x}{\sigma^2} \exp \left( -\dfrac{x^2}{2\sigma^2}\right) dx - \left( \sigma \sqrt{\dfrac{\pi}{2}} \right)^2$

Which simplifies very nicely after solving the integral with wolfram:

$Var(x) = \sigma^2(2-\pi/2)$