Ripley's K Function for a Spatial Point Pattern Object

DESCRIPTION:

Calculates L(t)=sqrt(K(t)/pi), where K(t) is Ripleys K function for a spatial point pattern and L(t) is linear for a completely random point process.

USAGE:

Lhat(object, maxdist=<<see below>>, ndist=100, boundary=bbox(object),  
     plot.it=T) 

REQUIRED ARGUMENTS:

object
an object of class "spp" representing a spatial point pattern, or a data frame or matrix with first two columns containing locations of a point pattern.

OPTIONAL ARGUMENTS:

maxdist
numeric value indicating the maximum distance at which Lhat should be estimated. Defaults to half the length of a diagonal of the sample's bounding box.
ndist
desired number of default distances at which to compute Lhat. Default is 100. The distances for which Lhat will be estimated are calculated as seq(0,maxdist,ndist), both maxdist and ndist will change if not reasonable for the given object.
boundary
points defining the boundary polygon for the spatial point pattern. This version accepts only rectangles, for which boundary should be given as a list with named components "x" and "y" denoting the corners of the rectangular region. For example, for the unit square the boundary could be given as bbox(x=c(0,1),y=c(0,1)), the bounding box of two diagonally opposed points. Defaults to a rectangle covering the range of points.
plot.it
logical flag: should the resulting K-estimates be plotted? Default is TRUE.

VALUE:

a list containing components :
values
a two column matrix. The first column, called dist, contains the distances at which Lhat was computed, and the second column, called Lhat, contains the values of L(dist).
ndist
number of distances returned. This could be smaller than its input value if the extent of the distances is too large.
mindist
minimum distance between any pair of points.
maxdev
maximum deviation from L(t)=t. See DETAILS.

SIDE EFFECTS:

if plot.it=TRUE, a plot of the value of L(t) against distance will be produced on the current graphics device.

DETAILS:

Khat computes Ripleys (1976) estimate of K(t) for a spatial point pattern:

K(t) = (1/intensity) * E[number of events < or = distance t of an arbitrary event].

The theoretical K-function for a Poisson completely spatially random process is K(t) = pi t^2, so L(t) = sqrt(K(t)/pi) is equal to t, the distances. The default plots L(t) versus t which should approximate a straight line for a homogeneous process with no spatial dependence. See function Khat for estimation of K(t).

REFERENCES:

Ripley, Brian D. (1976). The second-order analysis of stationary point processes. Journal of Applied Probability 13,255-266.

SEE ALSO:

, .

EXAMPLES:

lansing.spp <- as.spp(lansing) 
lansing.khat <- Lhat(lansing.spp) 
  
Lhat(wheat) 
abline(0,1)