How to Plot Confidence Contours in Matlab for a Non-Gaussian Distribution?

  • Context: MATLAB 
  • Thread starter Thread starter aymer
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 7K views
aymer
Messages
16
Reaction score
0
Hello..

I am dealing with a cosmological parameter estimation problem. I have a sum of squares function (chi-squared) of two parameters and I have minimized it using fminsearch, to find the best fit. Now, I want to plot 1-sigma, 2-sigma confidence contours for this. My parameter probability distribution may not be Gaussian. So , I don't want to do it in the usual way of adding 2.3 to chi-squared minimum and drawing the contour for 1-sigma. How can I draw a contour that encloses 68% of the area of the surface?

thanx
 
Physics news on Phys.org
aymer said:
Hello..

I am dealing with a cosmological parameter estimation problem. I have a sum of squares function (chi-squared) of two parameters and I have minimized it using fminsearch, to find the best fit. Now, I want to plot 1-sigma, 2-sigma confidence contours for this. My parameter probability distribution may not be Gaussian. So , I don't want to do it in the usual way of adding 2.3 to chi-squared minimum and drawing the contour for 1-sigma. How can I draw a contour that encloses 68% of the area of the surface?

thanx
Well, if you want the entire contour that may not be Gaussian, you're probably going to want to use a Monte-Carlo Markov Chain, unless you already have an analytical result for the two-parameter probability distribution. Most people use cosmomc for MCMC's with cosmological parameter estimation. Cosmomc also includes a program, getdist, which can be used to produce a variety of different contour plots for chain outputs. It uses Matlab for the actual plotting.
 
I already have an mcmc chain of parameter values and corresponding chi-square values. I have not used cosmomc though. Can you give me an idea how are the confidence regions estimated from the chain?
 
aymer said:
I already have an mcmc chain of parameter values and corresponding chi-square values. I have not used cosmomc though. Can you give me an idea how are the confidence regions estimated from the chain?
To obtain the posterior distribution, you chop the parameter's prior range into bins. Then, you count the number of chain steps that fall into each bin. The number in each bin is proportional to the marginal probability that the parameter value falls in that bin. Confidence intervals are then set by the parameter values within which a specified % of chain points lie. To obtain smooth 2D error contours, functions like getdist perform an interpolation on the 2D grid of binned chain points.