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.

1 | ```
maximumShiftCredibility(ephy, maximize = "product")
``` |

`ephy` |
An object of class |

`maximize` |
Maximize the marginal probability of the product or sum of branch-specific shifts. |

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`

).

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`

).

Dan Rabosky

`marginalShiftProbsTree`

,
`addBAMMshifts`

, `cumulativeShiftProbsTree`

,
`credibleShiftSet`

,
`getBestShiftConfiguration`

1 2 3 4 5 | ```
data(whales, events.whales)
ed <- getEventData(whales, events.whales, burnin=0.25, nsamples=500)
best_config <- maximumShiftCredibility(ed)
plot(ed)
addBAMMshifts(ed, method='phylogram', index=best_config$sampleindex)
``` |

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.