CV: Cross-Validation with Penalized Likelihood Chronograms

View source: R/CV.R

CVR Documentation

Cross-Validation with Penalized Likelihood Chronograms

Description

Computes the cross-validation (CV) of a chronogram using penalized likelihood.

Usage

CV(
  phy,
  lambda = 10^(-3:2),
  model = "correlated",
  quiet = FALSE,
  calibration = makeChronosCalib(phy)
)

Arguments

phy

an object of class "phylo".

lambda

a numeric vector with the values of smoothing parameter to be assessed.

model

the model of rate evolution. currently set to autocorrelated.

quiet

a logical value.

calibration

a data frame with the calibration dates of the chronogram.

Details

This follows the CV calculation described in Sanderson (2002).

Value

a matrix with two columns named lambda and CV.

Author(s)

Emmanuel Paradis, Santiago Claramunt, Joseph Brown, Klaus Schliep

References

Paradis, E., Claramunt, S., Brown, J., and Schliep, K. Confidence intervals in molecular dating by penalized likelihood. (in preparation)

Sanderson, M. J. (2002) Estimating absolute rates of molecular evolution and divergence times: a penalized likelihood approach. Molecular Biology and Evolution, 19, 101–109.

See Also

qage() drawChronosCI() ape::chronos() ape::makeChronosCalib()

Examples

## a simple random tree, so lambda is expected to be zero
library(ape)
tr <- rtree(10)
res <- CV(tr, 10^seq(-4, 2, 0.25))
plot(res, type = "o", log = "xy")

## create 'artificial' auto-correlation among branches by sorting
## them according to their lengths:
tr$edge.length <- sort(tr$edge.length)
res <- CV(tr, 10^seq(-4, 2, 0.25))
plot(res, type = "o", log = "xy")

josephwb/chronos documentation built on Jan. 27, 2023, 2:35 a.m.