summarize.posterior {CRABS}R Documentation

Summarize trends in the posterior

Description

Summarize trends in the posterior

Usage

summarize.posterior(posterior, threshold = 0.01, rate_name = "lambda", 
return_data = FALSE, rm_singleton = FALSE, per_time = TRUE, 
window_size = 1, relative_deltas = FALSE)

Arguments

posterior

a list of CRABS objects, each one representing a sample from the posterior

threshold

a threshold for when \Delta \lambda i should be interpreted as decreasing, flat, or increasing

rate_name

either "lambda" or "mu" or "delta"

return_data

instead of plots, return the plotting dataframes

rm_singleton

whether or not to remove singletons. Pass starting at present, going towards ancient

per_time

whether to compute \Delta\lambda i that are in units of per time, i.e. divide by \Delta t

window_size

the window size "k" in \Delta\lambda i = \lambda i - \lambda(i-k)

relative_deltas

whether to divide \Delta \lambda i by the local lambda value

Value

a ggplot object

Examples

data(primates_ebd_log)

posterior <- read.RevBayes(primates_ebd_log, max_t = 65, n_samples = 10)

samples <- sample.congruence.class.posterior(posterior, 
                                             num.samples = 5,
                                             rate.type = "extinction",
                                             rate0.median = 0.1,
                                             model = "MRF",
                                             max.rate = 1.0)

p <- summarize.posterior(samples, threshold = 0.05)

[Package CRABS version 1.2.0 Index]