# PDF for net displacement of bivariate normal X and Y

this is my first post on StackExchange so I hope I'm posting in the right place. I'm trying to derive the correct probability density function for the net displacement of random variables X and Y from the origin assuming that they're independent, normally-distributed and have equal variance.

To start with, the joint probability of any independent x,y is given by the probability density of a bivariate normal distribution.

$$P(x,y) = {1 \over 2\Pi\sigma_x\sigma_y} e^{\big({-1 \over 2}\big[ {(x-\mu_x)^2 \over \sigma_x^2} + {(y-\mu_y)^2 \over \sigma_y^2}\big]\big) }$$

If we further assume that the standard deviation of x and y are equal, then:

$$P(x,y) = {1 \over 2\Pi\sigma^2} e^{\big({-1 \over 2}\big[ {(x-\mu_x)^2 + (y-\mu_y)^2 \over \sigma^2}\big]\big) }$$

Finally, if I'm interested in the probability that an (x,y) coordinate pair is a certain distance, r, from the origin (x=0, y=0) then I can substitute:

$$r^2 = (x-\mu_x)^2 + (y-\mu_y)^2$$

To specify the joint probability density in terms of r, the net displacement of (x,y) from the origin as follows:

$$P(r) = {1 \over 2\Pi\sigma^2} e^{\big({-r^2 \over \sigma^2}\big) }$$

However, using program R I find that this clearly isn't the correct density function for the displacement of two independent, normally-distributed random variables with shared variance:

sigma=2
X <- rnorm(1000,0,sigma)
Y <- rnorm(1000,0,sigma)
R <- sqrt(X^2+Y^2)
hist(R, freq=F)

• The distance from the origin $(0,0)$ is $r = \sqrt{x^2 + y^2}$, not $r = \sqrt{(x-\mu_x)^2 + (y-\mu_y)^2}$. Transforming to polar coordinates is the usual way of handling distance problems. – wolfies May 8 '14 at 6:23
• Also, you cannot just achieve the transformation $$r^2 = x^2 + y^2$$ by making that substitution into the density function ... it is more complicated than that ... you need to calculate the Jacobian of the transformation too. – wolfies May 8 '14 at 6:35
• Okay, thanks! This is new stuff for me but I think I've tracked down some examples. So in substituting the coordinates of the origin for $\mu_x$ and $\mu_y$ and converting $x$ and $y$ to polar coordinates, the density becomes: $$P(r,\theta)={1 \over 2 \pi \sigma^2}e^{{-(r^2cos^2{\theta} + r^2sin^2{\theta}) \over 2\sigma^2} } * J(r,\theta)$$ where $$J(r,\theta) = {d(x) \over d(r)}{d(y) \over d(\theta)} - {d(x) \over d(\theta)}{d(y) \over d(r)} = cos{\theta}*rcos{\theta} - (-rsin{\theta})*sin{\theta} = r$$ This all simplifies to $$P(r)={r \over 2 \pi \sigma^2}e^{{-r^2 \over 2\sigma^2} }$$ – CGM57 May 8 '14 at 15:45
• @CGM57 The solution you have derived in your comment is actually the joint pdf of $(r, \theta)$ in the special case where ${\mu_x=0, \mu_y=0}$. To then obtain the marginal pdf of $r$, you just need to integrate out $\theta$ over $(0,2 \pi)$. ----------For the more general solution with ${\mu_x, \mu_y}$ NOT 0, clearly the solution pdf must depend on ${\mu_x, \mu_y}$ --- which is an easy way to tell that the posted solution cannot be the general solution you seek. – wolfies May 8 '14 at 17:28