Session Ready
Exercise

Simulating clustered and inhibitory patterns

The spatstat package also has functions for generating point patterns from other process models. These generally fall into one of two classes: clustered processes, where points occur together more than under a uniform Poisson process, and regular (aka inhibitory) processes where points are more spaced apart than under a uniform intensity Poisson process. Some process models can generate patterns on a continuum from clustered through uniform to regular depending on their parameters.

The quadrat.test() function can test against clustered or regular alternative hypotheses. By default it tests against either of those, but this can be changed with the alternative parameter to create a one-sided test.

A Thomas process is a clustered pattern where a number of "parent" points, uniformly distributed, create a number of "child" points in their neighborhood. The child points themselves form the pattern. This is an attractive point pattern, and makes sense for modeling things like trees, since new trees will grow near the original tree. Random Thomas point patterns can be generated using rThomas(). This takes three numbers that determine the intensity and clustering of the points, and a window object.

Conversely the points of a Strauss process cause a lowering in the probability of finding another point nearby. The parameters of a Strauss process can be such that it is a "hard-core" process, where no two points can be closer than a set threshold. Creating points from this process involves some clever simulation algorithms. This is a repulsive point pattern, and makes sense for modeling things like territorial animals, since the other animals of that species will avoid the territory of a given animal. Random Strauss point patterns can be generated using rStrauss(). This takes three numbers that determine the intensity and "territory" of the points, and a window object. Points generated by a Strauss process are sometimes called regularly spaced.

Instructions
100 XP
  • Create a disc of radius 10, assigning to disc10.
  • Generate points from a Thomas process in a disc of radius 10.
    • Keep the pre-defined values, and pass disc10 as the window.
    • Assign to p_cluster.
  • Plot the result.
  • Run a quadrat test against a "clustered" alternative hypothesis.
  • Do the same for a Strauss process, but test against a "regular" point pattern hypothesis.