
Patterns of Several Types of Points 581
and its randomised versions are exchangeable, justifying the Monte Carlo test. The test is performed
in spatstat by segregation.test:
> segregation.test(lansing, nsim=19)
Monte Carlo test of spatial segregation of types
data: lansing
T = 0.014, p-value = 0.05
By default, automatic bandwidth selection will be performed sep arately for each randomised pat-
tern. This comp utation can be time-consuming, but is strictly ne cessary fo r the validity of the test.
Automatic bandwidth selection for the randomised patterns may also generate warnings, because
the optimal bandwidth for such patterns can be infinite (or at