gibbs_jitter: Sample node dates conditional on root time using Gibbs...

View source: R/treedater0.R

gibbs_jitterR Documentation

Sample node dates conditional on root time using Gibbs sampling and date prior

Description

This function is useful for 'smoothing out' time trees that have many adjacent small branch lengths (essential polytomies). It returns a list of smoothed trees.

Usage

gibbs_jitter(
  dtr,
  iter = 1000,
  burn_pc = 20,
  returnTrees = 10,
  res = 100,
  report = 10
)

Arguments

dtr

A treedater fit

iter

Number of iterations (every node time is resampled in each iteration )

burn_pc

Remove this proportion as burnin

returnTrees

Integer number of trees to return.

res

Time resolution for proposing new node times

report

Report progress after this many iterations. Set to Inf to turn it off

return

A list of treedater trees

Examples

## Not run: 
# make a random tree:
tre <- ape::rtree(50)
# sample times based on distance from root to tip:
sts <- setNames( ape::node.depth.edgelength( tre )[1:ape::Ntip(tre)], tre$tip.label)
# modify edge length to represent evolutionary distance with rate 1e-3:
tre$edge.length <- tre$edge.length * 1e-3
# treedater: 
td <- dater( tre, sts =sts, clock='strict', s = 1000, omega0=.0015 )
gibbs_jitter( td )

## End(Not run)

emvolz/treedater documentation built on March 25, 2022, 11:13 a.m.