sample.congruence.class.posterior: Stochastic exploration of congruent models for all samples in...

Description Usage Arguments Value Examples

View source: R/sample.congruence.class.posterior.R

Description

This function takes a posterior sample as input: a list of ACDC objects. It will then iterate over the samples, and for each posterior sample it will sample from the posterior class. It will sample using the sample.basic.models function, and all additional parameters are passed to sample.basic.models.

Usage

1
2
3
4
5
6
sample.congruence.class.posterior(
  posterior,
  num.samples,
  rate.type = "extinction",
  ...
)

Arguments

posterior

a list of ACDC model objects

num.samples

The pulled diversification rate function (measured in time before present).

rate.type

either "extinction", "speciation", or "both"

...

Arguments passed on to sample.basic.models

times

the time knots

rate0

The rate at present, otherwise drawn randomly.

model

"MRF" for pure MRF model, otherwise MRF has a trend of type "exponential","linear", or "episodic<n>"

direction

"increase" or "decrease" (measured in past to present)

noisy

If FALSE, no MRF noise is added to the trajectory

MRF.type

"HSMRF" or "GMRF", type for stochastic noise.

monotonic

Whether the curve should be forced to always move in one direction.

fc.mean

Determines the average amount of change when drawing from the model.

rate0.median

When not specified, rate at present is drawn from a lognormal distribution with this median.

rate0.logsd

When not specified, rate at present is drawn from a lognormal distribution with this sd

min.rate

The minimum rate (rescaling fone after after drawing rates).

max.rate

The maximum rate (rescaling fone after after drawing rates).

Value

A named list with congruent rates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(primates_ebd_log)

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

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

print(samples)

ACDC documentation built on Jan. 13, 2022, 1:08 a.m.