pointpats.j

pointpats.j(coordinates, support=None, distances=None, metric='euclidean', hull=None, edge_correction=None, truncate=True)[source]

Ripely’s J function

The so-called “spatial hazard” function, this is a function relating the F and G functions.

Parameters:
coordinatesgeopandas object | numpy.ndarray, (n,2)

input coordinates to function

supporttuple of length 1, 2, or 3, int, or numpy.ndarray

tuple, encoding (stop,), (start, stop), or (start, stop, num) int, encoding number of equally-spaced intervals numpy.ndarray, used directly within numpy.histogram

distances: tuple of numpy.ndarray

precomputed distances to use to evaluate the j function. The first must be of shape (n,n) or (n,) and is used in the g function. the second must be of shape (n,p) or (p,) (with p possibly equal to n) used in the f function.

metric: str or callable

distance metric to use when building search tree

hull: bounding box, scipy.spatial.ConvexHull, shapely.geometry.Polygon

the hull used to construct a random sample pattern for the f function.

edge_correction: bool or str

whether or not to conduct edge correction. Not yet implemented.

truncate: bool (default: True)

whether or not to truncate the results when the F function reaches one. If the F function is one but the G function is less than one, this function will return numpy.nan values.

Returns:
a tuple containing the support values used to evalute the function
and the values of the function at each distance value in the support.