Learn R Programming

splancs (version 2.01-45)

Kenv.tor: Envelope of K12hat from random toroidal shifts of two point patterns

Description

Compute envelope of K12hat from random toroidal shifts of two point patterns.

Usage

Kenv.tor(pts1,pts2,poly,nsim,s,quiet=FALSE)

Value

A list with two components, called $upper and $lower. Each component is a vector like s.

Arguments

pts1

First point data set.

pts2

Second point data set.

poly

Polygon containing the points.

nsim

Number of random toroidal shifts 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.

Details

The second point data set is randomly shifted using rtor.shift in the rectangle defined by poly. Then k12hat is called to compute K12hat for the two patterns. The upper and lower values of K12hat over the ntor toroidal shifts are returned.

References

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.

See Also

rtor.shift,k12hat

Examples

Run this code
data(okwhite)
data(okblack)
okpoly <- list(x=c(okwhite$x, okblack$x), y=c(okwhite$y, okblack$y))
plot(seq(5,80,5), sqrt(k12hat(as.points(okwhite), as.points(okblack), 
bboxx(bbox(as.points(okpoly))), seq(5,80,5))/pi) - seq(5,80,5), xlab="distance", 
ylab=expression(hat(L)[12]), ylim=c(-35,35), type="l",
main="Simulation envelopes, random toroidal shifts")
env.ok <- Kenv.tor(as.points(okwhite), as.points(okblack), 
bboxx(bbox(as.points(okpoly))), nsim=29, s=seq(5,80,5))
lines(seq(5,80,5), sqrt(env.ok$upper/pi)-seq(5,80,5), lty=2)
lines(seq(5,80,5), sqrt(env.ok$lower/pi)-seq(5,80,5), lty=2)

Run the code above in your browser using DataLab