Skip to content
Prev 163514 / 398513 Next

Spatstat - K2 index

Gough Lauren wrote:
The function 'pcf' in spatstat computes the pair correlation function.

To compute the inhomogeneous version of the pair correlation function,
 if X is your point pattern and Z is its estimated intensity (a pixel 
image), type

         K <- Kinhom(X, Z)
         p <- pcf(K)

This uses the method 'pcf.fv' which computes an estimate of the 
(inhomogeneous) pair correlation function by numerically differentiating 
the inhomogeneous K function. See help(pcf) and help(pcf.fv).

In future versions of spatstat we will introduce a function pcf.inhom 
that uses kernel smoothing to do the same task.
You need the code file K2.R mentioned in this file.

According to the cited article, the "K2 index" is just the derivative of 
the pair correlation function. Presumably the file K2.R computes a 
numerical estimate of the derivative (assuming that it exists).

Adrian Baddeley