###simulate data
set.seed(seed = 3)
TIME = runif(n=200, min = 0, max = 10)
GRAD = runif(n=200, min = 0, max = 60)
DATA1 <- sim.sisters(GRAD, TIME, parameters = c(0.1, 0.065), model=c("BM_linear"))
###Find the MLE of model parameters
RESULT <- model.test.sisters(DIST=DATA1[,3], TIME=DATA1[,2],
GRAD=DATA1[,1], models=c("BM_linear"))
intercept <- as.numeric(RESULT[5,1])
slope <- as.numeric(RESULT[6,1])
model = c("BM_linear")
parameters=c(intercept, slope)
###Run the bootstrap
RR <- bootstrap.test(DIST=DATA1[,3], TIME=DATA1[,2],
GRAD=DATA1[,1], model = "BM_linear", parameters, meserr1=0,
meserr2=0, N = c(100))
summary <- RR$summary #to show only the summary.
bootstraps <- RR$bootstraps #to obtain the bootstraps
###Plot data
plotGradient.ci(bootstraps1=bootstraps,
bootstraps2= c("FALSE"), Lmin=0, Lmax=60, ylim=c(0,10),
MLE=TRUE, MLE1=c(0.1, 0.065), MLE2=c(0,0), xlab="Latitude")#end dontrunRun the code above in your browser using DataLab