# pointpats.l_test

pointpats.l_test(coordinates, support=None, distances=None, metric='euclidean', hull=None, edge_correction=None, linearized=False, keep_simulations=False, n_simulations=9999, n_jobs=-1)

  Ripley’s L function

  This is a scaled and shifted version of the K function that accounts for the K function’s increasing expected value as distances increase. This means that the L function, for a completely random pattern, should be close to zero at all distance values in the support.

  When the L function is negative, this suggests dispersion.

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

      input coordinates to function

    support tuple 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: numpy.ndarray, (n, p) or (p,)

      distances from every point in a random point set of size p to some point in coordinates

    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, if distances is None

    edge_correction: bool or str

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

    keep_simulations: bool

      whether or not to keep the simulation envelopes. If so, will be returned as the result’s simulations attribute

    n_simulations: int

      how many simulations to conduct, assuming that the reference pattern has complete spatial randomness.

    n_jobs int (default: -1)

      The number of CPU cores to use for running the Monte Carlo simulations. Simulations are independent and can be run in parallel to significantly reduce execution time.

      - If `n_jobs = -1`, all available CPU cores will be used.

      - If `n_jobs = 1`, the execution will be forced to run sequentially (serially), disabling parallel processing. This is often useful for debugging or testing purposes.

      - If `n_jobs > 1`, that specific number of cores will be used.

  Returns:
    a named tuple with properties
    - support, the exact distance values used to evalute the statistic
    - statistic, the values of the statistic at each distance
    - pvalue, the percent of simulations that were as extreme as the observed value
    - simulations, the distribution of simulated statistics (shaped (n_simulations, n_support_points))

        or None if keep_simulations=False (which is the default)