parboot: Estimate of confidence intervals using parametric bootstrap...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/boot.R

Description

This function simulates phylogenies with branch lengths in units of substitutions per site. Simulations are based on a fitted treedater object which provides parameters of the molecular clock model. The treedater method is applied to each simulated tree providing a Monte Carlo estimate of variance in rates and dates.

Usage

1
2
3
4
parboot(td, nreps = 100, ncpu = 1, overrideTempConstraint = TRUE,
  overrideClock = NULL, overrideSearchRoot = TRUE,
  overrideSeqLength = NULL, quiet = TRUE, normalApproxTMRCA = FALSE,
  parallel_foreach = FALSE)

Arguments

td

A fitted treedater object

nreps

Integer number of simulations to be carried out

ncpu

Number of threads to use for parallel computation. Recommended.

overrideTempConstraint

If TRUE (default) will not enforce positive branch lengths in simualtion replicates. Will speed up execution.

overrideClock

May be 'strict' or 'additive' or 'uncorrelated' in which case will force simulations to fit the corresponding model. If ommitted, will inherit the clock model from td

overrideSearchRoot

If TRUE, will re-use root position from input treedater tree. Otherwise may re-estimate root position in simulations

overrideSeqLength

Optional sequence length to use in simulations

quiet

If TRUE will minimize output printed to screen

normalApproxTMRCA

If TRUE will use estimate standard deviation from simulation replicates and report confidence interval based on normal distribution

parallel_foreach

If TRUE will use the foreach package for parallelization. May work better on HPC systems.

Details

If the original treedater fit estimated the root position, root position will also be estimated for each simulation, so the returned trees may have different root positions. Some replicates may converge to a strict clock or a relaxed clock, so the parameter estimates in each replicate may not be directly comparable. It is possible to compute confidence intervals for the times of particular nodes or for estimated sample times by inspecting the output from each fitted treedater object, which is contained in the $trees attribute.

Value

A list with elements

Author(s)

Erik M Volz <erik.volz@gmail.com>

See Also

dater boot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# make a random tree
tre <- ape::rtree(25)
# simulate 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, s=1000, clock='strict', omega0=.0015 )
# parametric bootstrap: 
pb <- parboot( td, nreps=25 )
# plot lineages through time
plot( pb )

treedater documentation built on Jan. 27, 2020, 1:06 a.m.