Re: Area of inside contour of continuous function?

*To*: mathgroup at smc.vnet.net*Subject*: [mg84238] Re: Area of inside contour of continuous function?*From*: "Steve Luttrell" <steve at _removemefirst_luttrell.org.uk>*Date*: Fri, 14 Dec 2007 23:17:24 -0500 (EST)*References*: <fjun8o$24v$1@smc.vnet.net>

This does the sort of thing that you want: In[1]:= f[x_,y_,a_,b_]:=1-a x^2-b y^2; In[2]:= Integrate[f[x,y,a,b]Boole[f[x,y,a,b]>k f[0,0,a,b]],{x,-\[Infinity],\[Infinity]},{y,-\[Infinity],\[Infinity]},Assumptions->a>0&&b>0&&0<k<1] Out[2]= -(((-1+k^2) \[Pi])/(2 Sqrt[a b])) Steve Luttrell West Malvern, UK "Gareth Russell" <russell at njit.edu> wrote in message news:fjun8o$24v$1 at smc.vnet.net... > 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 > >