Given a bivariate gaussian distribution,(adsbygoogle = window.adsbygoogle || []).push({});

I'm attempting to find the probability p for which

the ellipse of all points (x,y) for which P(X = x, Y= y) = p contains

a given % of the samples drawn from the distribution.

I want the 2d equivalent for the 1 dimensional case:

given a normal distribution N(0,1):

e.g interval between points with p = 0.24197072 contains 68.2% of all samples

e.g interval between points with p = 0.05399097 contains 95.4% of all samples

e.g interval between points with p = 0.00013383 contains 99.6% of all samples

in two dimensions these interval boundries become an ellipse and I'm interested in finding the p value corresponding to a given % (contained samples in contour ellipse with p) value in the 2 dimensional case.

Some extra info:

A matlab, python (using numpy, scipy?) numerical approximation is ok, I don't need an analytic formula.

Actually I just want to draw the ellipses containing 75%, 95%, 99% of the samples in python (using matlibplot) for a given gaussian distribution (varying mean & covariance). I know how to do this if I obtain p first (contour plots).

Thank you for reading my question and I hope you can help.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Bivariate Normal Distribution, contour ellipse containing given % samples?

**Physics Forums | Science Articles, Homework Help, Discussion**