Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.bermantest

Plot Result of Berman Test


Description

Plot the result of Berman's test of goodness-of-fit

Usage

## S3 method for class 'bermantest'
plot(x, ...,
                   lwd=par("lwd"), col=par("col"), lty=par("lty"),
                   lwd0=lwd, col0=2, lty0=2)

Arguments

x

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.

col,lwd,lty

The width, colour and type of lines used to plot the empirical distribution curve.

col0,lwd0,lty0

The width, colour and type of lines used to plot the predicted (null) distribution curve.

Details

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, Fhat, and the predicted cumulative distribution function of the covariate under the model, F0, 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 berman.test( ,which="Z2")), the plot displays the empirical cumulative distribution function of the values U[i] = F0(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.

Value

NULL.

Author(s)

and Ege Rubak rubak@math.aau.dk

See Also

Examples

# 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")

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.