# NOT RUN {
# Also see the vignette 'Analyzing rates of evolution'.
# }
# NOT RUN {
# Generating a tree with 50 species
set.seed(102)
tree <- ape::rtree(n = 50)
tree <- ape::chronopl(tree, lambda = 1, age.min = 1)
### model = 'predictor_BM' ###
sim_data <- simulate_rate(tree, startv_x = 0, sigma_x = 0.25, a = 1, b = 1,
model = "predictor_BM")
head(sim_data$tips)
par(mfrow = c(1, 3))
plot(sim_data)
plot(sim_data, response = "y")
plot(sim_data, response = "x")
par(mfrow = c(1, 1))
### model = 'predictor_gBM' ###
sim_data <- simulate_rate(tree, startv_x = 1, sigma_x = 1, a = 1, b = 0.1,
model = "predictor_gBM")
head(sim_data$tips)
par(mfrow = c(1, 3))
plot(sim_data)
plot(sim_data, response = "y")
plot(sim_data, response = "x")
par(mfrow = c(1, 1))
### model = 'recent_evol' ###
sim_data <- simulate_rate(tree,
startv_x = 0, sigma_x = 1, a = 1, b = 1, sigma_y = 1,
model = "recent_evol"
)
head(sim_data$tips)
# }
Run the code above in your browser using DataLab