Area of inside contour of continuous function?
- To: mathgroup at smc.vnet.net
- Subject: [mg84229] Area of inside contour of continuous function?
- From: Gareth Russell <russell at njit.edu>
- Date: Fri, 14 Dec 2007 14:57:42 -0500 (EST)
Hi Group, I have a two-parameter smooth continuous function f[x_,y_] that is unimodal (it's a log-likeihood function), and I know maxf, the height of the peak. I would like to calculate the area inside a contour that is a given number of units u below the peak. What is the easiest way to do this? My own idea is to construct a separate function with discontinuities along the lines of g[x_,y_]:=If[f[x,y]>(maxf-u),1,0] And do numerical integration over a region big enough to contain the contour (which of course, I can see from a ContourPlot). But am I missing something much easier? Searching the mathgroup archives I came across how to find the area of a discrete polygon, so I realize that another method would be to extract the contour data from the ContourPlot object and apply that, but it seems like a bit of hack! Thanks, Gareth -- Gareth Russell NJIT