ancThresh | R Documentation |

This function uses Bayesian MCMC to estimate ancestral states and thresholds for a discrete character under the threshold model from quantitative genetics (Felsenstein 2012).

```
ancThresh(tree, x, ngen=100000, sequence=NULL, method="mcmc",
model=c("BM","OU","lambda"), control=list(), ...)
```

`tree` |
phylogenetic tree. |

`x` |
a named vector containing discrete character states; or a matrix containing the tip species, in rows, and probabilities of being in each state, in columns. |

`ngen` |
number of generations to run the MCMC. |

`sequence` |
assumed ordering of the discrete character state. If not supplied and |

`method` |
only method currently available is |

`model` |
model for the evolution of the liability. Options are |

`control` |
list containing the following elements: |

`...` |
additional arguments to be passed to |

According to the threshold model from evolutionary quantitative genetics, values for our observed discrete character are determined by an unseen continuous trait, normally referred to as liability. Every time the value for liability crosses a threshold, the observed discrete character changes in state.

Felsenstein (2012) first had the insight that this model could be used to study the evolution of discrete character traits on a reconstructed phylogenetic tree.

This function uses Bayesian MCMC to sample ancestral liabilities and thresholds for a discrete character evolution under the threshold model.

`print`

and `plot`

S3 methods are now available for the object class `"ancThresh"`

.

This function returns an object of class `"ancThresh"`

containing the posterior sample from our analysis, along with other components.

Liam Revell liam.revell@umb.edu

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

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

`anc.Bayes`

, `threshBayes`

```
## Not run:
## load data from Revell & Collar (2009)
data(sunfish.tree)
data(sunfish.data)
## extract character of interest
fmode<-setNames(sunfish.data$feeding.mode,
rownames(sunfish.data))
## run MCMC
mcmc<-ancThresh(sunfish.tree,fmode,ngen=1000000)
## plot results
plot(mcmc,mar=c(0.1,0.1,4.1,0.1))
title(main="Posterior probabilities for node states",
font.main=3)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.