Plot the result of Berman's test of goodness-of-fit
# S3 method for bermantest
plot(x, ...,
lwd=par("lwd"), col=par("col"), lty=par("lty"),
lwd0=lwd, col0=2, lty0=2)
Object to be plotted. An object of class "bermantest"
produced by berman.test
.
extra arguments that will be passed to the plotting function
plot.ecdf
.
The width, colour and type of lines used to plot the empirical distribution curve.
The width, colour and type of lines used to plot the predicted (null) distribution curve.
NULL
.
This is the 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 berman.test
.
For the Z1 test (i.e. if x
was computed using
berman.test( ,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,
For the Z2 test (i.e. if x
was computed using
berman.test( ,which="Z2")
), the plot displays the empirical
cumulative distribution function of the values
# NOT RUN {
# 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 <- berman.test(fit0, xcoord, "Z1")
# plot result of test
plot(k, col="red", col0="green")
# Z2 test
k2 <- berman.test(fit0, xcoord, "Z2")
plot(k2, col="red", col0="green")
# }
Run the code above in your browser using DataLab