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)

pB(q, tL, tU, pL = 0.025, pU = 0.025)

qB(prob, tL, tU, pL = 0.025, pU = 0.025)

dU(x, tU, pU = 0.025)

pU(q, tU, pU = 0.025)

qU(prob, 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, joint, dB, and maximum, dU, calibration bounds as implemented in MCMCtree (Yang and Rannala, 2006; Inoue et al. 2010). The minimum bound is implemented using a truncated Cauchy distribution (Inoue et al. 2010).

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)
# Cumulative distribution:
curve(pL(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)
# Cummulative distribution:
curve(pB(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)
# Cummulative distribution:
curve(pU(x, 6), from=0, to=10, n=5e2)

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

# Check quantile function for joint bounds:
pvB <- pB(qv, tL=2, tU=10, pL=.02, pU=.1)
# calculate quantiles back:
plot(qv, qB(pvB, tL=2, tU=10, pL=.02, pU=.1)); abline(0, 1)

# Check quantile function for upper bound:
pvU <- pU(qv, tU=15, pU=.15)
# calculate quantiles back:
plot(qv, qU(pvU, tU=15, pU=.15)); abline(0, 1)


dosreislab/mcmc3r documentation built on April 5, 2025, 4:06 p.m.