compileCDF {spatstat.explore}R Documentation

Generic Calculation of Cumulative Distribution Function of Distances

Description

A low-level function which calculates the estimated cumulative distribution function of a distance variable.

Usage

compileCDF(D, B, r, ..., han.denom=NULL, check=TRUE)

Arguments

D

A vector giving the distances from each data point to the target.

B

A vector giving the distances from each data point to the window boundary, or censoring distances.

r

An equally spaced, finely spaced sequence of distance values at which the CDF should be estimated.

...

Ignored.

han.denom

Denominator for the Hanisch-Chiu-Stoyan estimator. A single number, or a numeric vector with the same length as r.

check

Logical value specifying whether to check validity of the data, for example, that the vectors D and B have the same length, and contain non-negative numbers.

Details

This low-level function calculates estimates of the cumulative distribution function

F(r) = P(D \le r)

of a distance variable D, given a vector of observed values of D and other information. Examples of this concept include the empty space distance function computed by Fest and the nearest-neighbour distance distribution function Gest.

This function compileCDF and its siblings compileK and compilepcf are useful for code development and for teaching, because they perform a common task, and do the housekeeping required to make an object of class "fv" that represents the estimated function. However, they are not very efficient.

The argument D should be a numeric vector of shortest distances measured from each ‘query’ point to the ‘target’ set. The argument B should be a numeric vector of shortest distances measured from each ‘query’ point to the boundary of the window of observation. All entries of D and B should be non-negative.

compileCDF calculates estimates of the cumulative distribution function F(r) using the border method (reduced sample estimator), the Kaplan-Meier estimator and, if han.denom is given, the Hanisch-Chiu-Stoyan estimator. See Chapter 8 of Baddeley, Rubak and Turner (2015).

The result is an object of class "fv" representing the estimated function. Additional columns (such as a column giving the theoretical value) must be added by the user, with the aid of bind.fv.

Value

An object of class "fv" representing the estimated function.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

References

Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press.

See Also

compileK.

bind.fv to add more columns.

Examples

  ## Equivalent to Gest(japanesepines)
  X <- japanesepines
  D <- nndist(X)
  B <- bdist.points(X)
  r <- seq(0, 0.25, by=0.01)
  H <- eroded.areas(Window(X), r)
  G <- compileCDF(D=D, B=B, r=r, han.denom=H)
  G <- rebadge.fv(G, new.fname="G", new.ylab=quote(G(r)))
  plot(G)

[Package spatstat.explore version 3.2-7 Index]