G3cross: Multitype Nearest Neighbour Distance Function (i-to-j)

View source: R/rapt_extend.R

G3crossR Documentation

Multitype Nearest Neighbour Distance Function (i-to-j)

Description

For a multitype point pattern, estimate the distribution of the distance from a point of type i to the nearest point of type j.

Usage

G3cross(X, i, j, rmax = NULL, nrval = 128, correction = c("rs", "km", "han"))

Arguments

X

The observed point pattern, from which an estimate of the cross type distance distribution function G[3ij](r) will be computed. It must be a multitype point pattern (a marked point pattern whose marks are a factor). See Details.

i

The type (mark value) of the points in X from which distances are measured. A character string (or something that will be converted to a character string). Defaults to the first level of marks(X).

j

The type (mark value) of the points in X to which distances are measured. A character string (or something that will be converted to a character string). Defaults to the second level of marks(X).

rmax

Optional. Maximum value of argument r for which G[3ij](r) will be estimated.

nrval

Optional. Number of values of r for which G[3ij](r) will be estimated. A large value of nrval is required to avoid discretisation effects.

correction

Optional. Character string specifying the edge correction(s) to be used. Options are "none", "rs", "km", "hanisch", and "best". Alternatively correction="all" selects all options.

Details

The function G3cross and its companions G3dot (unimplemented) and G3multi are generalisations of the function G3est to multitype point patterns.

A multitype point pattern is a spatial pattern of points classified into a finite number of possible "colors" or "types." In the spatstat package, a multitype pattern is represented as a single point pattern object in which the points carry marks, and the mark value attached to each point determines the type of that point.

The argument X must be a point pattern (object of class "pp3"). It must be a marked point pattern, and the mark vector X$marks must be a factor. The arguments i and j will be interpreted as levels of the factor X$marks. (Warning: this means that an integer value i=3 will be interpreted as the number 3, not the 3rd smallest level).

The "cross-type" (type i to type j) nearest neighbour distance distribution function of a multitype point process is the cumulative distribution function G[3ij](r) of the distance from a typical random point of the process with type i the nearest point of type j.

An estimate of G[3ij](r) is a useful summary statistic in exploratory data analysis of a multitype point pattern. If the process of type i points were independent of the process of type j points, then G[3ij](r) would equal F[3j](r), the empty space function of the type j points. For a multitype Poisson point process where the type i points have intensity λ[i], we have

G[3ij](r) = 1 - exp( - λ[j] * (4/3) * pi * r^3)

Deviations between the empirical and theoretical G[3ij](r) curves may suggest dependence between the points of types i and j.

This algorithm estimates the distribution function G[3ij](r) from the point pattern X. It assumes that X can be treated as a realisation of a stationary (spatially homogeneous) random spatial point process in the plane, observed through a bounded window. The window (which is specified in X as Domain(X)) may have arbitrary shape. Biases due to edge effects are treated in the same manner as in G3est.

The argument rmax is the maximum value of the distance r at which G[3ij](r) should be evaluated. It is also used to determine (in combination with nrval) the breakpoints (in the sense of hist) for the computation of histograms of distances. The reduced-sample and Kaplan-Meier estimators are computed from histogram counts. In the case of the Kaplan-Meier estimator this introduces a discretisation error which is controlled by the fineness of the breakpoints.

The algorithm also returns an estimate of the hazard rate function, lambda(r), of G[3ij](r). This estimate should be used with caution as G[3ij](r) is not necessarily differentiable.

The naive empirical distribution of distances from each point of the pattern X to the nearest other point of the pattern, is a biased estimate of G[3ij](r). However this is also returned by the algorithm, as it is sometimes useful in other contexts. Care should be taken not to use the uncorrected empirical G[3ij](r) as if it were an unbiased estimator of G[3ij](r).

Value

An object of class "fv" (see fv.object).

See Also

G3multi, G3est, marks

Other spatstat extensions: G3multi(), K3scaled(), Tstat.pp3(), bdist.points(), marktable.pp3(), marktable(), quadratcount.pp3(), quadrats.pp3(), rPoissonCluster3(), rjitter.pp3(), rjitter.ppp(), rjitter(), rpoint3(), sample.pp3(), sample.ppp(), shift.pp3(), studpermu.test.pp3(), studpermu.test(), superimpose.pp3()


aproudian2/rapt documentation built on Dec. 15, 2022, 4:24 a.m.