Fest(X, eps, r=NULL, breaks=NULL)
ppp
, or data
in any format acceptable to as.ppp()
.r
.
Not normally invoked by the user. See the Details section."fv"
, see fv.object
,
which can be plotted directly using plot.fv
.Essentially a data frame containing six columns:
X
The spatial Kaplan-Meier estimator of $F$ is always nondecreasing but its maximum value may be less than $1$.
The estimate of $\lambda(r)$ returned by the algorithm is an approximately unbiased estimate for the integral of $\lambda()$ over the corresponding histogram cell. It may exhibit oscillations due to discretisation effects. We recommend modest smoothing, such as kernel smoothing with kernel width equal to the width of a histogram cell.
An estimate of $F$ 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 $F$ is a useful statistic summarising the sizes of gaps in the pattern. For inferential purposes, the estimate of $F$ is usually compared to the true value of $F$ for a completely random (Poisson) point process, which is $$F(r) = 1 - e^{ - \lambda \pi r^2}$$ where $\lambda$ is the intensity (expected number of points per unit area). Deviations between the empirical and theoretical $F$ curves may suggest spatial clustering or spatial regularity.
This algorithm estimates the empty space function $F$
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
) may have arbitrary shape.
The argument X
is interpreted as a point pattern object
(of class "ppp"
, see ppp.object
) and can
be supplied in any of the formats recognised
by as.ppp
.
The algorithm uses two discrete approximations which are controlled
by the parameter eps
and by the spacing of values of r
respectively. (See below for details.)
First-time users are strongly advised not to specify these arguments.
The estimation of $F$ 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 two edge corrections implemented here are the border method or "reduced sample" estimator, and the spatial Kaplan-Meier estimator (Baddeley and Gill, 1997).
Our implementation makes essential use of the distance transform algorithm of image processing (Borgefors, 1986). A fine grid of pixels is created in the observation window. The Euclidean distance between two pixels is approximated by the length of the shortest path joining them in the grid, where a path is a sequence of steps between adjacent pixels, and horizontal, vertical and diagonal steps have length $1$, $1$ and $\sqrt 2$ respectively in pixel units. If the pixel grid is sufficiently fine then this is an accurate approximation.
The parameter eps
is the pixel width of the rectangular raster
used to compute the distance transform (see below). It must not be too
large: the absolute error in distance values due to discretisation is bounded
by eps
.
If eps
is not specified, the function
checks whether the window X$window
contains pixel raster
information. If so, then eps
is set equal to the
pixel width of the raster; otherwise, eps
defaults to 1/100 of the width of the observation window.
The argument r
is the vector of values for the
distance $r$ at which $F(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 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.
First-time users would be strongly advised not to specify r
.
However, if it is specified, r
must satisfy r[1] = 0
,
and max(r)
must be larger than the radius of the largest disc
contained in the window. Furthermore, the spacing of successive
r
values must be very fine (ideally not greater than eps/4
).
The algorithm also returns an estimate of the hazard rate function, $\lambda(r)$, of $F(r)$. The hazard rate is defined by $$\lambda(r) = - \frac{d}{dr} \log(1 - F(r))$$ The hazard rate of $F$ has been proposed as a useful exploratory statistic (Baddeley and Gill, 1994). The estimate of $\lambda(r)$ given here is a discrete approximation to the hazard rate of the Kaplan-Meier estimator of $F$. Note that $F$ is absolutely continuous (for any stationary point process $X$), so the hazard function always exists (Baddeley and Gill, 1997).
The naive empirical distribution of distances from each location in the window to the nearest point of the data pattern, is a biased estimate of $F$. 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 $F$ as if it were an unbiased estimator of $F$.
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.
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.
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.
Gest
,
Jest
,
Kest
,
km.rs
,
reduced.sample
,
kaplan.meier
data(cells)
Fc <- Fest(cells, 0.01)
# Tip: don't use F for the left hand side!
# That's an abbreviation for FALSE
plot(Fc)
# P-P style plot
plot(Fc, cbind(km, theo) ~ theo)
# The empirical F is above the Poisson F
# indicating an inhibited pattern
plot(Fc, . ~ theo)
plot(Fc, asin(sqrt(.)) ~ asin(sqrt(theo)))
Run the code above in your browser using DataLab