make.pattern(n, process="binomial", object, boundary=bbox(x=c(0,1), y=c(0,1)), lambda, maxlambda, radius, cpar)
"binomial"
,
"poisson"
,
"cluster"
,
"Strauss"
, or
"SSI"
.
See the DETAILS section for each definition.
Defaults to
"binomial"
for a completely spatially random process
conditioned to
n
points within
boundary
.
Partial matching is allowed.
"spp"
.
When this is given, the resulting pattern has the same
n
and its
boundary
is that same as the bounding box of
object
.
boundary
should be
given as a list with named components
"x"
and
"y"
denoting the
corners of the rectangular region. For example, for the unit square
the boundary could be given as
bbox(x=c(0,1),y=c(0,1))
, the bounding
box of two diagonally opposed points.
Defaults to
bbox(object)
if
object
is given or to the unit square
otherwise.
process="poisson"
.
If
lambda
is a numerical value then
make.pattern
simulates a two dimensional homogeneous Poisson process
with that constant intensity.
lambda
can also be a function with two arguments that defines
the intensity over the region.
n
, if given, will be ignored if this argument is provided.
lambda
is a function then this should be the maximum value
of the function over the region.
If this is not supplied, a nonlinear optimization will be run
(using
nlminb
) to find the maximum.
Supplying this value will speed up the simulation and avoid
any possible problems with the nonlinear optimization.
maxlambda
is used only if
lambda
is a function.
"Strauss"
,
"SSI"
and
"cluster"
.
Options
"Strauss"
and
"SSI"
will NOT generate
points closer than
radius
.
For this reason, this parameter needs to be reasonably small.
The exception is when
process="cluster"
in which case it should
contain the desired size of the clusters.
See DETAILS section for more information.
process="Strauss"
. This
parameter is also required if
process="cluster"
. In that case,
it represents the intensity of the "parent" Poisson process which
will determine the random placement of clusters and their number.
See the DETAILS section for more information.
"spp"
whose
n
points are distributed according to
process
. If
process="poisson"
results on a process with zero points,
the returned value will be a classless matrix with zero rows and a warning
will be issued.
The
"binomial"
process option generates a spatially random pattern
of
n
points within the given
boundary
. This is in essence a homogeneous
Poisson process conditional on the given number of points
n
.
The
"poisson"
process option generates a Poisson process with
intensity
lambda
.
This argument is required for this option.
If
lambda
is a function the Poisson process is generated by
a rejection sampling algorithm (Diggle, 1983):
a homogeneous Poisson process with
intensity
maxlambda
is generated over the region and
then points are retained with probability
lambda(x, y)/maxlambda
.
The
"SSI"
process generates a random pattern where no two points
are within the inhibition distance determined by its parameter
radius
. This process is equivalent to sequentially laying down discs
of radius
radius
which will not overlap.
The
"Strauss"
process
accepts each randomly generated point with probability
cpar^s
where
s
is the number of existing points within radius
radius
of the potential new point.
The parameter
cpar
must be in [0,1] for this process, where
cpar=0
corresponds to complete inhibition at distances up to
radius
.
The user should exercise caution when determining the value of
radius
,
for if it is too big in relation to the area defined by
boundary
,
the algorithm will run out of possible area to place the subsequent
disc and the generation of the desired process may be impossible or
very slow.
The option
"cluster"
generates a Poisson cluster process. This is
defined by generating a "parent" Poisson process with intensity
cpar
and
a "daughter" process of clusters with radii determined by the value
of
radius
.
If
radius
is too large, it may be impossible or nearly impossible to generate the number of requested points. The call may "hang" in some extreme cases.
Diggle, Peter J. (1983).
Statistical Analysis of Spatial Point Patterns.
Academic Press, London.
Ripley, Brian D. (1981).
Spatial Statistics.
John Wiley & Sons, New York.
Ripley, Brian D. (1976).
The second-order analysis of stationary point processes.
Journal of Applied Probability
13,255-266.
# A completely random process in the unit square rand <- make.pattern(100) plot(make.pattern(100, process="Strauss", rad=0.1, c=0.5)) plot(make.pattern(500, proc="cluster", rad=20, c=10, boundary=list(x=c(0,200), y=c(0,200)))) # A nonhomogeneous Poisson pattern with a linear trend in x # over a 10 x 10 square lxy <- function(x, y) 1.5*x xy <- make.pattern(proc="poisson", boundary=bbox(x=c(0,10), y=c(0,10)), lambda=lxy) plot(xy)