Performs a bayesian two-dimensional ancestral state estimation with polygonal distributions as input (contrast with `bm_ase`

) according to a Brownian Motion model of trait evolution (or dispersal for phylogeography). It uses Gibbs sampling to approximate the posterior distribution. See reference at the end for more detailed information.

1 2 |

`tree` |
phylogenetic tree of class |

`polygons` |
list of polygons in |

`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 |

`nGQ` |
degree of the one-dimensional Gauss-Legendre quadrature rule (default = 20) as given by |

returns a matrix where every column represents one parameter. The first columns (i.e., `nX_x`

; where X = node 1, ..., node i) 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

Contrast with the point ancestral state estimation `bm_ase`

. For the maximum likelihood version of ranges see `ranges.like.bm`

. For post-mcmc handling see `post.mcmc`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ```
# Here the application in the paper of Quintero et al.,
# on the Psophia trumpeters
# is shown using rase package.
#load data
data(rase_data, package = 'rase')
## Not run:
# check the data we are going to use
# the phylogenetic tree
psophia_tree
# the GPC polygons of Psophia distribution.
psophia_poly
# Species names of polygons (in order)
pnames <- c('dextralis', 'viridis', 'leucoptera', 'interjecta',
'obscura', 'crepitans', 'ochroptera', 'napensis')
# name the polygons
psophia_poly <- name.poly(psophia_poly, psophia_tree,
poly.names = pnames)
# Run rase for 10 iterations
rase_results <- rase(psophia_tree, psophia_poly, niter = 100)
# Run with higher number of iterations
# rase_results <- rase(psophia_tree, polygons)
# Check the results
str(rase_results)
# post-MCMC handling
rase_results_for_ggmcmc <- post.mcmc(rase_results, burnin=0, thin = 1)
#plot the densities for dispersal rates using ggmcmc
require(ggmcmc)
ggs_traceplot(rase_results_for_ggmcmc, family = 'sigma')
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.