Session Ready
Exercise

Other point pattern distribution functions

A number of other functions of point patterns have been developed. They are conventionally denoted by various capital letters, including F, H, J, K and L.

The K-function is defined as the expected number of points within a distance of a point of the process, scaled by the intensity. Like G, this can be computed theoretically for a uniform Poisson process and is K(r) = pi * r ^ 2 - the area of a circle of that radius. Deviation from pi * r ^ 2 can indicate clustering or point inhibition.

Computational estimates of K(r) are done using the Kest() function.

As with G calculations, K-function calculations also need edge corrections. The default edge correction in spatstat is generally the best, but can be slow, so we'll use the "border" correction for speed here.

Uncertainties on K-function estimates can be assessed by randomly sampling points from a uniform Poisson process in the area and computing the K-function of the simulated data. Repeat this process 99 times, and take the minimum and maximum value of K over each of the distance values. This gives an envelope - if the K-function from the data goes above the top of the envelope then we have evidence for clustering. If the K-function goes below the envelope then there is evidence for an inhibitory process causing points to be spaced out. Envelopes can be computed using the envelope() function.

The plot method for estimates of K uses a formula system where a dot on the left of a formula refers to K(r). So the default plot uses . ~ r. You can compare the estimate of K to a Poisson process by plotting . - pi * r ^ 2 ~ r. If the data was generated by a Poisson process, then the line should be close to zero for all values of r.

Instructions
100 XP

The ppp objects p_poisson, p_cluster, and p_regular are defined for you.

  • Use the Kest() function to estimate the K function for the Poisson points.
    • Pass the point pattern as the first argument.
    • Set the correction argument to "border".
  • Plot the K function with the default formula, . ~ r.
  • Plot the K function with a formula that subtracts the theoretical Poisson value, . - pi * r ^ 2 ~ r.
  • Use envelope() to simulate K for the cluster data.
    • The first argument is the point pattern object, p_cluster.
    • The second argument is the estimation function, Kest.
    • As before, use "border" for the correction argument.
  • Plot the simulation envelope with a formula that subtracts the theoretical Poisson value, . - pi * r ^ 2 ~ r.
  • Repeat the last two steps for the regular data.