Jsphere: Estimate the J-function

View source: R/Jsphere.R

JsphereR Documentation

Estimate the J-function

Description

Estimates the summary function J(r) for a point pattern in a window of arbitrary shape on a (subset of) a sphere.

Usage

Jsphere(X, refpoints, r=NULL, ..., correction=NULL)

Arguments

X

The observed point pattern, from which an estimate of J(r) will be computed. An object of class sp2 or sp3, or a 2 or 3 column matrix giving the locations of points in spherical coordinates.

refpoints

The reference points in the window used to estimate the F function (a prerequisite to calculating J(r), see Details section). An object of class sp2 or sp3, or a 2 or 3 column matrix giving the locations of points in spherical coordinates. If NULL, a homogeneous Poisson process with expected number of points equal to 100 is generated inside the window.

r

Optional. Numeric vector. The values of the argument r at which F(r) should be evaluated. There is a sensible default, which works well the window is either the sphere or contains a significant proportion of the sphere. First-time users are strongly advised not to specify this argument.

...

Optional. Extra detail that can be passed to eroded.areas.sphwin.

correction

The corrections to be applied. If set to NULL, all estimators are given. Specific estimators can be called using the arguments un, raw, rs, rs.modif, cs, han and km.

Details

The J function (Van Lieshout and Baddeley, 1996) of a stationary point process is defined as

J(r) = (1-G(r))/(1-F(r))

where G(r) is the nearest neighbour distance distribution function of the point process (see Gsphere) and F(r) is its empty space function (see Fsphere).

For a completely random (uniform Poisson) point process, the J-function is identically equal to 1. Deviations J(r) < 1 or J(r) > 1 typically indicate spatial clustering or spatial regularity, respectively. The J-function is one of the few characteristics that can be computed explicitly for a wide range of point processes. See Van Lieshout and Baddeley (1996), Baddeley et al (2000), Thonnes and Van Lieshout (1999) for further information.

An estimate of J derived from a spatial point pattern dataset can be used in exploratory data analysis and formal inference about the pattern. The estimate of J(r) is compared against the constant function 1. Deviations J(r) < 1 or J(r) > 1 may suggest spatial clustering or spatial regularity, respectively.

This algorithm estimates the J-function 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 X$win) may have arbitrary shape.

The argument X is interpreted as a point pattern object (of class sp2 or sp3).

The functions Fsphere and Gsphere are called to compute estimates of F(r) and G(r) respectively. These estimates are then combined by simply taking the ratio J(r) = (1-G(r))/(1-F(r)).

In fact several different estimates are computed using different edge corrections (Baddeley, 1998).

The Kaplan-Meier estimate (returned as km) is the ratio J = (1-G)/(1-F) of the Kaplan-Meier estimates of 1-F and 1-G computed by Fsphere and Gsphere respectively. This is computed if correction=NULL or if correction includes "km".

The Hanisch-style estimate (returned as han) is the ratio J = (1-G)/(1-F) using the Chiu-Stoyan estimate of F and the Hanisch estimate of G. This is computed if correction=NULL or if correction includes "cs" or "han".

The reduced-sample or border corrected estimate (returned as rs) is the same ratio J = (1-G)/(1-F) of the border corrected estimates. This is computed if correction=NULL or if correction includes "rs" or "border".

These edge-corrected estimators are slightly biased for J, since they are ratios of approximately unbiased estimators. The logarithm of the Kaplan-Meier estimate is exactly unbiased for log(J).

The uncorrected estimate (returned as un and computed only if correction includes "none") is the ratio J = (1-G)/(1-F) of the uncorrected ("raw") estimates of the survival functions of F and G, which are the empirical distribution functions of the empty space distances Fsphere(X,...)$raw and of the nearest neighbour distances Gsphere(X,...)$raw. The uncorrected estimates of F and G are severely biased. However the uncorrected estimate of J is approximately unbiased (if the process is close to Poisson); it is insensitive to edge effects, and should be used when edge effects are severe (see Baddeley et al, 2000).

