rmhcontrol(...)
"rmhcontrol"(..., p=0.9, q=0.5, nrep=5e5, expand=NULL, periodic=NULL, ptypes=NULL, x.cond=NULL, fixall=FALSE, nverb=0, nsave=NULL, nburn=nsave, track=FALSE)
"owin"
)
or a numerical expansion factor, specifying that
simulations are to be performed in a domain other than the
original data window, then clipped to the original data window.
This argument is passed to rmhexpand
.
A numerical expansion factor can be in several formats:
see rmhexpand
.
NULL
) indicating whether to simulate
``periodically'', i.e. identifying opposite edges of the rectangular
simulation window. A NULL
value means ``undecided.''
nverb
iterationsnsave
iterations, after an initial burn-in period of
nburn
iterations.
"rmhcontrol"
, which is essentially
a list of parameter values for the algorithm.There is a print
method for this class, which prints
a sensible description of the parameters chosen.
p=1
.
The number of points is determined by the initial state
of the simulation: see rmhstart
.
p=1
and fixall=TRUE
.
The number of points of each type is determined by the initial state
of the simulation: see rmhstart
.
x.cond
to be a point pattern (object of
class "ppp"
). Its window V=Window(x.cond)
becomes the
conditioning subwindow $V$.
x.cond
to be a list(x,y)
or data.frame
with two columns containing the coordinates of the points, or a
list(x,y,marks)
or data.frame
with three columns
containing the coordinates and marks of the points.
x.cond
, p
and fixall
can be
combined.rmh
,
generates simulated realisations of point process models.
The function rmhcontrol
sets up a list of parameters which control the
iterative behaviour
and termination of the Metropolis-Hastings algorithm, for use in a
subsequent call to rmh
. It also checks that the
parameters are valid. (A separate function rmhstart
determines the initial state of the algorithm,
and rmhmodel
determines the model to be simulated.)
The parameters are as follows:
If $p = 1$ then the algorithm only alters existing points,
so the number of points never changes, i.e. we are
simulating conditionally upon the number of points.
The number of points is determined by the initial state
(specified by rmhstart
).
If $p=1$ and fixall=TRUE
and the model
is a multitype point process model, then the algorithm
only shifts the locations of existing points and does not
alter their marks (types).
This is equivalent to simulating conditionally
upon the number of points of each type.
These numbers are again specified by the initial state.
If $p = 1$ then no expansion of the simulation window
is allowed (see expand
below).
The default value of p
can be changed by setting
the parameter rmh.p
in spatstat.options
.
p
is equal to 1. The default value of q
can be changed by setting
the parameter rmh.q
in spatstat.options
.
The default value of nrep
can be changed by setting
the parameter rmh.nrep
in spatstat.options
.
"owin"
).
Indicates that the process is to be simulated on a
domain other than the original data window w
,
then clipped to w
when the algorithm has finished.
This would often be done in order to approximate the
simulation of a stationary process (Geyer, 1999)
or more generally a process existing in the
whole plane, rather than just in the window w
. If expand
is a window object, it is taken as the
larger domain in which simulation is performed.
If expand
is numeric, it is interpreted
as an expansion factor or expansion distance
for determining the simulation domain from the data window.
It should be a named scalar, such as
expand=c(area=2)
, expand=c(distance=0.1)
,
expand=c(length=1.2)
. See rmhexpand()
for
more details. If the name is omitted, it defaults to area
.
Expansion is not permitted if the number of points has been
fixed by setting p = 1
or if the
starting configuration has been specified via the
argument x.start
in rmhstart
.
If expand
is NULL
, this is interpreted to mean
not yet decided. An expansion rule will be determined
at a later stage, using appropriate defaults.
See rmhexpand
.
NULL
)
determining whether to simulate periodically.
If periodic
is TRUE
, and if the simulation window
is a rectangle, then the simulation algorithm effectively
identifies opposite edges of the rectangle. Points
near the right-hand edge of the rectangle are deemed to be close
to points near the left-hand edge. Periodic simulation usually
gives a better approximation to a stationary point process.
For periodic simulation, the simulation window must be a rectangle.
(The simulation window is determined by expand
as described
above.) The value NULL
means undecided.
The decision is postponed until rmh
is called.
Depending on the point process model to be simulated,
rmh
will then set periodic=TRUE
if the simulation window
is expanded and the expanded simulation window is rectangular;
otherwise periodic=FALSE
.
Note that periodic=TRUE
is only permitted when the
simulation window (i.e. the expanded window) is rectangular.
ptypes
is close to the
relative frequencies of the types which will result from the
simulation.
x.cond
specifies the location of the
fixed points as well as the type of conditioning.
It should be either a point pattern
(object of class "ppp"
) or a list(x,y)
or a data.frame
.
See the section on Conditional Simulation.
fixall
is set equal to TRUE
when it is
not meaningful.
nsave
iterations,
starting from iteration nburn
.
rmh
,
rmhmodel
,
rmhstart
,
rmhexpand
,
spatstat.options
# parameters given as named arguments
c1 <- rmhcontrol(p=0.3,periodic=TRUE,nrep=1e6,nverb=1e5)
# parameters given as a list
liz <- list(p=0.9, nrep=1e4)
c2 <- rmhcontrol(liz)
# parameters given in rmhcontrol object
c3 <- rmhcontrol(c1)
Run the code above in your browser using DataCamp Workspace