# Number of taxa to simulate tree
# Number of taxa
ntaxa <- 10
# Known parameters
mean_x <- 0
mean_y <- 0
sigma_x <- 1
sigma_y <- 1
# Create a random tree
tree <- ape::rtree(n = ntaxa)
# Create random data according to tree structure
x_locs <- as.numeric(mvtnorm::rmvnorm(1, rep(mean_x,ntaxa), sigma=sigma_x*vcv(tree)))
y_locs <- as.numeric(mvtnorm::rmvnorm(1, rep(mean_y,ntaxa), sigma=sigma_y*vcv(tree)))
values <- list(x_locs,y_locs)
## Not run:
# # run point.like.bm
# bm_results = point.like.bm(tree, values)## End(Not run)
Run the code above in your browser using DataLab