threshBayes {phytools}R Documentation

Threshold model using Bayesian MCMC


This function uses Bayesian MCMC to fit the quantitative genetics threshold model (Felsenstein 2012) to data for two discrete characters or one discrete and one continuous character.


threshBayes(tree, X, types=NULL, ngen=1000, control=list())



an object of class "phylo".


a numeric matrix containing values for a numerically coded discrete character and a continuous character; or two discrete characters. The row names of X should be species names.


a vector of length ncol(X) containing the data types for each column of X, for instance c("discrete","continuous").


a integer indicating the number of generations for the MCMC.


a list of control parameters for the MCMC. Control parameters include: sample, the sampling interval for the MCMC; propvar, a vector containing (in this order) proposal variances for the two rates (if the type is "discrete" this will be ignored), the two ancestral states, and the correlation; propliab, a single proposal variance for the liabilities; pr.mean, a vector for the mean of the prior probability distributions for each parameter, in the same order as propvar; pr.liab, currently ignored; pr.var, a vector with variances for the prior densities for each parameter, in the same order as pr.mean - note that for the rates we use an exponential distribution so the first two means are currently ignored; and pr.vliab currently ignored.


This function returns a list with two elements: par a matrix containing the posterior sample for the model parameters (evolutionary rates, ancestral states, and correlation); liab a matrix containing the posterior sample of the liabilities. For continuous characters, the liabilities are treated as known and so the posterior samples are just the observed values.


Liam Revell


Felsenstein, J. (2012) A comparative method for both discrete and continuous characters using the threshold model. American Naturalist, 179, 145-156.

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

Revell, L. J. (2014) Ancestral character estimation under the threshold model from quantitative genetics. Evolution, bold68, 743-759.

See Also

anc.Bayes, bmPlot, evol.rate.mcmc

[Package phytools version 0.4-60 Index]