| Kenv.label | R Documentation |
Compute envelope of K1hat-K2hat from random labelling of two point patterns
Kenv.label(pts1,pts2,poly,nsim,s,quiet=FALSE)
pts1 |
First point data set. |
pts2 |
Second point data set. |
poly |
Polygon containing the points. |
nsim |
Number of random labellings to do. |
s |
Vector of distances at which to calculate the envelope. |
quiet |
If FALSE, print a message after every simulation for progress monitoring. If TRUE, print no messages. |
The two point data sets are randomly labelled using rLabel, then
Khat is called to estimate the K-function for each resulting set
at the distances in s. The difference between these two estimates
is then calculated.
The maximum and minimum values of this difference at each distance,over
the nlab
labellings is returned.
A list with two components, called $upper and $lower. Each
component is a vector like s.
Rowlingson, B. and Diggle, P. 1993 Splancs: spatial point pattern analysis code in S-Plus. Computers and Geosciences, 19, 627-655; the original sources can be accessed at: https://www.maths.lancs.ac.uk/~rowlings/Splancs/. See also Bivand, R. and Gebhardt, A. 2000 Implementing functions for spatial statistical analysis using the R language. Journal of Geographical Systems, 2, 307-317.
rLabel,ikhat
data(okwhite)
data(okblack)
okpoly <- list(x=c(okwhite$x, okblack$x), y=c(okwhite$y, okblack$y))
K1.hat <- khat(as.points(okwhite), bboxx(bbox(as.points(okpoly))), seq(5,80,5))
K2.hat <- khat(as.points(okblack), bboxx(bbox(as.points(okpoly))), seq(5,80,5))
K.diff <- K1.hat-K2.hat
plot(seq(5,80,5), K.diff, xlab="distance", ylab=expression(hat(K)[1]-hat(K)[2]),
ylim=c(-11000,7000), type="l", main="Simulation envelopes, random labelling")
env.lab <- Kenv.label(as.points(okwhite), as.points(okblack),
bboxx(bbox(as.points(okpoly))), nsim=29, s=seq(5,80,5))
lines(seq(5,80,5), env.lab$upper, lty=2)
lines(seq(5,80,5), env.lab$lower, lty=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.