Ktest {dbmss} | R Documentation |
Tests the point pattern against CSR using values of the K function
Ktest(X, r)
X |
A point pattern ( |
r |
A vector of distances. |
The test returns the risk to reject CSR erroneously, i.e. the p-value of the test, based on the distribution of the K function.
A p-value.
Gabriel Lang <Gabriel.Lang@agroparistech.fr>, Eric Marcon<Eric.Marcon@agroparistech.fr>
Lang, G. and Marcon, E. (2013). Testing randomness of spatial point patterns with the Ripley statistic. ESAIM: Probability and Statistics. 17: 767-788.
Marcon, E., S. Traissac, and Lang, G. (2013). A Statistical Test for Ripley's Function Rejection of Poisson Null Hypothesis. ISRN Ecology 2013(Article ID 753475): 9.
# Simulate a Matern (Neyman Scott) point pattern
nclust <- function(x0, y0, radius, n) {
return(runifdisc(n, radius, centre=c(x0, y0)))
}
X <- rNeymanScott(20, 0.1, nclust, radius=0.2, n=5)
autoplot(as.wmppp(X))
# Test it
Ktest(X, r=seq(0.1, .5, .1))