pointpats.QStatistic

class pointpats.QStatistic(pp, shape='rectangle', nx=3, ny=3, rectangle_width=0, rectangle_height=0, lh=10, realizations=0)[source]

Quadrat analysis of point pattern.

Parameters:
ppPointPattern or numpy.ndarray

Point Pattern instance, or (n_observations, 2) array that can be used to construct a Point Pattern instance.

shapestring

Grid structure. Either “rectangle” or “hexagon”. Default is “rectangle”.

nxinteger

Number of rectangles in the horizontal direction. Only when shape is specified as “rectangle” will nx be considered.

nyinteger

Number of rectangles in the vertical direction. Only when shape is specified as “rectangle” will ny be considered.

rectangle_widthfloat

Rectangle width. Use in pair with rectangle_height to fully specify a rectangle. Incompatible with nx & ny.

rectangle_heightfloat

Rectangle height. Use in pair with rectangle_width to fully specify a rectangle. Incompatible with nx & ny.

lhfloat

Hexagon length (hexagon). Only when shape is specified as “hexagon” will lh be considered. Incompatible with nx & ny.

realizationsPointProcess

Point process instance with more than 1 point pattern realizations which would be used for simulation based inference. Default is 0 where no simulation based inference is performed.

Attributes:
ppPointPattern

Point Pattern instance.

mrRectangleM or HexagonM

RectangleM or HexagonM instance.

chi2float

Chi-squared test statistic for the observed point pattern pp.

dfinteger

Degree of freedom.

chi2_pvaluefloat

p-value based on analytical chi-squared distribution.

chi2_r_pvaluefloat

p-value based on simulated sampling distribution. Only available when realizations is correctly specified.

chi2_realizationsarray

Chi-squared test statistics calculated for all the simulated csr point patterns.

__init__(pp, shape='rectangle', nx=3, ny=3, rectangle_width=0, rectangle_height=0, lh=10, realizations=0)[source]

Methods

__init__(pp[, shape, nx, ny, ...])

plot([title])

Plot quadrats as well as the number of points falling in each quadrat.

plot(title='Quadrat Count')[source]

Plot quadrats as well as the number of points falling in each quadrat.

Parameters:
title: str, optional

Title of the plot. Default is “Quadrat Count”.