R: Estimate maximum shift credibility configuration
maximumShiftCredibility
R Documentation
Estimate maximum shift credibility configuration
Description
This is one estimate of the "best" rate shift configuration,
considering only those shift configurations that were actually sampled
using BAMM's reversible jump MCMC simulator. This is analogous
to the "maximum clade credibility tree" from a Bayesian phylogenetic
analysis. It is not necessarily the same as the shift configuration
with the maximum a posteriori probability.
Maximize the marginal probability of the product or sum of
branch-specific shifts.
Details
This is one point estimate of the overall "best" rate shift
configuration. Following an MCMC simulation, the marginal shift
probabilities on each individual branch are computed using
marginalShiftProbsTree. The shift configuration that
maximizes the product (or sum, if specified) of these marginal
branch-specific shift probabilities is the maximum shift
credibility configuration.
This option is only recommended if you have no clear "winner" in your
credible set of shift configurations (see
credibleShiftSet). If you have a number of
largely-equiprobable shift configurations in your 95% credible set,
you may wish to try this function as an alternative for identifying a
single best shift configuration. Otherwise, it is recommended that you
present the shift configuration with the maximum a posteriori
probability (see getBestShiftConfiguration).
Value
A list with the following components:
bestconfigs A vector of the index values of MCMC samples
with shift configurations equal to the maximum. Usually, more
than one state sampled during the MCMC simulation will have an
identical (maximized) marginal probability. All samples given
in this vector will have an identical shift configuration.
scores The optimality score (product or sum of marginal
shift probabilities) for all sampled shift configurations in
the BAMMdata object.
optimalityType Whether the product or sum of marginal
shift probabilities was used to compute the maximum shift
credibility configuration.
sampleindex A representative sample that is equal to the
maximum shift credibility configuration (e.g., this can be
plotted with addBAMMshifts).
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BAMMtools)
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAMMtools/maximumShiftCredibility.Rd_%03d_medium.png", width=480, height=480)
> ### Name: maximumShiftCredibility
> ### Title: Estimate maximum shift credibility configuration
> ### Aliases: maximumShiftCredibility
> ### Keywords: graphics manip
>
> ### ** Examples
>
> data(whales, events.whales)
> ed <- getEventData(whales, events.whales, burnin=0.25, nsamples=500)
Processing event data from data.frame
Discarded as burnin: GENERATIONS < 2495000
Analyzing 500 samples from posterior
Setting recursive sequence on tree...
Done with recursive sequence
> best_config <- maximumShiftCredibility(ed)
> plot(ed)
> addBAMMshifts(ed, method='phylogram', index=best_config$sampleindex)
>
>
>
>
>
> dev.off()
null device
1
>