Description Usage Arguments Value Author(s) References See Also Examples
Performs a bayesian two-dimensional ancestral state estimation with single values as input (contrast with rase) according to a Brownian Motion model of trait evolution (or dispersal for phylogeography).  It uses Gibbs sampling to approximate the posterior distribution.
| 1 2 | 
| tree | phylogenetic tree of class  | 
| values | 2-dimensional trait values (e.g., coordinates for phylogeography). Should be a  | 
| niter | number of MCMC iterations. By default  | 
| logevery | iteration cycle to print current iteration. By default  | 
| sigma2_scale | optional. Window proposal for sigma2x & sigma2y. | 
| screenlog | if  | 
| params0 | optional. A vector of initial parameter values in the following order: x ancestors, y ancestors, sigma2x and sigma2y. If  | 
returns a matrix where every column represents one parameter. The first columns (i.e., nX_x) give the ancestral locations for trait x in the order of nodes in the tree (see the phylo class for details), followed by the ancestral locations of trait y (i.e., nX_y), and the rate parameter in x (sigma2x) and y (sigma2y).
Forrest Crawford, Ignacio Quintero
Quintero, I., Keil, P., Jetz, W., Crawford, F. W. 2015 Historical Biogeography Using Species Geographical Ranges. Systematic Biology. doi: 10.1093/sysbio/syv057
For the maximum likelihood version see point.like.bm; for the incorporation of polygon uncertainty see rase. 
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |   ### Create some data to be analyzed
  # 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 = x_locs, y = y_locs)
  ## Not run: 
    # run bm_ase for 10 iterations
    bm_results = bm_ase(tree, values, niter = 10)
  
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.