sampling from the uniform distribution over a convex hu
On 26-Mar-07 01:05:41, Adrian Baddeley wrote:
Ranjan Maitra writes:
Does anyone have a suggestion (or better still) code for sampling from the uniform distribution over the convex hull of a set of points?
This is implemented in library 'spatstat'. If x and y are vectors of coordinates of your initial set of points, library(spatstat) W <- convexhull.xy(x, y) P <- runifpoint(42, W) will compute the convex hull and generate 42 independent uniformly-distributed points in the convex hull.
Thanks, Adrian! I should have remembered about 'spatstat' after the Baddeley et al. paper to the RSS in June 2005, where the package was extensively used! (Though neither convexhull() nor runifpoint() are in the package I downloaded at the time; but of course things have moved on!). But this brings me to another issue -- It seems that the "R Site Help and Archive Search" at http://finzi.psych.upenn.edu has been belly-up since at least Saturday (when I tried to use it to search for relevant material for this query). My browser says "connection refused", ping hangs, and traceroute returns "!H" (host unreachable); and that is still the situation this morning. I hope this is temporary, and not a withdrawal of the service. Anyone in the know? With thanks, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 26-Mar-07 Time: 10:23:57 ------------------------------ XFMail ------------------------------