calibrations | R Documentation |
Density, distribution, and quantile functions for calibrations used in MCMCtree.
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)
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 |
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).
A vector of density, probability, or quantile values as appropriate.
Mario dos Reis
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.