Kenv.csr.Rd
Compute envelope of Khat from simulations of complete spatial randomness.
Kenv.csr(nptg,poly,nsim,s,quiet=FALSE)
Number of points to generate in each simulation.
Polygon in which to generate the points.
Number of simulations to do.
Vector of distances at which to calculate the envelope.
If FALSE, print a message after every simulation for progress monitoring. If TRUE, print no messages.
A list with two components, called $upper
and $lower
. Each
component is a vector like s
. The two components contain the upper
and lower bound of the Khat envelope.
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.
data(cardiff)
UL.khat <- Kenv.csr(length(cardiff$x), cardiff$poly, nsim=29, seq(2,30,2))
#> Doing simulation 1
#> Doing simulation 2
#> Doing simulation 3
#> Doing simulation 4
#> Doing simulation 5
#> Doing simulation 6
#> Doing simulation 7
#> Doing simulation 8
#> Doing simulation 9
#> Doing simulation 10
#> Doing simulation 11
#> Doing simulation 12
#> Doing simulation 13
#> Doing simulation 14
#> Doing simulation 15
#> Doing simulation 16
#> Doing simulation 17
#> Doing simulation 18
#> Doing simulation 19
#> Doing simulation 20
#> Doing simulation 21
#> Doing simulation 22
#> Doing simulation 23
#> Doing simulation 24
#> Doing simulation 25
#> Doing simulation 26
#> Doing simulation 27
#> Doing simulation 28
#> Doing simulation 29
plot(seq(2,30,2), sqrt(khat(as.points(cardiff), cardiff$poly,
seq(2,30,2))/pi)-seq(2,30,2), type="l", xlab="Splancs - polygon boundary",
ylab="Estimated L", ylim=c(-1,1.5))
lines(seq(2,30,2), sqrt(UL.khat$upper/pi)-seq(2,30,2), lty=2)
lines(seq(2,30,2), sqrt(UL.khat$lower/pi)-seq(2,30,2), lty=2)