The algorithm for Fsphere uses two discrete approximations which are controlled by the parameter eps and by the spacing of values of r respectively. See Fsphere for details. First-time users are strongly advised not to specify these arguments.

Note that the value returned by Jsphere includes the output of Fsphere and Gsphere as attributes (see the last example below). If the user is intending to compute the F, G and J functions for the point pattern, it is only necessary to call Jsphere.

Value

An object of class "fv", see fv.object, which can be plotted directly using plot.fv.

Essentially a data frame containing some or all of the following columns:

r

the values of the argument r at which the function J(r) has been estimated

rs

the "reduced sample" (border correction) estimator of J(r)

km

the spatial Kaplan-Meier estimator of J(r)

hazard

the hazard rate lambda(r) of J(r) by the spatial Kaplan-Meier method

raw

the uncorrected estimate of J(r), i.e. the empirical distribution of the distance from a fixed point in the window to the nearest point of X

han

the Hanisch correction estimator of J(r)

theo

the theoretical value of J(r) for a stationary Poisson process of the same estimated intensity.

The data frame also has attributes:

F

the output of Fsphere for this point pattern, containing three estimates of the empty space function F(r) and an estimate of its hazard function

G

the output of Gsphere for this point pattern, containing three estimates of the nearest neighbour distance distribution function G(r) and an estimate of its hazard function

Note

Sizeable amounts of memory may be needed during the calculation

Note

This function is the analogue for point processes on the sphere of the function Jest in spatstat, which is the corresponding function for point processes in R^2. Hence elements of the code for Jsphere and help page have been taken from Jest with the permission of A. J. Baddeley. This enables the code to be highly efficient and give corresponding output to, and for the information on this help page to be consistent with that for the function Jest. It is hoped that this will minimise or remove any confusion for users of both spatstat and spherstat.

Author(s)

Tom Lawrence <email:tjlawrence@bigpond.com>

References

Baddeley, A.J. Spatial sampling and censoring. In O.E. Barndorff-Nielsen, W.S. Kendall and M.N.M. van Lieshout (eds) Stochastic Geometry: Likelihood and Computation. Chapman and Hall, 1998. Chapter 2, pages 37–78.

Baddeley, A.J. and Gill, R.D. The empty space hazard of a spatial pattern. Research Report 1994/3, Department of Mathematics, University of Western Australia, May 1994.

Baddeley, A.J. and Gill, R.D. Kaplan-Meier estimators of interpoint distance distributions for spatial point processes. Annals of Statistics 25 (1997) 263–292.

Baddeley, A., Kerscher, M., Schladitz, K. and Scott, B.T. Estimating the J function without edge correction. Statistica Neerlandica 54 (2000) 315–328.

Borgefors, G. Distance transformations in digital images. Computer Vision, Graphics and Image Processing 34 (1986) 344–371.

Cressie, N.A.C. Statistics for spatial data. John Wiley and Sons, 1991.

Diggle, P.J. Statistical analysis of spatial point patterns. Academic Press, 1983.

Lawrence, T.J. (2017) Master's Thesis, University of Western Australia.

Ripley, B.D. Statistical inference for spatial processes. Cambridge University Press, 1988.

Stoyan, D, Kendall, W.S. and Mecke, J. Stochastic geometry and its applications. 2nd edition. Springer Verlag, 1995.

Thonnes, E. and Van Lieshout, M.N.M, A comparative study on the power of Van Lieshout and Baddeley's J-function. Biometrical Journal 41 (1999) 721–734.

Van Lieshout, M.N.M. and Baddeley, A.J. A nonparametric measure of spatial interaction in point patterns. Statistica Neerlandica 50 (1996) 344–361.

See Also

Jest, Ksphere Fsphere, Gsphere.

Examples

sph <- sphwin(type="sphere")
sph.pp <- rpoispp.sphwin(win=sph, lambda=10)
sph.ref <- rpoispp.sphwin(win=sph, lambda=150)
sph.Jest <- Jsphere(X=sph.pp, refpoints=sph.ref)

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.