Rayleigh radius from Gaussian components (source code)

= Rayleigh radius from Gaussian components
{c}

The <joint probability density> of $X,Y$ is
$$
p(x,y)=\frac1{2\pi\sigma^2}e^{-(x^2+y^2)/(2\sigma^2)}.
$$
In <polar coordinates>, $x=r\cos\theta$, $y=r\sin\theta$, and the absolute <Jacobian determinant> is $r$. Thus the joint density of <radius> and angle factors as
$$
p_{R,\Theta}(r,\theta)=\frac r{\sigma^2}e^{-r^2/(2\sigma^2)}\frac1{2\pi},\qquad r>0,\quad0\leq\theta<2\pi.
$$
Integrating over angle gives the <Rayleigh distribution>. The same factorization shows that the angle has <uniform distribution> and is <independent> of the <radius>. This is a short <change of variables> argument: an <annulus> of width $dr$ has <area> $2\pi r\,dr$ to first order.

The assumptions are substantive. Unequal component <variances> give elliptical rather than circular density contours; a nonzero mean displaces the center. Even zero <covariance> and equal <normal distributions> do not suffice without <independence>. For an original counterexample, let $X\sim N(0,\sigma^2)$ and let $S$ be an <independent> <Rademacher random variable>. Put $Y=SX$. Then $Y$ has the same <normal distribution> as $X$, and $\operatorname{Cov}(X,Y)=\mathbb E[SX^2]=0$. Nevertheless, all points lie on $y=x$ or $y=-x$, and $R=\sqrt2|X|$ has density
$$
f_R(r)=\frac1{\sigma\sqrt\pi}e^{-r^2/(4\sigma^2)},\qquad r\geq0,
$$
which is positive at zero, unlike the <Rayleigh distribution>. This pair is not a <Gaussian random vector>.