###EXAMPLE 1
###simulate data
set.seed(seed = 3)
TIME = runif(n=100, min = 0, max = 10)
GRAD = runif(n=100, min = 0, max = 60)
DATA1 <- sim.sisters(TIME = TIME, GRAD=GRAD, parameters = c(2, -0.03),
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
###EXAMPLE 2
###simulate data
set.seed(seed = 3)
TIME = runif(n=100, min = 0, max = 10)
GRAD = runif(n=100, min = 0, max = 60)
DATA1 <- sim.sisters(TIME = TIME, GRAD=GRAD, parameters = c(2, -0.03, 1,
0.1), model=c("OU_linear"))
###Find the MLE of model parameters
RESULT <- model.test.sisters(DIST=DATA1[,3], TIME=DATA1[,2],
GRAD=DATA1[,1], models=c("OU_linear"))
intercept_beta <- as.numeric(RESULT[5,1])
slope_beta <- as.numeric(RESULT[7,1])
intercept_alpha <- as.numeric(RESULT[11,1])
slope_alpha <- as.numeric(RESULT[12,1])
parameters=c(intercept_beta, slope_beta, intercept_alpha, slope_alpha)
###Run the bootstrap
RR <- bootstrap.test(DIST=DATA1[,3], TIME=DATA1[,2],
GRAD=DATA1[,1], model = "OU_linear", parameters, meserr1=0, meserr2=0,
N = c(100))
summary <- RR$summary #to show only the summary.
bootstraps <- RR$bootstraps #to obtain the bootstraps#end dontrunRun the code above in your browser using DataLab