Random Toroidal Shift of Point Pattern
Applies a random shift simultaneously to all the points of a point pattern, or to selected sub-patterns, with wraparound at the borders of the window.
- Point pattern to be subjected to random shift.
An object of class
- Identifies which components of the pattern will be shifted.
Vector of marks (if
Xis a multitype point pattern) or subset of
"splitppp"object). Each component will be shi
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).
X may be either
- a point pattern
(an object of class
- an object of class
"splitppp"(basically a list of point patterns, obtained from
Xis a point pattern object, all the points of the pattern are shifted simultaneously by the same displacement vector.
Xis an object of class
"splitppp"then each of the component point patterns is randomly shifted by a different displacement vector.
whichidentifies which sub-patterns of
Xwill be subjected to random shifts. Different sub-patterns will be shifted by different displacement vectors. If
Xis a point pattern object, it should be a multitype pattern (i.e.
X$marksmust be a factor). Then
whichshould be a vector of types (i.e. a vector containing one or more levels of
X$marks). For each value
which, the sub-pattern of
Xconsisting of points of type
aonly will be extracted, and subjected to a random toroidal shift. A different shift will be applied to different sub-patterns. The points not selected by
whichwill be unchanged.
Xis an object of class
whichcan be any valid subset index for the list
X. For example
whichcould be a vector of names of components in the list
X. Each selected component point pattern will be shifted by a different displacement vector.
- An object of the same type as
data(amacrine) # point patterns: # shift all points simultaneously X <- rtoro(amacrine) # shift "on" and "off" points separately X <- rtoro(amacrine, which=amacrine$marks) # shift "on" points and leave "off" points fixed X <- rtoro(amacrine, which="on") # splitppp objects: Y <- split(amacrine) # shift "on" and "off" points separately Z <- rtoro(Y) # shift "on" points and leave "off" points fixed Z <- rtoro(Y, "on") # shift all points simultaneously Z <- split(rtoro(superimpose(Y)))