rNeymanScott {spatstat.random}R Documentation

Simulate Neyman-Scott Process

Description

Generate a random point pattern, a realisation of the Neyman-Scott cluster process.

Usage

 rNeymanScott(kappa, expand, rcluster, win = unit.square(),
              ..., nsim=1, drop=TRUE,
              nonempty=TRUE, saveparents=TRUE,
              kappamax=NULL, mumax=NULL)

Arguments

kappa

Intensity of the Poisson process of cluster centres. A single positive number, a function, or a pixel image.

expand

Size of the expansion of the simulation window for generating parent points. A single non-negative number.

rcluster

A function which generates random clusters, or other data specifying the random cluster mechanism. See Details.

win

Window in which to simulate the pattern. An object of class "owin" or something acceptable to as.owin.

...

Arguments passed to rcluster.

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.

nonempty

Logical. If TRUE (the default), a more efficient algorithm is used, in which parents are generated conditionally on having at least one offspring point. If FALSE, parents are generated even if they have no offspring. Both choices are valid; the default is recommended unless you need to simulate all the parent points for some other purpose.

saveparents

Logical value indicating whether to save the locations of the parent points as an attribute.

kappamax

Optional. Upper bound on the values of kappa when kappa is a function or pixel image.

mumax

Optional. Upper bound on the values of mu when mu=rcluster[[1]] is a function or pixel image.

Details

This algorithm generates a realisation of the general Neyman-Scott process, with the cluster mechanism given by the function rcluster.

First, the algorithm generates a Poisson point process of “parent” points with intensity kappa in an expanded window as explained below. Here kappa may be a single positive number, a function kappa(x,y), or a pixel image object of class "im" (see im.object). See rpoispp for details.

Second, each parent point is replaced by a random cluster of points. These clusters are combined together to yield a single point pattern, and the restriction of this pattern to the window win is then returned as the result of rNeymanScott.

The expanded window consists of as.rectangle(win) extended by the amount expand in each direction. The size of the expansion is saved in the attribute "expand" and may be extracted by attr(X, "expand") where X is the generated point pattern.

The argument rcluster specifies the cluster mechanism. It may be either:

If required, the intermediate stages of the simulation (the parents and the individual clusters) can also be extracted from the return value of rNeymanScott through the attributes "parents" and "parentid". The attribute "parents" is the point pattern of parent points. The attribute "parentid" is an integer vector specifying the parent for each of the points in the simulated pattern.

Neyman-Scott models where kappa is a single number and rcluster = list(mu,f) can be fitted to data using the function kppm.

Value

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

Additionally, some intermediate results of the simulation are returned as attributes of this point pattern: see Details.

Inhomogeneous Neyman-Scott Processes

There are several different ways of specifying a spatially inhomogeneous Neyman-Scott process:

Note that if kappa is an image, the spatial domain covered by this image must be large enough to include the expanded window in which the parent points are to be generated. This requirement means that win must be small enough so that the expansion of as.rectangle(win) is contained in the spatial domain of kappa. As a result, one may wind up having to simulate the process in a window smaller than what is really desired.

In the first two cases, the intensity of the Neyman-Scott process is equal to kappa * mu if at least one of kappa or mu is a single number, and is otherwise equal to an integral involving kappa, mu and f.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

and Rolf Turner rolfturner@posteo.net

References

Neyman, J. and Scott, E.L. (1958) A statistical approach to problems of cosmology. Journal of the Royal Statistical Society, Series B 20, 1–43.

Waagepetersen, R. (2007) An estimating function approach to inference for inhomogeneous Neyman-Scott processes. Biometrics 63, 252–258.

See Also

rpoispp, rThomas, rGaussPoisson, rMatClust, rCauchy, rVarGamma

Examples

  # each cluster consist of 10 points in a disc of radius 0.2
  nclust <- function(x0, y0, radius, n) {
              return(runifdisc(n, radius, centre=c(x0, y0)))
            }
  plot(rNeymanScott(10, 0.2, nclust, radius=0.2, n=5))

  # multitype Neyman-Scott process (each cluster is a multitype process)
  nclust2 <- function(x0, y0, radius, n, types=c("a", "b")) {
     X <- runifdisc(n, radius, centre=c(x0, y0))
     M <- sample(types, n, replace=TRUE)
     marks(X) <- M
     return(X)
  }
  plot(rNeymanScott(15,0.1,nclust2, radius=0.1, n=5))

[Package spatstat.random version 3.3-1 Index]