calibrations: Calibration densities

calibrationsR Documentation

Calibration densities

Description

Density, distribution, and quantile functions for calibrations used in MCMCtree.

Usage

dL(x, tL, p = 0.1, c = 1, pL = 0.025)

pL(q, tL, p = 0.1, c = 1, pL = 0.025)

qL(prob, tL, p = 0.1, c = 1, pL = 0.025)

dB(x, tL, tU, pL = 0.025, pU = 0.025)

dU(x, tU, pU = 0.025)

Arguments

x

numeric, vector of quantiles

tL

numeric, minimum age

p

numeric, mode parameter for truncated Cauchy

c

numeric, tail decay parameter for truncated Cauchy

pL

numeric, minimum probability bound

q

numeric, quantile

prob

numeric probability

tU

numeric, maximum age

pU

numeric, maximum probability bound

Details

Calculates the density, distribution and quantile functions for the minimum (dL) calibration, and the density function for the joint (dB) and maximum (dU) calibration bounds as implemented in MCMCtree. See Yang and Rannala (2007) and Inoue et al. (2010) for details.

Value

A vector of density, probability, or quantile values as appropriate.

Author(s)

Mario dos Reis

References

Yang and Rannala. (2006) Bayesian Estimation of Species Divergence Times Under a Molecular Clock Using Multiple Fossil Calibrations with Soft Bounds. Mol. Biol. Evol., 23: 212–226.

Inoue, Donoghue and Yang (2010) The Impact of the Representation of Fossil Calibrations on Bayesian Estimation of Species Divergence Times. Syst. Biol., 59: 74–89.

Examples

# Plot a minimum bound calibration density:
curve(dL(x, 1), from=0, to=10, n=5e2)

# Plot a joint bounds calibration density:
curve(dB(x, 1, 6), from=0, to=10, n=5e2)

# Plot a maximum bound calibration density:
curve(dU(x, 6), from=0, to=10, n=5e2)

# Probability and quantile function for minimum bound (or truncated-Cauchy):
qv <- 0:20
# calculate probability vector from quantiles:
pv <- pL(qv, tL=1)
# calculate quantiles back from probability vector:
# (note numerical error)
qL(pv, tL=1)


dosreislab/mcmc3r documentation built on March 29, 2024, 6:45 p.m.