[R-sig-Geo] Calculating point density

Rolf Turner r.turner at auckland.ac.nz
Tue Jun 14 22:36:50 CEST 2011


On 15/06/11 06:35, Christopher S. Fowler wrote:
> I am working out a comparison of results for point pattern analysis using
> ArcGIS and R, specifically the spatstat package. One of the key functions
> for density calculations in ArcGIS is "Point Density" which counts the
> points within a given distance (r) of the centroid of each cell in a raster
> grid and divides it by the area of circle with radius r. The closest
> equivalent I have found is the density.ppp function in spatstat, but that is
> kernel density. Am I correct in thinking that this "reverses" the process of
> point density and assigns a contribution value extending out from each point
> in the data consistent with the function specified in the bandwidth
> variable?
>
> Any suggestions on the location of an appropriate point density function, or
> barring that, the reason for preferring kernel density to point density.

As the help for density.ppp() says, this function uses an isotropic Gaussian
kernel of standard deviation sigma. Its value at "x" is in effect the sum of
k(x - x_i) where k() is the kernel and the x_i are the points of the pattern
in question (although internally it use fast Fourier transform methods 
rather
than calculating this sum directly).

Thus the value at "x" is a sum of weights associated with each point of the
pattern, with the weights diminishing as the distance of points of the 
pattern
from "x" increases.

Note that the integral of the resulting density over the observation window
is ``theoretically'' equal to the number of points observed in the window,
but is in fact slightly less.

     cheers,

         Rolf Turner



More information about the R-sig-Geo mailing list