This operation randomises the locations of the points
in a point pattern. It is useful for some hypothesis testing
purposes. A `shift' is a simultaneous, parallel displacement of all points
by the same displacement vector
$(\Delta x, \Delta y)$.
Shifting a point pattern could leave some points outside the boundary of
the window of observation, so we may (if the window is a rectangle)
treat opposite edges of the window as identical, so that a point
which disappears off the right-hand edge will re-appear at the
left-hand edge. This is called a ``toroidal shift'' because it makes the
rectangle topologically equivalent to the surface of a torus
(doughnut).
The argument X
may be either
- a point pattern
(an object of class
"ppp"
) - an object of class
"splitppp"
(basically a list of point patterns, obtained fromsplit.ppp
).
If which=NULL
, then
- If
X
is a point pattern object,
all the points of the pattern
are shifted simultaneously by the same displacement vector. - If
X
is an object of class"splitppp"
then each of the component point patterns is randomly shifted by a
different displacement vector.
The argument which
identifies which sub-patterns of
X
will be subjected to random shifts. Different sub-patterns
will be shifted by different displacement vectors.
If which
is not NULL
, then
- If
X
is a point pattern object,
it should be a multitype pattern (i.e.X$marks
must be a
factor). Thenwhich
should be a vector of types
(i.e. a vector containing one or more levels ofX$marks
).
For each valuea
inwhich
, the sub-pattern ofX
consisting of points of typea
only will be
extracted, and subjected to a random toroidal shift.
A different shift will be applied to different sub-patterns.
The points not selected bywhich
will be unchanged. - If
X
is an object of class"splitppp"
,
thenwhich
can be any valid subset index for the listX
.
For examplewhich
could be a vector of names of components
in the listX
. Each selected component point pattern will be shifted
by a different displacement vector.
The displacement vector, i.e. the vector
by which the data points are shifted,
is generated at random. The default behaviour is
to generate a displacement vector at random with equal probability
for all possible displacements. This means that the $x$ and
$y$ coordinates of the displacement vector are independent random
variables, uniformly distributed over the range of possible coordinates.
This is what is usually understood by ``random toroidal shifts''
in the literature. Alternatively, the displacement vector can be generated by
another random mechanism, controlled by the arguments
radius
, width
and height
.
[object Object],[object Object]
The argument radius
is incompatible with the
arguments width
and height
.