getis {ecespa}R Documentation

Neighbourhood density function

Description

Computes and plots the neighbourhood density function, a local version of the K-function defined by Getis and Franklin (1987).

Usage

getis(mippp, nx = 30, ny = 30, R = 10)

## S3 method for class 'ecespa.getis':
plot(x, type="k", interp=100, color=tim.colors(64),
         contour=TRUE, points=TRUE,...)

Arguments

mippp A point pattern. An object with the ppp format of spatstat.
nx Grid dimensions (for estimation) in the x-side.
ny Grid dimensions (for estimation) in the y-side.
R Radius. The distance argument r at which the function K should be computed.
x Result of applying getis to a point pattern.
type Type of local statistics to be ploted. One of k (local-K), l (local-L), n (local-n) or d (deviations from CSR).
interp Number of points in the side of the grid of points to interpolate the results.
color A list of colors such as that generated by rainbow, heat.colors, topo.colors, terrain.colors or similar functions.
contour Logical; if TRUE, add a contour to current plot.
points Logical; if TRUE, add the point pattern to current plot.
... Additional graphical parameters passed to link{plot}.

Details

Getis and Franklin (1987) proposed the neigbourhood density function, a local version of Ripley's L- function. Given a spatial point pattern X, the neigbourhood density function associated with the ith point in X is computed by

L[i](r) = sqrt((a/((n-1))*pi))*sum[j]e[i,j])

where the sum is over all points j != i that lie within a distance r of the ith point, a is the area of the observation window, n is the number of points in X, and e[i,j] is the isotropic edge correction term (as described in Kest). The value of L[i](r) can also be interpreted as one of the summands that contributes to the global estimate of the L-function.

The command getis actually computes the local K-function using Kcross. As the main objective of getis is to map the local density function, as sugested by Gestis and Franklin (1987: 476) a grid of points (whose density is controled by nx and ny), is used to accurately estimate the functions in empty or sparse areas. The S3 method plot.ecespa.getis plots the spatial distribution of the local K or L function or other related local statistics, such as n[i](r), the number of neighbor points [= lambda*K[i](r)] or the deviations from the expected value of local L under CSR [= L[i](r) -r]. It uses the function interp in akima package to interpolate the results.

Value

getis gives an object of class ecespa.getis, bassically a list with the following elements:

x x coordinates of pattern points (ahead) and grid points.
y y coordinates of pattern points (ahead) and grid points.
klocal Estimate of local K[i](r) at the point pattern points.
klocalgrid Estimate of local K[i](r) at the grid points.
R Distance r at which the estimation is made.
nx Density of the estimating grid in the x-side.
ny Density of the estimating grid in the x-side.
dataname Name of the ppp object analysed.
ppp Original point pattern.


plot.ecespa.getis plots an interpolated map of the selected local statistics

Note

As plot.ecespa.getis interpolates over rectangular grid of points, it is not apropriate to map irregular windows. In those cases, smooth.ppp of spatstat can be used to interpolate the local statistics (see examples).

Author(s)

Marcelino de la Cruz Rot marcelino.delacruz@upm.es

References

Getis, A. and Franklin, J. 1987. Second-order neighbourhood analysis of mapped point patterns. Ecology 68: 473-477

See Also

localK, a different approach in spatstat.

Examples

 ## Not run: 
  ## Compare with fig. 5b of Getis & Franklin (1987: 476):
  
  data(ponderosa)
  
  ponderosa12 <- getis(ponderosa, nx = 30, ny = 30, R = 12)
  
  plot(ponderosa12, type = "l")

  ## Plot the same, using smooth.ppp in spatstat
  
  ponderosa.12 <- setmarks(ponderosa, ponderosa12$klocal)
  
  Z <- smooth.ppp(ponderosa.12, sigma=5, dimyx=256)
  
  plot(Z, col=topo.colors(128), main="smoothed neighbourhood density")
  
  contour(Z, add=TRUE)
  
  points(ponderosa, pch=16, cex=0.5) 
  
  ## Example with irregular window:
  
  data(letterR)
  
  X <- rpoispp(50, win=letterR)
  
  X.g <- getis(X, R=0.2)
  
  X2 <- setmarks(X, X.g$klocal)
  
  Z <- smooth.ppp(X2, sigma=0.05, dimxy=256)
  
  plot(Z, col=topo.colors(128), main="smoothed neighbourhood density")
  
  contour(Z, add=TRUE)
  
  points(X, pch=16, cex=0.5)
  
    
    ## End(Not run)

[Package ecespa version 1.1-1 Index]