Description Usage Arguments Value Author(s) References See Also Examples
View source: R/PhyloMeasures.R
Calculates the mean and standard deviation of the Mean Nearest Taxon Distance (MNTD) for a tree and a vector of tip set sizes. The means and deviations can be calculated under three different null models which maintain species richness. Note: this function returns a result for the "uniform" and "frequency.by.richness" models only if the input tree is ultrametric.
1 2 | mntd.moments(tree, sample.sizes, comp.expectation = TRUE, comp.deviation = TRUE,
null.model="uniform", abundance.weights, reps=1000, seed)
|
tree |
A phylo tree object |
sample.sizes |
A vector of non-negative integers specifying the tip set sizes for which to calculate moments |
comp.expectation |
Specifies whether the function should compute the mean (default = TRUE) |
comp.deviation |
Specifies whether the function should compute the standard deviation (default = TRUE) |
null.model |
A character vector (string) that defines which null model is used for computing the moments of the measure. There are three possible null models that can be used for computing the moments: these are "uniform", "frequency.by.richness", and "sequential". All these models maintain species richness. More specifically, the available models are defined as follows:
This argument is optional, and its default value is set to "uniform". |
abundance.weights |
A vector of positive numeric values. These are the abundance weights that will be used if either of the options "frequency.by.richness" or "sequential" are selected. The names stored at the vector must match the names of the tips in the tree. This argument is redundant if the "uniform" model is selected. |
reps |
An integer that defines the number of Monte-Carlo random repetitions that will be performed when using the "sequential" model. This argument is redundant if any of the other two null models is selected. |
seed |
A positive integer that defines the random seed used in the Monte-Carlo randomizations of the "sequential" model. This argument is optional, and becomes redundant if any of the other two null models is selected. |
If both comp.expectation and comp.deviation are TRUE, the function returns a two-column matrix with one row per element in sample.sizes, where the first column stores the mean MNTD and the second column stores the standard deviation for this sample size. If only one of comp.expectation or comp.deviation are TRUE, the function returns a vector with the corresponding values instead.
Constantinos Tsirogiannis (tsirogiannis.c@gmail.com)
Tsirogiannis, C. and B. Sandel. 2015. PhyloMeasures: A package for computing phylogenetic biodiversity measures and their statistical moments. Ecography, doi: 10.1111/ecog.01814, 2015.
Tsirogiannis, C., B. Sandel and A. Kalvisa. 2014. New algorithms for computing phylogenetic biodiversity. Algorithms in Bioinformatics, LNCS 8701: 187-203.
Webb, C.O. 2000. Exploring the phylogenetic structure of ecological communities: An example for rain forest trees. The American Naturalist 156: 145-155.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #Load phylogenetic tree of bird families from package "ape"
data(bird.families, package = "ape")
# Calculate mean and variance under the uniform model
mntd.moments(bird.families,1:100)
# Create random abundance weights
weights = runif(length(bird.families$tip.label))
names(weights) = bird.families$tip.label
# Calculate mean and variance under the sequential model
mntd.moments(bird.families,1:100,
null.model="sequential", abundance.weights=weights, reps=1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.