get.tau.bootstrap: Bootstrap 'get.tau' values.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spatialfuncs.r

Description

Runs get.tau on multiple bootstraps of the data. Is formulated such that the relationship between points and themselves will not be calculated

Usage

1
2
get.tau.bootstrap(posmat, fun, r = 1, r.low = rep(0, length(r)),
  boot.iter, comparison.type = "representative", data.frame = TRUE)

Arguments

posmat

a matrix appropriate for input to get.tau

fun

a function appropriate as input to get.pi

r

the series of spatial distances wer are interested in

r.low

the low end of each range....0 by default

boot.iter

the number of bootstrap iterations

comparison.type

the comparison type to pass as input to get.pi

data.frame

logical indicating whether to return results as a data frame (default = TRUE)

Value

a matrix containing all bootstrapped values of tau for each distance interval

Author(s)

Justin Lessler and Henrik Salje

See Also

Other get.tau: get.tau.ci, get.tau.permute, get.tau.typed.bootstrap, get.tau.typed.permute, get.tau.typed, get.tau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#compare normally distributed with uniform points
x<-cbind(1,runif(100,-100,100), runif(100,-100,100))
x<-rbind(x, cbind(2,rnorm(100,0,20), rnorm(100,0,20)))
colnames(x) <- c("type","x","y")

fun<-function(a,b) {
    if(a[1]!=2) return(3)
    if (b[1]==2) return(1)
    return(2)
}

r.max<-seq(10,100,10)
r.min<-seq(0,90,10)
r.mid <- (r.max+r.min)/2

tau<-get.tau(x,fun,r=r.max,r.low=r.min)
tau.boot<-get.tau.bootstrap(x,fun,r=r.max,r.low=r.min,boot.iter=50)

tau.ci<-apply(tau.boot[,-(1:2)],1,quantile,probs=c(0.25,0.75))

plot(r.mid, tau$tau ,ylim=c(min(tau.ci),max(tau.ci)), type="l", log="y")
lines(c(0,100),c(1,1), lty=3, col="grey")
lines(r.mid, tau.ci[1,] , lty=2)
lines(r.mid, tau.ci[2,] , lty=2)

IDSpatialStats documentation built on Nov. 16, 2019, 1:08 a.m.