Berman's Tests for Point Process Model
Tests the goodness-of-fit of a Poisson point process model using methods of Berman (1986).
bermantest(...) ## S3 method for class 'ppp': bermantest(X, covariate, which = c("Z1", "Z2"), alternative = c("two.sided", "less", "greater"), ...) ## S3 method for class 'ppm': bermantest(model, covariate, which = c("Z1", "Z2"), alternative = c("two.sided", "less", "greater"), ...)
- A point pattern (object of class
- A fitted point process model (object of class
- The spatial covariate on which the test will be based.
An image (object of class
"im") or a function.
- Character string specifying the choice of test.
- Character string specifying the alternative hypothesis.
These functions perform a goodness-of-fit test of a Poisson point process model fitted to point pattern data. The observed distribution of the values of a spatial covariate at the data points, and the predicted distribution of the same values under the model, are compared using either of two test statistics $Z_1$ and $Z_2$ proposed by Berman (1986).
bermantest is generic, with methods for
point patterns (
"ppp") and point process models (
Xis a point pattern dataset (object of class
bermantest(X, ...)performs a goodness-of-fit test of the uniform Poisson point process (Complete Spatial Randomness, CSR) for this dataset.
modelis a fitted point process model (object of class
bermantest(model, ...)performs a test of goodness-of-fit for this fitted model. In this case,
modelshould be a Poisson point process.
covariateshould be either a
function(x,y)or a pixel image (object of class
"im"containing the values of a spatial function. If
covariateis an image, it should have numeric values, and its domain should cover the observation window of the
covariateis a function, it should expect two arguments
ywhich are vectors of coordinates, and it should return a numeric vector of the same length as
First the original data point pattern is extracted from
The values of the
covariate at these data points are
Next the values of the
covariate at all locations in the
observation window are evaluated. The point process intensity
of the fitted model is also evaluated at all locations in the window.
which="Z1", the test statistic$Z_1$is computed as follows. The sum$S$of the covariate values at all data points is evaluated. The predicted mean$\mu$and variance$\sigma^2$of$S$are computed from the values of the covariate at all locations in the window. Then we compute$Z_1 = (S-\mu)/\sigma$.
which="Z2", the test statistic$Z_2$is computed as follows. The values of the
covariateat all locations in the observation window, weighted by the point process intensity, are compiled into a cumulative distribution function$F$. The probability integral transformation is then applied: the values of the
covariateat the original data points are transformed by the predicted cumulative distribution function$F$into numbers between 0 and 1. If the model is correct, these numbers are i.i.d. uniform random numbers. The standardised sample mean of these numbers is the statistic$Z_2$.
The return value is an object of class
"htest" containing the
results of the hypothesis test. The print method for this class
gives an informative summary of the test outcome.
- An object of class
"htest"(hypothesis test) and also of class
"bermantest", containing the results of the test. The return value can be plotted (by
plot.bermantest) or printed to give an informative summary of the test.
The meaning of a one-sided test must be carefully scrutinised: see the printed output.
Berman, M. (1986) Testing for spatial association between a point process and another stochastic process. Applied Statistics 35, 54--62.
# Berman's data data(copper) X <- copper$SouthPoints L <- copper$SouthLines D <- distmap(L, eps=1) # test of CSR bermantest(X, D) bermantest(X, D, "Z2")