rmhstart {spatstat} | R Documentation |
Builds a description of the initial state for the Metropolis-Hastings algorithm.
rmhstart(start, ...) ## Default S3 method: rmhstart(start=NULL, ..., n.start=NULL, x.start=NULL, iseed)
start |
An existing description of the initial state in some format. Incompatible with the arguments listed below. |
... |
There should be no other arguments. |
n.start |
Number of initial points (to be randomly generated).
Incompatible with x.start .
|
x.start |
Initial point pattern configuration.
Incompatible with n.start .
|
iseed |
Vector of 3 integers determining the initial state of the random number generator. This argument should not be specified, in normal use. |
Simulated realisations of many point process models
can be generated using the Metropolis-Hastings algorithm
implemented in rmh
.
This function rmhstart
creates a full description of the initial state of the
Metropolis-Hastings algorithm,
including possibly the initial state of the random number generator,
for use in a subsequent call to rmh
. It also
checks that the initial state is valid.
The initial state should be specified either by the
first argument start
or by the other arguments
n.start
, x.start
etc.
If start
is a list, then it should have components named
n.start
or x.start
and optionally iseed
,
with the same interpretation as described below.
The arguments are:
w
.
Incompatible with x.start
.
For a multitype point process, n.start
may be a vector
(of length equal to the number of types) giving the number
of points of each type to be generated.
If expansion of the simulation window is selected (see the argument
expand
to rmhcontrol
),
then n.start
will be multiplied by the expansion factor
(ratio of the areas of the expanded window and original window).
For faster convergence of the Metropolis-Hastings algorithm,
the value of n.start
should be roughly equal to
(an educated guess at) the expected number of points which
will be generated inside the window.
n.start
.
x.start
may be a point pattern (an object
of class ppp
), or an object which can be coerced
to this class by as.ppp
, or a dataset containing
vectors x
and y
.
If x.start
is specified, then expansion of the
simulation window (the argument expand
of rmhcontrol
) is not permitted.
If given, this seed will fix the initial state
of the random number generator in any subsequent call
to rmh
.
This should only be done if it is desired to repeat the algorithm with exactly the same sequence of random numbers!
The parameters n.start
and x.start
are
incompatible.
An object of class "rmhstart"
, which is essentially
a list of parameters describing the initial point pattern
and (optionally) the initial state of the random number generator.
There is a print
method for this class, which prints
a sensible description of the initial state.
If iseed
is specified, this will fix the initial state
of the random number generator in any subsequent call
to rmh
.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
# 30 random points a <- rmhstart(n.start=30) # a particular point pattern data(cells) b <- rmhstart(x.start=cells) # set the seed d <- rmhstart(n.start=30, iseed=c(42, 4, 2))