pcf                 package:spatstat                 R Documentation

_P_a_i_r _C_o_r_r_e_l_a_t_i_o_n _F_u_n_c_t_i_o_n

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

     Estimates the pair correlation function of a point pattern.

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

      pcf(X, ..., method="c")

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

       X: Either the observed data point pattern, or an estimate of its
          K function, or an array of multitype K functions (see
          Details). 

     ...: Arguments controlling the smoothing spline function
          `smooth.spline'. 

  method: Letter `"a"', `"b"' or `"c"' indicating the method for
          deriving the pair correlation function from the `K' function. 

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

     The pair correlation function of a stationary point process is

                     g(r) = K'(r)/ ( 2 * pi * r)

     where K'(r) is the derivative of K(r), the reduced second moment
     function (aka ``Ripley's K function'') of the point process. See
     `Kest' for information about K(r). For a stationary Poisson
     process, the pair correlation function is identically equal to 1.
     Values g(r) < 1 suggest inhibition between points; values greater
     than 1 suggest clustering.

     We also apply the same definition to other variants of the
     classical K function, such as the multitype K functions (see
     `Kcross', `Kdot') and the inhomogeneous K function (see `Kinhom').
     For all these variants, the benchmark value of K(r) = pi * r^2
     corresponds to g(r) = 1.

     This routine computes an estimate of g(r) from an estimate of K(r)
     or its variants, using smoothing splines to approximate the
     derivative.

     The argument `X' may be either

        *  a point pattern for which an estimate of the pair
           correlation function should be computed. This should be an
           object of class `"ppp"', or in a format recognised by
           `as.ppp()'.

        *  a data frame containing an estimate of a K function. This
           data frame should be the value returned by `Kest', `Kcross',
           `Kmulti' or `Kinhom'.

        *  a function array (object of class `"fasp"', see
           `fasp.object') containing several estimates of K functions.
           This should have been obtained from `alltypes' with the
           argument `fun="K"'.

     If `X' is a point pattern, the K function is first estimated by
     `Kest'.

     The smoothing spline operations are performed by `smooth.spline'
     and `predict.smooth.spline' from the `modreg' library. Three
     numerical methods are available:

        *  "a" apply smoothing to K(r), estimate its derivative, and
           plug in to the formula above;

        *  "b" apply smoothing to Y(r) = K(r)/(2 * pi * r) constraining
           Y(0) = 0, estimate the derivative of Y, and solve;

        *  "c" apply smoothing to  Y(r) = K(r)/(pi * r^2) constraining
           Z(0)=1, estimate its derivative, and solve.

     Method `"c"' seems to be the best at  suppressing variability for
     small values of r. However it effectively constrains g(0) = 1. If
     the point pattern seems to have inhibition at small distances, you
     may wish to experiment with method `"b"' which effectively
     constrains g(0)=0. Method `"a"' seems comparatively unreliable.

     Useful arguments to control the splines include the smoothing
     tradeoff parameter `spar' and the degrees of freedom `df'. See
     `smooth.spline' for details.

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

     A data frame containing (at least) the variables 

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

     pcf: vector of values of g(r) 

_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:

     Stoyan, D, Kendall, W.S. and Mecke, J. (1995) Stochastic geometry
     and its applications. 2nd edition. Springer Verlag.

     Stoyan, D. and Stoyan, H. (1994) Fractals, random shapes and point
     fields: methods of geometrical statistics. John Wiley and Sons.

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

     `Kest', `Kinhom', `Kcross', `Kdot', `Kmulti', `alltypes',
     `smooth.spline', `predict.smooth.spline'

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


       library(spatstat)

       data(simdat)
       p <- pcf(simdat)

         plot(p$r, p$pcf, type="l", xlab="r", ylab="g(r)",
                       main="pair correlation")
         abline(h=1, lty=1)


       # multitype point pattern
       data(catWaessle)
       p <- pcf(alltypes(catWaessle, "K"), spar=0.5, method="b")

              conspire(p, cbind(pcf,1) ~ r, subset="r <= 0.2",
                  title="Pair correlation functions for catWaessle")


