## S3 method for class 'bermantest':
plot(x, ...,
lwd=par("lwd"), col=par("col"), lty=par("lty"),
lwd0=lwd, col0=col, lty0=lty)
"bermantest"
produced by bermantest
.plot.ecdf
.NULL
.plot
method for the class "bermantest"
.
An object of this class represents the outcome of Berman's test
of goodness-of-fit of a spatial Poisson point process model,
computed by bermantest
. For the Z1 test (i.e. if x
was computed using
bermantest( ,which="Z1")
),
the plot displays the two cumulative distribution functions
that are compared by the test: namely the empirical cumulative distribution
function of the covariate at the data points, $\hat F$,
and the predicted
cumulative distribution function of the covariate under the model,
$F_0$, both plotted against the value of the covariate.
Two vertical lines show the mean values of these two distributions.
If the model is correct, the two curves should be close; the test is
based on comparing the two vertical lines.
For the Z2 test (i.e. if x
was computed using
bermantest( ,which="Z2")
), the plot displays the empirical
cumulative distribution function of the values
$U_i = F_0(Y_i)$ where $Y_i$ is the
value of the covariate at the $i$-th data point. The diagonal line
with equation $y=x$ is also shown. Two vertical lines show the
mean of the values $U_i$ and the value $1/2$. If the
model is correct, the two curves should be close. The test is based on
comparing the two vertical lines.
bermantest
# synthetic data: nonuniform Poisson process
X <- rpoispp(function(x,y) { 100 * exp(-x) }, win=square(1))
# fit uniform Poisson process
fit0 <- ppm(X, ~1)
# test covariate = x coordinate
xcoord <- function(x,y) { x }
# test wrong model
k <- bermantest(fit0, xcoord, "Z1")
# plot result of test
plot(k, col="red", col0="green")
Run the code above in your browser using DataLab