---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
    jupytext_version: 1.11.5
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

# Point Pattern Analysis: Randomness

Topics
* Randomness of point location
* Quadrat analysis
* Nearest neighbor analysis

## Descriptive Spatial Statistics
* Where is the center of a geographic distribution
    * Mean center
* How features are distributed around its center
    * Standard distance
    * Standard deviation ellipse



## Point Randomness
* Characterizing the randomness of a set of points in space
    * Random
    * Uniform (Dispersed)
    * Clustered



## Point Pattern Randomness Analysis
* Analysis on forms helps understand the processes that produced the patterns.
* Clustered patterns:
    * Contagion process where a particular location attracts a number of points.
* Dispersed/uniform patterns:
    * Some form of competition in space where points repel one another.
* Random patterns:
    * Results of random processes.
    * Any point is equally likely to occur at any location.
    * The position of any point is not affected by the position of any other point.

## Quadrat Analysis
* Initially developed by ecologists studying the spatial distribution of plants.
* A regular grid is overlain over the region of interest.
* The number of points in each quadrat is recorded.
* The observed number of points per quadrat is compared with the theoretical distribution generated by a complete spatial random (CSR) process.
* If the observed and theoretical distributions are similar, then the observed distribution could be generated by a random process.



## Observed vs. Random Distribution
* For a random process, the probability of finding k points in a quadrat follows the Poisson distribution.
* $P(k) = \frac{\lambda^k e^{-\lambda}}{k!}$
    * $\lambda$ = intensity (total points / total quadrats).

## Variance-Mean Ratio (VMR)
* A common way to describe the pattern in quadrat analysis.
* For a Poisson (random) distribution, the variance equals the mean ($VMR = 1$).
* Clustered pattern:
    * Many quadrats with 0 points and few with many points.
    * Variance is greater than the mean ($VMR > 1$).
* Uniform pattern:
    * Most quadrats have a similar number of points.
    * Variance is less than the mean ($VMR < 1$).

## Issues with Quadrat Analysis
* Result depends on quadrat size and orientation.
* A measure of dispersion (VMR) is not a measure of the actual point locations within quadrats.
* Small sample size issues.

## Nearest Neighbor Analysis
* Developed by Clark and Evans (1954).
* Uses the distance between a point and its nearest neighbor to characterize the pattern.
* Provides a more refined measure than quadrat analysis because it uses the actual coordinates of every point.

## Nearest Neighbor Index (NNI)
* $NNI = \frac{d(NN)}{d(random)}$
* $d(NN)$: The average observed distance between each point and its nearest neighbor.
* $d(random)$: The expected average distance if the pattern were random.
    * $d(random) = \frac{1}{2\sqrt{\rho}}$ (where $\rho$ is the density of points).



## Interpreting NNI
* $NNI = 1$: The pattern is random.
* $NNI < 1$: The pattern is clustered (observed distances are shorter than random).
* $NNI > 1$: The pattern is dispersed/uniform (observed distances are longer than random).
    * Maximum $NNI = 2.149$ (perfectly hexagonal/uniform distribution).

## Significance Test for NNI
* Clark and Evans proposed a Z-test for significance.
* $Z = \frac{d(NN) - d(random)}{SE}$
    * $SE$ is the standard error of the random distance.
* Null Hypothesis: The distribution is from a random distribution.
* If the Z-value is outside the critical range (-1.96 to 1.96 for a 0.05 confidence level), the null hypothesis is rejected.

## Comparison: Quadrat Analysis vs. Nearest Neighbor
* Nearest Neighbor:
    * No quadrat size problem to be concerned with.
    * Uses exact locations.
* Both methods:
    * Still have the issue of the study area boundary (the "edge effect").
    * Points near the edge might have a nearest neighbor outside the study area that is not counted.

