Kinhom               package:spatstat               R Documentation

_I_n_h_o_m_o_g_e_n_e_o_u_s _K-_f_u_n_c_t_i_o_n

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

     Estimates the inhomogeneous K function of a non-stationary point
     pattern.

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

       Kinhom(X, lambda, r = NULL, breaks = NULL, slow = FALSE,
         correction=c("border", "bord.modif", "isotropic", "translate"),
         ..., lambda2
     )

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

       X: The observed data point pattern, from which an estimate of
          the inhomogeneous K function will be computed. An object of
          class '"ppp"' or in a format recognised by 'as.ppp()' 

  lambda: Vector of values of the estimated intensity function,
          evaluated at the points of the pattern 'X'. 

       r: vector of values for the argument r at which the
          inhomogeneous K function should be evaluated. Not normally
          given by the user; there is a sensible default. 

  breaks: An alternative to the argument 'r'. Not normally invoked by
          the user. See Details. 

    slow: Not normally given by the user.  Logical flag which selects
          the algorithm used to compute the inhomogeneous K function.
          The default ('slow=FALSE') is faster than the alternative
          ('slow=TRUE'). The slow algorithm is retained for internal
          purposes as a check on validity. 

correction: A character vector containing any selection of the options
          '"border"', '"bord.modif"', '"isotropic"', '"Ripley"' or
          '"translate"'. It specifies the edge correction(s) to be
          applied. 

     ...: Currently ignored. 

 lambda2: Advanced use only. Matrix containing estimates of the
          products lambda(x[i]) * lambda(x[j]) of the intensities at
          each pair of data points  x[i] and x[j].  

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

     This computes a generalisation of the K function for inhomogeneous
     point patterns, proposed by Baddeley, Moller and Waagepetersen
     (2000).

     The ``ordinary'' K function (variously known as the reduced second
     order moment function and Ripley's K function), is described under
     'Kest'. It is defined only for stationary point processes.

     The inhomogeneous K function Kinhom(r) is a direct generalisation
     to nonstationary point processes. Suppose x is a point process
     with non-constant intensity lambda(u) at each location u. Define
     Kinhom(r) to be the expected value, given that u is a point of x,
     of the sum of all terms 1/lambda(u)lambda(x[j]) over all points
     x[j] in the process separated from u by a distance less than r.
     This reduces to the ordinary K function if lambda() is constant.
     If x is an inhomogeneous Poisson process with intensity function
     lambda(u), then Kinhom(r) = pi * r^2.

     This allows us to inspect a point pattern for evidence of 
     interpoint interactions after allowing for spatial inhomogeneity
     of the pattern. Values  Kinhom(r) > pi * r^2 are suggestive of
     clustering.

     The argument 'lambda' should be a vector of length equal to the
     number of points in the pattern 'X'. It will be interpreted as
     giving the (estimated) values of lambda(x[i]) for each point x[i]
     of the pattern x.

     Edge corrections are used to correct bias in the estimation of
     Kinhom. Each edge-corrected estimate of Kinhom(r) is of the form

 K^inhom(r)= sum[i] sum[j] 1(d[i,j] <= r) *  e(x[i],x[j],r)/(lambda(x[i]) * lambda(x[j]))

     where d[i,j] is the distance between points x[i] and x[j], and
     e(x[i],x[j],r) is an edge correction factor. For the `border'
     correction,

            1(b[i] > r)/(sum[j] 1(b[j] > r)/lambda(x[j]))

     where b[i] is the distance from x[i] to the boundary of the
     window. For the `modified border' correction, 

                      1(b[i] > r)/area(W [-] r)

     where W [-] r is the eroded window obtained by trimming a margin
     of width r from the border of the original window. For the
     `translation' correction,

                 1/area(W intersect (W + x[j]-x[i]))

     and for the `isotropic' correction,

                       1/(area(W) g(x[i],x[j]))

     where g(x[i],x[j]) is the fraction of the circumference of the
     circle with centre x[i] and radius ||x[i]-x[j]|| which lies inside
     the window.

     The pair correlation function can also be applied to the result of
     'Kinhom'; see 'pcf'.

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

     An object of class '"fv"' (see 'fv.object').

     Essentially a data frame containing at least the following
     columns, 

       r: the vector of values of the argument r  at which the pair
          correlation function g(r) has been  estimated 

    theo: vector of values of pi * r^2, the theoretical value of
          Kinhom(r) for an inhomogeneous Poisson process 

     and containing additional columns according to the choice
     specified in the 'correction' argument. The additional columns are
     named 'border', 'trans' and 'iso' and give the estimated values of
      Kinhom(r) using the border correction, translation correction,
     and Ripley isotropic correction, respectively.

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

     Adrian Baddeley adrian@maths.uwa.edu.au <URL:
     http://www.maths.uwa.edu.au/~adrian/> and Rolf Turner
     rolf@math.unb.ca <URL: http://www.math.unb.ca/~rolf>

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

     Baddeley, A., Moller, J. and Waagepetersen, R. (2000) Non- and
     semiparametric estimation of interaction in inhomogeneous point
     patterns. _Statistica Neerlandica_ *54*, 329-350.

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

     'Kest', 'pcf'

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

       data(lansing)
       # inhomogeneous pattern of maples
       X <- unmark(lansing[lansing$marks == "maple",])
       
       # fit spatial trend
       fit <- ppm(X, ~ polynom(x,y,2), Poisson())
       # predict intensity values at points themselves
       lambda <- predict(fit, locations=X, type="trend")
       # inhomogeneous K function
       Ki <- Kinhom(X, lambda)
       plot(Ki)

       # SIMULATED DATA
       # known intensity function
       lamfun <- function(x,y) { 100 * x }
       # inhomogeneous Poisson process
       Y <- rpoispp(lamfun, 100, owin())
       # evaluate intensity at points of pattern
       lambda <- lamfun(Y$x, Y$y)
       # inhomogeneous K function
       Ki <- Kinhom(Y, lambda)
       plot(Ki)

