tree_rescale_exp: Rescale branch lengths following the model

Description Usage Arguments Value

View source: R/model_estimation.R

Description

Function to rescale branches of a phylogenetic tree following the exponential rate proportional, or inversely-proportional, to lineage-age. This function can be used to simulate a realization of the model for posterior predictive checks among other reasons.

Usage

1
2
3
4
5
6
7
tree_rescale_exp(
  change_rate = 0.05,
  budding_prob = 0.3,
  tree,
  chunk_fraction = 0.01,
  decay_fn = TRUE
)

Arguments

change_rate

rate for the exponential distribution.

budding_prob

probability of a budding speciation on the internal node.

tree

phylogenetic tree.

chunk_fraction

fraction of the total tree-height for branch length discretization.

decay_fn

whether rates should vary proportional (FALSE) or inversely proportional (TRUE) to lineage age.

Value

a phylogenetic tree with rescaled branch lengths and reordered to "cladewise" order (see 'ape::reorder.phylo').


Caetanods/buddPhy documentation built on Oct. 12, 2021, 12:14 p.m.