Learn R Programming

phytools (version 0.2-40)

threshBayes: Threshold model using Bayesian MCMC

Description

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.

Usage

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

Arguments

tree
an object of class "phylo".
X
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.
types
a vector of length ncol(X) containing the data types for each column of X, for instance c("discrete","continuous").
ngen
a integer indicating the number of generations for the MCMC.
control
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"

Value

  • 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.

See Also

anc.Bayes, bmPlot, evol.rate.mcmc