rclusterBKBC: Simulate Cluster Process using Brix-Kendall Algorithm or...

View source: R/rclusterBKBC.R

rclusterBKBCR Documentation

Simulate Cluster Process using Brix-Kendall Algorithm or Modifications

Description

Generates simulated realisations of a stationary Neyman-Scott cluster point process, using the Brix-Kendall (2002) algorithm or various modifications proposed by Baddeley and Chang (2023). For advanced research use.

Usage

rclusterBKBC(clusters="Thomas",
   kappa, mu, scale,
   ...,
   W = unit.square(),
   nsim = 1, drop = TRUE,
   best = FALSE,
   external = c("BK", "superBK", "border"),
   internal = c("dominating", "naive"),
   inflate = 1,
   psmall = 1e-04,
   use.inverse=TRUE,
   use.special=TRUE,
   integralmethod=c("quadrature", "trapezoid"),
   verbose = TRUE, warn=TRUE)

Arguments

clusters

Character string (partially matched) specifying the cluster process. Current options include "Thomas", "MatClust", "Cauchy" and "VarGamma".

kappa

Intensity of the parent process. A nonnegative number.

mu

Mean number of offspring per parent. A nonnegative number.

scale

Cluster scale. Interpretation depends on the model.

...

Additional arguments controlling the shape of the cluster kernel, if any.

W

Window in which the simulation should be generated. An object of class "owin".

nsim

The number of simulated point patterns to be generated. A positive integer.

drop

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

best

Logical value. If best=TRUE, the code will choose the fastest algorithm. If best=FALSE (the default), the algorithm will be specified by the other arguments external and internal. See Details.

external

Algorithm to be used to generate parent points which lie outside the bounding window. See Details.

internal

Algorithm to be used to generate parent points which lie inside the bounding window. See Details.

inflate

Numerical value determining the position of the bounding window. See Details.

psmall

Threshold of small probability for use in the algorithm.

use.inverse

Logical value specifying whether to compute the inverse function analytically, if possible (use.inverse=TRUE, the default) or by numerical root-finding (use.inverse=FALSE). This is mainly for checking validity of code.

use.special

Logical value specifying whether to use efficient special code (if available) to generate the simulations (use.special=TRUE, the default) or to use generic code (use.special=FALSE). This is mainly for checking validity of code.

integralmethod

Character string (partially matched) specifying how to perform numerical computation of integrals when required. This argument is passed to indefinteg. The default integralmethod="quadrature" is accurate but can be slow. Faster, but possibly less accurate, integration can be performed by setting integralmethod="trapezoid".

verbose

Logical value specifying whether to print detailed information about the simulation algorithm during execution.

warn

Logical value specifying whether to issue a warning if the number of random proposal points is very large.

Details

This function is intended for advanced research use. It implements the algorithm of Brix and Kendall (2002) for generating simulated realisations of a stationary Neyman-Scott process, and various modifications of this algorithm proposed in Baddeley and Chang (2023). It is an alternative to rNeymanScott.

The function supports the following models:

  • clusters="Thomas": the (modified) Thomas cluster process which can also be simulated by rThomas.

  • clusters="MatClust": the \Matern cluster process which can also be simulated by rMatClust.

  • clusters="Cauchy": the Cauchy cluster process which can also be simulated by rCauchy.

  • clusters="VarGamma": the variance-gamma cluster process which can also be simulated by rVarGamma.

  • any other Poisson cluster process models that may be recognised by kppm.

By default, the code executes the original Brix-Kendall algorithm described in Sections 2.3 and 3.1 of Brix and Kendall (2002).

Modifications of this algorithm, proposed in Baddeley and Chang (2023), can be selected using the arguments external and internal, or best.

If best=TRUE, the code will choose the algorithm that would run fastest with the given parameters. If best=FALSE (the default), the choice of algorithm is determined by the arguments external and internal.

First the window W is enclosed in a disc D and Monte Carlo proposal densities are defined with reference to D as described in Brix and Kendall (2002). Then D is inflated by the scale factor inflate to produce a larger disc E (by default inflate=1 implying E=D). Then the parent points of the clusters are generated, possibly using different mechanisms inside and outside E.

The argument external determines the algorithm for generating parent points outside E.

  • If external="BK" (the default), proposed parents outside E will be generated from a dominating point process as described in Section 3.1 of Brix and Kendall (2002). These points will be thinned to obtain the correct intensity of parent points. For each accepted parent, offspring points are generated inside D, subject to the condition that the parent has at least one offspring inside D. Offspring points are subsequently clipped to the true window W.

  • If external="superBK", proposed parents will initially be generated from a process that dominates the dominating point process as described in Baddeley and Chang (2023). These proposals will then be thinned to obtain the correct intensity of the dominating process, then thinned again to obtain the correct intensity of parent points. This procedure reduces computation time when scale is large. For each accepted parent, offspring points are generated inside D, subject to the condition that the parent has at least one offspring inside D. Offspring points are subsequently clipped to the true window W.

  • If external="border" then proposed parents will be generated with uniform intensity in a border region surrounding the disc D. For each proposed parent, offspring points are generated in the entire plane according to the cluster offspring distribution, without any restriction. Offspring points are subsequently clipped to the true window W. This is the technique currently used in rNeymanScott.

The argument internal determines the algorithm for generating proposed parent points inside E.

  • If internal="dominating", parent points in E are generated according to the dominating point process described in Sections 2.3 and 3.1 of Brix and Kendall (2002), and then thinned to obtain the correct intensity of parent points. For each accepted parent, offspring points are generated inside D, subject to the condition that the parent has at least one offspring inside D. Offspring points are subsequently clipped to the true window W.

  • If internal="naive", parent points in E are generated with uniform intensity inside E and are not thinned. For each proposed parent, offspring points are generated in the entire plane according to the cluster offspring distribution, without any restriction. Offspring points are subsequently clipped to the true window W. This is the technique currently used in rNeymanScott.

If warn=TRUE, then a warning will be issued if the number of random proposal points (proposed parents and proposed offspring) is very large. The threshold is spatstat.options("huge.npoints"). This warning has no consequences, but it helps to trap a number of common problems.

Value

A point pattern, or a list of point patterns.

If nsim=1 and drop=TRUE, the result is a point pattern (an object of class "ppp").

Otherwise, the result is a list of nsim point patterns, and also belongs to the class "solist".

Author(s)

\adrian

and \yamei.

References

\baddchangclustersim

Brix, A. and Kendall, W.S. (2002) Simulation of cluster point processes without edge effects. Advances in Applied Probability 34, 267–280.

See Also

rNeymanScott, rMatClust, rThomas, rCauchy, rVarGamma

Examples

  Y <- rclusterBKBC("Thomas", 10,5,0.2)
  Y
  Z <- rclusterBKBC("VarGamma", 10,5,0.2,
          nu=-1/4,
          internal="naive", external="super",
          verbose=FALSE)

spatstat.random documentation built on Oct. 22, 2023, 1:17 a.m.