Point Pattern Analysis (pointpats)¶
pointpats is an open-source python library for the statistical analysis of planar point patterns. It is a subpackage of PySAL (Python Spatial Analysis Library) and is under active development for the inclusion of many newly proposed analytics for point patterns.
Installation¶
From version 2.1.0, pointpats supports python 3.6 and 3.7 only. Please make sure that you are operating in a python 3 environment.
Installing released version¶
pointpats is available on the Python Package Index. Therefore, you can either install directly with pip from the command line:
pip install -U pointpats
or download the source distribution (.tar.gz) and decompress it to your selected destination. Open a command shell and navigate to the decompressed folder. Type:
pip install .
You may also install the latest stable pointpats via conda-forge channel by running:
$ conda install --channel conda-forge pointpats
Installing development version¶
Potentially, you might want to use the newest features in the development version of pointpats on github - pysal/pointpats while have not been incorporated in the Pypi released version. You can achieve that by installing pysal/pointpats by running the following from a command shell:
pip install git+https://github.com/pysal/pointpats.git
You can also fork the pysal/pointpats repo and create a local clone of your fork. By making changes to your local clone and submitting a pull request to pysal/pointpats, you can contribute to the pointpats development.
API reference¶
Point Pattern¶
|
Planar Point Pattern Class 2-D. |
Point Processes¶
|
Point Process base class. |
|
Poisson point process including \(N\)-conditioned CSR process and \(\lambda\)-conditioned CSR process. |
|
Poisson cluster point process (Neyman Scott). |
Centrography¶
|
Find minimum bounding rectangle of a point array. |
|
Find convex hull of a point array. |
|
Find mean center of a point array. |
|
Find weighted mean center of a marked point pattern. |
|
Find manhattan median of a point array. |
|
Calculate standard distance of a point array. |
|
Calculate the Euclidean median for a point pattern. |
|
Calculate parameters of standard deviational ellipse for a point pattern. |
|
Implements Skyum (1990)’s algorithm for the minimum bounding circle in R^2. |
|
Sum of Euclidean distances between event points and a selected point. |
|
Returns (radius, (center_x, center_y)) of the circumscribed circle by the triangle pqr. |
Quadrat Based Statistics¶
|
Rectangle grid structure for quadrat-based method. |
|
Hexagon grid structure for quadrat-based method. |
|
Quadrat analysis of point pattern. |
Distance Based Statistics¶
|
Abstract Base Class for distance statistics. |
|
Estimates the nearest neighbor distance distribution function G for a point pattern. |
|
Estimates the empty space distribution function for a point pattern: F(d). |
|
Estimates the J function for a point pattern [LB96] |
|
Estimates the K function for a point pattern. |
|
Estimates the \(L\) function for a point pattern [OSullivanU10]. |
|
Abstract base class for simulation envelopes. |
|
Simulation envelope for G function. |
|
Simulation envelope for F function. |
|
Simulation envelope for J function. |
|
Simulation envelope for K function. |
|
Simulation envelope for L function. |
Window functions¶
|
Geometric container for point patterns. |
|
Convert a libpysal polygon to a Window. |
|
|
|
Space-Time Interaction Tests¶
|
Method for reformatting event data stored in a shapefile for use in calculating metrics of spatio-temporal interaction. |
|
Knox test for spatio-temporal interaction. |
|
Standardized Mantel test for spatio-temporal interaction. |
|
Jacquez k nearest neighbors test for spatio-temporal interaction. |
|
Baker’s modified Knox test for spatio-temporal interaction. |
References¶
- Bak04
Rose D Baker. Identifying space–time disease clusters. Acta tropica, 91(3):291–299, 2004.
- Jac96
Geoffrey M Jacquez. A k nearest neighbour test for space–time interaction. Statistics in medicine, 15(18):1935–1949, 1996.
- KB64
E. G. Knox and M. S. Bartlett. The detection of space-time interactions. Journal of the Royal Statistical Society. Series C (Applied Statistics), 13(1):25–30, 1964. URL: http://www.jstor.org/stable/2985220.
- LB96
M. N. M. Lieshout and A. J. Baddeley. A nonparametric measure of spatial interaction in point patterns. Statistica Neerlandica, 50(3):344–361, 1996. doi:10.1111/j.1467-9574.1996.tb01501.x.
- Man67
Nathan Mantel. The detection of disease clustering and a generalized regression approach. Cancer research, 27(2):209—220, February 1967.
- OSullivanU10
D. O’Sullivan and D. J. Unwin. Point Pattern Analysis, chapter 5, pages 121–156. John Wiley & Sons, Ltd, 2010. doi:10.1002/9780470549094.ch5.