Description Usage Arguments Details Value Author(s) Examples

View source: R/getMarginalBranchRateMatrix.R

For each sample in the posterior, computes the mean rate for
each branch in the focal phylogeny (speciation, extinction, trait
evolution). If the `bammdata`

object contains *nsamples*
samples and the target phylogeny has *nbranches* branches, the
function will compute a matrix of *nbranches* x *nsamples*.

1 | ```
getMarginalBranchRateMatrix(ephy, verbose = FALSE)
``` |

`ephy` |
An object of class |

`verbose` |
Print progress during processing of |

If a `type = 'diversification'`

`bammdata`

object is
passed as an argument, the function will return matrices for both
speciation and extinction. If `type = 'trait'`

object, the matrix
will simply be the corresponding phenotypic rates. Branch-specific
rates are the mean rates computed by integrating the relevant
rate-through-time function along each branch, then dividing by the
length of the branch.

Returns a list with the following components:

lambda_branch_matrix A

`nbranches x nsamples`

matrix of mean speciation rates for each branch.mu_branch_matrix A

`nbranches x nsamples`

matrix of mean extinction rates for each branch.beta_branch_matrix A

`nbranches x nsamples`

matrix of mean phenotypic rates for each branch.

Dan Rabosky

1 2 3 4 5 | ```
data(whales)
data(events.whales)
ed <- getEventData(whales, events.whales, nsamples = 10)
mbr <- getMarginalBranchRateMatrix(ed)
dim(mbr$lambda_branch_matrix)
``` |

BAMMtools documentation built on May 29, 2017, 5:47 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.