0

I try to find out a method or a tutorial to know how are plotted the contours of different confidence levels (68%, 95%, 99.7% etc ...).

Here below an example of these contours on a plot that I would like to generate:

Cosmology - Omega_Lambda versus Omega_matter

It represents the constraints on cosmological parameters (\omega_Lambda represents dark energy and \Omega_m total matter quantity).

Once I have data sets on \Omega_Lambda and \Omega_mat, how can I produce these contours : I know what is a confidence level but I only know the standard deviation.

If I plot standard deviation for both parameters from the expected values, I get a cross symbol on it (horizontally for \Omega_m and vertically for \Omega_Lambda) : but from this cross, how to draw contours at different confidence levels?

On the figure above, these contours look like a 2D parametric curve where I have points (Omega_Lambda(t), Omega_m(t)) with t parameter but I don't think they are drawn like this.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

1

You might want to check out Matplotlib's contour plot: the levels parameter seems to be what you need.

The plots in your example are not obtained from raw data, but from a statistical model of raw data. So you could first fit multivariate normal distributions to your data using numpy.mean and numpy.cov, then generate the multivariate normal pdf values with scipy.stats.multivariate_normal. You can also find a code snippet doing confidence ellipses here (which seems to be exactly the kind of thing you were looking for).

halfer
  • 19,824
  • 17
  • 99
  • 186
Stefano Gogioso
  • 236
  • 2
  • 6
  • -@Stefano Gogioso : thanks for your suggestion. Unfortunately, it seems this is not about confidence levels as we use it in statistics domain. –  Sep 01 '18 at 15:02
  • @youpilat13: Sorry, I thought you already had a statistical model fitted. I updated my answer accordingly. – Stefano Gogioso Sep 01 '18 at 15:22
  • -@ Stefano Gogioso : thanks, that's what I was looking for. Regards –  Sep 01 '18 at 17:08