Bivariate normal distribution of points

2.5k Views Asked by At

I would like to generate points (x,y) in a 2-D plane that has a circular normal distribution similar to this:enter image description here

I found multiple terms for describing a "circular normal distribution" and yet, I'm not sure which one to use (let me know if bivariate normal distribution is the correct term to use). This explains why I'm having trouble finding an answer to my question.

For example, how would I generate a point (x,y) that has a 30% probability to be inside a circle of $$x^2+y^2 = 2^2$$ using the bivariate normal distribution (if this is the correct theory to use)?.

1

There are 1 best solutions below

7
On BEST ANSWER

"Bivariate normal" includes not only distributions with circular symmetry, but also some distributions for which level sets of the density function are ellipses.

The usual definition is that the pair $(X,Y)$ has a bivariate normal distribution if for every pair of constants $a,b$ (and "constant" in this case means not random) the linear combination $aX+bY$ has a univariate normal distribution. In fact, in addition to circles and ellipses mentioned above, there are bivariate normal distributions concentrated on a line: e.g. $(X,3X)$.

Now suppose $X$ and $Y$ are independent random variables distributed as $N(0,\sigma^2)$. The joint density is $$ \frac 1 {\sqrt{2\pi}} e^{-x^2/(2\sigma^2)} \cdot \frac 1 {\sqrt{2\pi}} e^{-y^2/(2\sigma^2)}. $$ Notice that this is $$ \frac 1 {2\pi} e^{-(x^2+y^2)/(2\sigma^2)}. $$ This depends on $x$ and $y$ only through $x^2+y^2$, so the curves of constant density are circles. Rotating the plane about $(0,0)$ does not change the distribution. So if you can generate independent normals, you've got it.

Next you raise the question: how to choose the value of $\sigma$ so that $\Pr(X^2+Y^2\le 2^2) = 0.3$. We have $$ \Pr(X^2+Y^2 \le 2^2) = \Pr\left( \left(\frac X\sigma\right)^2 + \left(\frac Y \sigma\right)^2 \le \frac {2^2}{\sigma^2} \right) = \Pr\left( Z_1^2+Z_2^2 \le \frac 4 {\sigma^2} \right) \tag 1 $$ where $Z_1,Z_2\sim\mathrm{i.i.d.}\, N(0,1)$.

(BTW, note the way in which I am carefully distinguishing between capital $X$ and lower-case $X$ and between $Y$ and $y$. I mention this because your question follows other conventions.)

This is greatly simplified by a fact you may find surprising if you haven't thought about this before: $Z_1^2+Z_2^2$ has an exponential distribution. Since $\operatorname{E}(Z_i^2)=1$, it has expected value $2$. In other words, $$ \Pr(Z_1^2+Z_2^2 > w) = e^{-w/2} \text{ for } w\ge 0. $$ $$ \Pr\left( Z_1^2+Z_2^2 > \frac 4 {\sigma^2} \right) = e^{-2/\sigma^2}. $$ So set that equal to $0.7$ and solve for $\sigma$.