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

  • Thread starter Thread starter aymer
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To plot 1-sigma and 2-sigma confidence contours for cosmological parameter estimation when the probability distribution may not be Gaussian, a Monte-Carlo Markov Chain (MCMC) approach is recommended. Using tools like cosmomc can facilitate this process, as it includes the getdist program for generating contour plots from MCMC chain outputs. To estimate confidence regions from the MCMC chain, the parameter's prior range is divided into bins, and the number of chain steps in each bin is counted. This count reflects the marginal probability of parameter values, allowing for the establishment of confidence intervals based on the percentage of chain points within specified ranges. For smooth 2D error contours, interpolation on the binned chain points is performed.
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.
 

Similar threads

Replies
3
Views
7K
Replies
12
Views
4K
Replies
1
Views
3K
Replies
1
Views
3K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
6
Views
4K
Replies
1
Views
3K
Replies
9
Views
5K
Back
Top