I need to generate random points. It's
important that the points simulate a
homogeneous Poisson process (close as
possible). The inadequacies of rand() have
been well documented, so my feeling is that
r.random may also be lacking (since it uses
rand()). Has anyone tested this program and
documented its performance (Monte Carlo
methods, perhaps using the outline given on
pp. 635-6 in Cressie's _Statistics for
Spatial Data_)? If so, can you provide
this documentation?
Does anyone have any GRASS alternatives?
Does anyone have a need for alternatives?
Not only do I need to generate random
points, but I also need to use them to
randomly select sites, perhaps using a
nearest neighbor approach. This is for a
k-fold cross validation of some
interpolation methods. Would anyone else
have a need for a GRASS program that does
this?
I ask because if I get one or two others
that say "yes, I need that," then the
probability is pretty high that I'll package
up another GRASS program or two (for some
reason I'm in a programming mood %-).
To that end, is there any random number
generator already contained in GRASS code
somewhere?
In <9307221717.AA06419@pasture.ecn.purdue.edu> mccauley@ecn.purdue.edu (Darrell McCauley) writes:
I need to generate random points. It's
important that the points simulate a
homogeneous Poisson process (close as
possible). The inadequacies of rand() have
been well documented, so my feeling is that
r.random may also be lacking (since it uses
rand()). Has anyone tested this program and
documented its performance (Monte Carlo
methods, perhaps using the outline given on
pp. 635-6 in Cressie's _Statistics for
Spatial Data_)? If so, can you provide
this documentation?
The r.random code calls rand() but it does this
more or less as
rand() << 16 + rand()
or something like that. This was to get around the
fact that rand() only generated numbers from 1-2^16
(or at least it used to). r.random has NOT been
revisited since this time.
Does anyone have any GRASS alternatives?
Does anyone have a need for alternatives?
Not only do I need to generate random
points, but I also need to use them to
randomly select sites, perhaps using a
nearest neighbor approach. This is for a
k-fold cross validation of some
interpolation methods. Would anyone else
have a need for a GRASS program that does
this?
I ask because if I get one or two others
that say "yes, I need that," then the
probability is pretty high that I'll package
up another GRASS program or two (for some
reason I'm in a programming mood %-).
To that end, is there any random number
generator already contained in GRASS code
somewhere?
No, sorry. You could look at drand48() which
generates numbers between 0.0 and 1.0. Read
Number Recipes in C for a discussion about
random number generators and ways to generate
various kinds of distributions.
--
Michael Shapiro shapiro@zorro.cecer.army.mil
U.S. Army CERL (217) 373-7277
P.O. Box 9005
Champaign, Ill. 61826-9005
Michael Shapiro (shapiro@zorro.cecer.army.mil) writes on 5 Aug 93:
In <9307221717.AA06419@pasture.ecn.purdue.edu> mccauley@ecn.purdue.edu (Darrell McCauley) writes:
Not only do I need to generate random
points, but I also need to use them to
randomly select sites, perhaps using a
nearest neighbor approach. This is for a
k-fold cross validation of some
interpolation methods. Would anyone else
for those who may have missed it, s.rand
and s.kcv are available for testing on
pasture.ecn.purdue.edu in pub/mccauley/grass
generates numbers between 0.0 and 1.0. Read
Number Recipes in C for a discussion about
random number generators and ways to generate
various kinds of distributions.
generating a Poisson simply means that
coordinates come from a uniform distribution.
Cressie outlines several indices for quadrat
count data and statistics for nearest neighbor
distances (event to nearest event, sample point
to nearest event, sample point to second-nearest
event, etc). If anyone is interested a GRASS
program to compute these, contact me.
--Darrell