Gsphere | R Documentation |
Using a number of methods, this function estimates the nearest neighbour distance distribution function G(r) from a point pattern in a window of arbitrary shape on a sphere. If the window is the entire sphere, one of the methods used gives the exact value of the G function.
Gsphere(X, win = sphwin(type = "sphere"), r = NULL, ...)
X |
The observed point pattern, from which an estimate of |
win |
The window; an object of type |
r |
Optional. Numeric vector. The values of the argument r at which G(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
|
The nearest neighbour distance distribution function (also called the "event-to-event", or the "inter-event" distribution) of a point process X
is the cumulative distribution function G of the distance from a typical random point of X
to the nearest other point of X
.
An estimate of G derived from a spatial point pattern dataset can be used in exploratory data analysis and formal inference about the pattern (Cressie, 1991; Diggle, 1983; Ripley, 1988). In exploratory analyses, the estimate of G is a useful statistic summarising one aspect of the "clustering" of points. For inferential purposes, the estimate of G is usually compared to the true value of G for a completely random (Poisson) point process, which is
G(r) = 1 - exp( - 2 * pi * rho * lambda * (1-cos(r/rho))
where lambda is the intensity (expected number of points per unit area) and rho is the radius of the sphere in which X
is observed. Deviations between the empirical and theoretical G curves may suggest spatial clustering or spatial regularity.
This algorithm estimates the nearest neighbour distance distribution function G from the point pattern X
. It assumes that X
can be treated as a realisation of a homogeneous random spatial point process on a sphere. The window (subset of the sphere) in which X
is observed may be the any of those that can be defined using sphwin
.
The estimation of G for a window other than the entire sphere is hampered by edge effects arising from the unobservability of points of the random pattern outside the window. An edge correction is needed to reduce bias (Baddeley, 1998; Ripley, 1988). The edge corrections implemented here are the border method ("reduced sample") estimator, the spatial Kaplan-Meier estimator (Baddeley and Gill, 1997) and the Hanisch estimator (Hanisch, 1984).
The argument r
is the vector of values for the distance r
at which G(r)
should be evaluated. It is also used to determine the breakpoints (in the sense of hist
) for the computation of histograms of distances. The estimators are computed from histogram counts. This introduces a discretisation error which is controlled by the fineness of the breakpoints. The default value of r
is best suited when the window is a sphere or a significant proportion of a sphere; for smaller subsets of the sphere the default value will still give a valid estimate of the G function but the eroded areas function will reach zero sooner, and the value at which that function reaches 0 is the upper limit of r
for the G function.
First-time users would be strongly advised not to specify r
. However, if it is specified, r
must satisfy r[1] = 0
, have length 512, and max(r)
must be larger than the radius of the largest disc contained in the window. Furthermore, the successive entries of r
must be finely spaced.
The algorithm also returns an estimate of the hazard rate function, lambda(r), of G(r). The hazard rate is defined as the derivative
lambda(r) = - (d/dr) log(1 - G(r))
This estimate should be used with caution as G 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 the exact value of G when the window is the sphere, and a biased estimate of G otherwise. However, in the latter case it is sometimes useful. It is automatically returned by the algorithm. Care should be taken not to use the uncorrected empirical G as if it were an unbiased estimator of G.
To simply compute the nearest neighbour distance for each point in the pattern, use nndistsph
.
If X
is an object of class sp2
or sp3
, then its radius is used in this calculation; otherwise, the radius of win
is used.
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 G(r) has been estimated |
rs |
the "reduced sample" (border correction) estimator of G(r) |
km |
the spatial Kaplan-Meier estimator of G(r) |
hazard |
the hazard rate lambda(r) of G(r) by the spatial Kaplan-Meier method |
raw |
the uncorrected estimate of G(r), i.e. the empirical distribution of the distances from each point in the pattern |
han |
the Hanisch correction estimator of G(r) |
rs.modif |
the "modified reduced sample" (modified border correction) estimator of G(r) |
theo |
the theoretical value of G(r) for a stationary Poisson process of the same estimated intensity. |
The function G does not necessarily have a density. Any valid c.d.f. may appear as the nearest neighbour distance distribution function of a stationary point process.
The reduced sample estimator of G is pointwise approximately unbiased, but need not be a valid distribution function; it may not be a nondecreasing function of r
. Its range is always within [0,1]
.
The spatial Kaplan-Meier estimator of G is always nondecreasing but its maximum value may be less than 1.
This function is the analogue for point processes on the sphere of the function Gest
in spatstat, which is the corresponding function for point processes in R^2. Hence elements of the code for Gest
and this help page have been taken from Gest
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 Gest
. It is hoped that this will minimise or remove any confusion for users of both spatstat and spherstat.
Tom Lawrence <email:tjlawrence@bigpond.com>
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, pp. 37–78.
Baddeley, A J. and Gill, R.D. (1997) Kaplan-Meier estimators of interpoint distance distributions for spatial point processes. Annals of Statistics 25 pp.263–292.
Bahcall, J. N. and Soneira, R. M. (1981) The distribution of stars to $V=16$th magnitude near the north galactic pole: normalization, clustering properties and counts in various bands Astrophysical Journal, 246, pp. 122–135.
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.
Hanisch, K.-H. (1984) Some remarks on estimators of the distribution function of nearest-neighbour distance in stationary spatial point patterns. Mathematische Operationsforschung und Statistik, series Statistics 15, pp.409–412.
Lawrence, T.J. (2017) Master's Thesis, University of Western Australia.
Ripley, B.D. Statistical inference for spatial processes. Cambridge University Press, 1988.
Robeson, S., Li, A., and Huang C. (2014) Point pattern analysis on the sphere Spatial Statistics, 10, pp. 76–86.
Scott, D. and Tout C. A. (1989) Nearest neighbour analysis of random distributions on a sphere. Mon. Not. R. astr. Soc. 241, pp. 109–117.
Stoyan, D, Kendall, W.S. and Mecke, J. Stochastic geometry and its applications. 2nd edition. Springer Verlag, 1995.
Fsphere
, Jsphere
, Ksphere
, Gest
sph <- sphwin(type="sphere") sph.pp <- rpoispp.sphwin(win=sph, lambda=10) sph.Gest <- Gsphere(X=sph.pp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.