Get the rate shift configuration with the maximum a
posteriori probability, e.g., the shift configuration that was sampled
most frequently with
getBestShiftConfiguration(x, expectedNumberOfShifts, threshold = 5)
The expected number of shifts under the prior.
The marginal posterior-to-prior odds ratio used as a cutoff for distinguishing between "core" and "non-core" rate shifts.
This function estimates the rate shift configuration with the
highest maximum a posteriori (MAP) probability. It returns a
bammdata object with a single sample. This can be plotted with
plot.bammdata, and individual rate shifts can then
be added with
The parameters of this object are averaged over all samples in the
posterior that were assignable to the MAP shift configuration. All
non-core shifts have been excluded, such that the only shift
information contained in the object is from the "significant" rate
shifts, as determined by the relevant marginal posterior-to-prior odds
You can extract the same information from the credible set of shift
credibleShiftSet for more
bammdata object with a single sample, corresponding
to the diversification rate shift configuration with the maximum a
posteriori probability. See
getEventData for details.
getEventData, credibleShiftSet, plot.credibleshiftset, plot.bammdata
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
data(whales, events.whales) ed <- getEventData(whales, events.whales, burnin=0.1, nsamples=500) # Get prior distribution on shifts-per-branch: bp <- getBranchShiftPriors(whales, expectedNumberOfShifts = 1) # Pass the event data object in to the function: best <- getBestShiftConfiguration(ed, expectedNumberOfShifts = 1, threshold = 5) plot(best, lwd=2) addBAMMshifts(best, cex=2) # Now we can also work with the credible shift set: css <- credibleShiftSet(ed, expectedNumberOfShifts = 1, threshold = 5) summary(css) # examine model-averaged shifts from MAP configuration- # This gives us parameters, times, and associated nodes # of each evolutionary rate regime (note that one of # them corresponds to the root) css$eventData[]; # Get bammdata representation of MAP configuration: best <- getBestShiftConfiguration(css, expectedNumberOfShifts = 1, threshold = 5) plot(best) addBAMMshifts(best)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.