locan.analysis.ripley#

Compute Ripley’s k function.

Spatial clustering of localization data is characterized by Ripley’s k or related l and h functions [1].

Ripley’s k function is computed for 2D and 3D data for a series of radii as described in [2] in order to provide evidence for deviations from a spatially homogeneous Poisson process (i.e. complete spatial randomness, CSR). Ripley’ s k function is estimated by summing all points or over test points being a random subset of all points:

\[k(r) = \frac{1}{\lambda (n-1)} \sum_{i=1}^{n} N_{p_{i}}(r)\]

here \(p_i\) is the \(i^{th}\) point of n test points, \(N_{p_{i}}\) is the number of points within the region of radius r around \(p_{i}\), and \(\lambda\) is the density of all points.

We follow the definition of l and h functions in [2]. Ripley’s l function is:

\[ \begin{align}\begin{aligned}l(r) &= \sqrt{k(r)) / \pi} \qquad \text{in 2D}\\l(r) &= \sqrt[3]{\frac{3}{4 \pi} k(r)} \qquad \text{in 3D}\end{aligned}\end{align} \]

And Ripley’s h function is:

\[h(r) = l(r) - r\]

References

Classes

RipleysHFunction([meta, radii, region_measure])

Compute Ripley's H function for two- or three-dimensional data at the given radii.

RipleysKFunction([meta, radii, region_measure])

Compute Ripley's K function for two- or three-dimensional data at the given radii.

RipleysLFunction([meta, radii, region_measure])

Compute Ripley's L function for two- or three-dimensional data at the given radii.

Functions

plot(self[, ax])

Provide plot of results as matplotlib.axes.Axes object.