[6438] in s-news-athena
Density contours
daemon@ATHENA.MIT.EDU (Murray Efford)
Tue Feb 14 17:25:45 1995
From: "Murray Efford" <EffordM@landcare.cri.nz>
To: s-news@utstat.toronto.edu
Date: Wed, 15 Feb 1995 09:22:00 +1300
A while ago I asked for help finding the minimum-area
density contour that includes a given fraction of the density
(50%, 95%) under a fitted 2-D density distribution.
(Apologies to anyone who received multiple copies - for
some reason I got a series of SMTP delivery errors). Many
thanks to the several people who provided helpful replies
(below). I am attracted to Paul Tukey's response because it
uses the data points to which the surface was fitted
(incidentally, in my case these are animal locations from
radio telemetry). Rob Hyndman's hdr may well do the trick,
but I haven't yet braced myself to unpack the shar file for
Windows S-Plus.
Paul Tukey wrote:
"A reasonable way to approximate the density contour level
that contains
alpha % of the smoothed density is to interpolate the
smoothed
density surface at the original data points, say
fhat(i)=fhat(x(i),y(i)),
and then find the alpha % point of the sorted fhat(i) values. "
Rob Hyndman wrote:
"What you want is a highest density region. I have written
some functions to
do this. They are available on the S archive of statlib under
hdr."
Don MacQueen wrote:
"Here is an approach you could use. I don't know if it
produces
mimimum area contours.
Evaluate the joint density onto a fairly fine grid over the
region you are interested in. This gives a set of points (x,y),
and a value h for the joint density at each point.
Let H be the maximum height of the joint density function.
Divide the range (0,H) into some number of intervals, as in
k <- seq(0,H,length=50)
For each k[i] find the set of all points (x,y) such that
h is less than k[i]. Do a crude numerical integration of the
density
function over that set of points. Say the integral is 0.78.
Then the
78% probability contour is the contour that surrounds that
set
of points.
Then search over k for the set of points that integrates to
50%, 95%,
etc."
Murray Efford
Landcare Research
Dunedin, New Zealand
effordm@landcare.cri.nz