2D Gaussians

Hi, I am working on a pretty specific problem. I am trying to make a plot of a 2D Gaussian curve and then append a contour plot of the first 3 standard deviations to it. My data is in a 21x21 matrix. I have the Gaussian curve formed ok and have the plot made. What I am having trouble with is computing the height of the Gaussian at each standard deviation for the 2D gaussian. I tried to manually create the values by using the 0.68 / 0.95 /0.99 rule and square each one as the total area enclosed, then multiply it by the peak height (which is 1 since I normalized the data). However, this doesn't seem correct as the contour evaluates based on the line rather than the area. What I really need to do is to determine the value of the 2D gaussian function at each standard deviation in order to get the contour plot correct. I have attempted a curve fit using the Curvefit Gauss2D function but I get an error about a NaN "The fitting function returned NaN for at least one X value." What I believe would work is to curve fit the gaussian, then input the standard deviation and set x = standard deviation and y = standard deviation to evaluate the function. Then use these values for the contour plot. How can I directly output the value of a 2D gaussian for a given value of standard deviation, x, and y position?

Thank you!
If you normalized your data so that the peak is at 1 then it no longer represents a PDF since the total area will (more than likely) be different than 1. You may want to compare your function with the result of the built-in function Gauss() (e.g., Gauss(x,0,10,y,0,10) ) which is normalized (in area) to 1.

If you are really working with a probability density function and if it is symmetric you could use the the built-in function StatsInvNormalCDF() to solve for the value for which the CDF (the integral or area of your PDF) attains a given value. If you substitute that value in the expression for the PDF you can get the z-value at which you need to draw the contour.

If your data do not represent a symmetric/separable or normalized distribution than you have to evaluate the 2D integral (as a function of x and y offset from the center) but before we get there you should really give us more details.

A.G.
WaveMetrics, Inc.