Description Usage Arguments Value Author(s) References See Also Examples
Estimates Most Recent Common Ancestor (MRCA) states and the Brownian rate according to a Brownian Motion model of trait evolution using Maximum Likelihood. It can be used for several dimensions simultaneously. For 1-dimensional traits, we recommend the more stable ace
function.
1 | point.like.bm(tree, values, start_values = NA, dimen = NA)
|
tree |
phylogenetic tree of class |
values |
a list, with each element being one-dimensional values for one trait. |
start_values |
Optional. A vector of starting values for the Maximum Likelihood optimization. The funtion only estimates the MRCA and the rates for each trait, and that should be the order of the input starting values. |
dimen |
Optional. Number of dimensions (number of traits being analyzed). If |
Returns a list with the following components:
mrcas |
Most recent common ancestor estimates for each trait (in the same order of the input |
rates |
Brownian motion rate parameters for each trait(in the same order of the input |
nlm.details |
A list with the results from nlm optimization. For details see |
Ignacio Quintero
Schluter, D., et al. 1997 Likelihood of ancestor states in adaptive radiation. Evolution: 1699-1711.
ace
, ML taking into account ranges ranges.like.bm
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.