point.like.bm: n-dimensional Maximum Likelihood of Point Brownian Motion

Description Usage Arguments Value Author(s) References See Also Examples

Description

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.

Usage

1
	point.like.bm(tree, values, start_values = NA, dimen = NA)

Arguments

tree

phylogenetic tree of class "phylo".

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 dimen = NA, dimensions are obtained from values.

Value

Returns a list with the following components:

mrcas

Most recent common ancestor estimates for each trait (in the same order of the input values).

rates

Brownian motion rate parameters for each trait(in the same order of the input values).

nlm.details

A list with the results from nlm optimization. For details see nlm.

Author(s)

Ignacio Quintero

References

Schluter, D., et al. 1997 Likelihood of ancestor states in adaptive radiation. Evolution: 1699-1711.

See Also

ace, ML taking into account ranges ranges.like.bm.

Examples

 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)

rase documentation built on May 2, 2019, 12:46 p.m.