# pointpats.QStatistic

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

  Quadrat analysis of point pattern.

  Parameters:
    pp `PointPattern` or numpy.ndarray

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

    shape string

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

    nx integer

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

    ny integer

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

    rectangle_width float

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

    rectangle_height float

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

    lh float

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

    realizations `PointProcess`

      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:
    pp `PointPattern`

      Point Pattern instance.

    mr `RectangleM` or `HexagonM`

      RectangleM or HexagonM instance.

    chi2 float

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

    df integer

      Degree of freedom.

    chi2_pvalue float

      p-value based on analytical chi-squared distribution.

    chi2_r_pvalue float

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

    chi2_realizations array

      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)

  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')

    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”.