getis                 package:ecespa                 R Documentation

_N_e_i_g_h_b_o_u_r_h_o_o_d _d_e_n_s_i_t_y _f_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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,...)

_A_r_g_u_m_e_n_t_s:

   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}'. 

_D_e_t_a_i_l_s:

     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 _i_th 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 _i_th 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.

_V_a_l_u_e:

     '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

_N_o_t_e:

     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).

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     'localK', a different approach in 'spatstat'.

_E_x_a_m_p_l_e_s:

      ## 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)

