joint.postmean.moments.phylojumps: Joint moments of the posterior mean of labeled substitution...

Description Usage Arguments Details Value References See Also

Description

This function calculates the means, variances, and covariance of the posterior mean of labeled substitution counts over two prespecified sets of branches on a phylogeny using a simulation-free dynamic programming algorithm and Monte Carlo sampling.

Usage

1
2
3
4
joint.postmean.moments.phylojumps(tree, rate.mat, label.mat,
                                  edge.set1 = NULL, edge.set2 = NULL, 
                                  subtree = NULL, root.dist,
                                  scale = FALSE, N = 100000)

Arguments

tree

A tree object of class "phylo" (ape format).

rate.mat

A reversible continuous-time Markov chain (CTMC) rate matrix.

label.mat

A 0-1 matrix of the same size as rate.mat. This matrix labels the substitutions of interest.

edge.set1, edge.set2

Two integer vectors of branch indices specifying the branch sets over which the joint posterior moments will be calculated.

subtree

An integer denoting a node index in the tree. If provided, then edge.set1 will consist of the branches in the subtree beneath the specified node (including the branch above subtree), while edge.set2 will contain the branches in the complementary supertree.

root.dist

A numeric vector defining the root distribution of the evolutionary process on the tree. If this process starts at stationarity (as is commonly assumed), then the root distribution is equal to the CTMC stationary distribution.

scale

A logical indicating whether to scale the time dimension. If TRUE, then time is specified in terms of the expected number of CTMC substitutions per site.

N

An integer specifying the number of Monte Carlo samples to draw.

Details

The means obtained in this function are computed exactly, while the variances and covariance are partially approximated using Monte Carlo simulations.

More information on phylogenetic tree objects of class "phylo" can be found at http://ape-package.ird.fr/misc/FormatTreeR_24Oct2012.pdf.

Value

A numeric vector holding the means, variances, and covariance of the posterior mean of labeled substitution counts.

References

Dhar A and Minin VN (2017) “Calculating Higher-Order Moments of Phylogenetic Stochastic Mapping Summaries in Linear Time”, Journal of Computational Biology, 24(5):377-399.

See Also

joint.prior.moments.phylojumps, joint.post.moments.phylojumps, postmean.moments.phylojumps


dunleavy005/phylomoments documentation built on May 15, 2019, 5:59 p.m.