Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rcell

Simulate Baddeley-Silverman Cell Process


Description

Generates a random point pattern, a simulated realisation of the Baddeley-Silverman cell process model.

Usage

rcell(win=square(1), nx=NULL, ny=nx, ..., dx=NULL, dy=dx,
       N=10, nsim=1, drop=TRUE)

Arguments

win

A window. An object of class owin, or data in any format acceptable to as.owin().

nx

Number of columns of cells in the window. Incompatible with dx.

ny

Number of rows of cells in the window. Incompatible with dy.

...

Ignored.

dx

Width of the cells. Incompatible with nx.

dy

Height of the cells. Incompatible with ny.

N

Integer. Distributional parameter: the maximum number of random points in each cell. Passed to rcellnumber.

nsim

Number of simulated realisations to be generated.

drop

Logical. If nsim=1 and drop=TRUE (the default), the result will be a point pattern, rather than a list containing a point pattern.

Details

This function generates a simulated realisation of the “cell process” (Baddeley and Silverman, 1984), a random point process with the same second-order properties as the uniform Poisson process. In particular, the K function of this process is identical to the K function of the uniform Poisson process (aka Complete Spatial Randomness). The same holds for the pair correlation function and all other second-order properties. The cell process is a counterexample to the claim that the K function completely characterises a point pattern.

A cell process is generated by dividing space into equal rectangular tiles. In each tile, a random number of random points is placed. By default, there are either 0, 1 or 10 points, with probabilities 1/10, 8/9 and 1/90 respectively. The points within a tile are independent and uniformly distributed in that tile, and the numbers of points in different tiles are independent random integers.

The tile width is determined either by the number of columns nx or by the horizontal spacing dx. The tile height is determined either by the number of rows ny or by the vertical spacing dy. The cell process is then generated in these tiles. The random numbers of points are generated by rcellnumber.

Some of the resulting random points may lie outside the window win: if they do, they are deleted. The result is a point pattern inside the window win.

Value

A point pattern (an object of class "ppp") if nsim=1, or a list of point patterns if nsim > 1.

Author(s)

References

Baddeley, A.J. and Silverman, B.W. (1984) A cautionary example on the use of second-order methods for analyzing point patterns. Biometrics 40, 1089-1094.

See Also

Examples

X <- rcell(nx=15)
  plot(X)
  plot(Kest(X))

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.