Yesterday my paper (Boettiger et. al. 2012)  appeared in early view in Evolution (author’s preprint),As the open access copy doesn’t appear on pubmed for a while, you can access my author’s copy here. so I’d like to take this chance to share the back-story and highlight my own view on some of our findings, and the associated package on CRAN.Just submitted, meanwhile, the code is always on github.

I didn’t set out to write this paper.  I set out to write a very different paper, introducing a new phylogenetic method for continuous traits that estimates changes in evolutionary constraint.  This adds _even more _parameters than already present in rich models multi-peak OU process, and I wanted to know if it could be justified – if there really was enough information to play the game we already had, before I went and made the situation even worse. Trying to find something rigorous enough to hang my hat on, I ended up writing this paper.

### The short of it

There’s essentially three conclusions I draw from the paper.

1. AIC is not a reliable way to select models.

2. Certain parameters, such as $$\lambda$$, a measure of “phylogenetic signal,” (Pagel, 1999) are going to be really hard to estimate.

3. BUT as long as we simulate extensively to test model choice and parameter uncertainty, we won’t be misled by either of these.  So it’s okay to drink the koolaid (Losos, 2011), but drink responsibly.

### A few reflections

I really have two problems with AIC and other information criteria when it comes to phylogenetic methods.  One is that it’s too easy to simulate data from one model, and have the information criteria choose a ridiculously over-parameterized model instead.  In one example, the wrong model has a $$\Delta$$AIC of 10 points over the correct model.

But a more basic problem is that it’s just not designed for hypothesis testing – it doesn’t care how much data you have, it doesn’t give a notion of significance.  If we’re ascribing biological meaning to different models as different hypotheses, we need want a measure of uncertainty.

When estimating parameters that scale branch length, I think we must be cautious because these are really data-hungry, and don’t work well on small trees. Check out how few of these estimates of lambda on 100 replicate datasets hit near the correct value shown by vertical line:

The package commands are explained in more detail in the package vignette, but the idea is simple. Running the pmc comparison between two models (for the model-choice step) looks like this:

bm_v_lambda <- pmc(geospiza.tree, geospiza.data["wingL"],
"BM", "lambda", nboot=100)

Extracting the distribution of estimates for the parameter lambda got from fitting the lambda model (B) to data made by simulating under lambda model (A):

lambdas <- subset(bm_v_lambda["par_dists"],
comparison=="BB" & parameter=="lambda")

To view the model comparison, just plot the pmc result:

plot(bm_v_lambda)

The substantial overlap in the likelihood ratios after simulating under either model indicate that we cannot choose between BM and lambda in this case.  I’ll leave the paper to explain this approach in more detail, but it’s just simulation and refitting.

You could just bootstrap the likelihoods or for nested models, look at the parameter distributions, but you get the maximum statistical power from the ratio (says Neyman-Pearson Lemma).

### A technical note: mix and match formats

Many users don’t like going between ouch format and ape/phylo formats. The pmc package doesn’t care what you use, feel free to mix and match. In case the conversion tools are useful, I’ve provided functions to move your data and trees back and forth between those formats too.  See format_data() to data-frames and convert() to toggle between tree formats.

## Reproducible Research

The package is designed to make things easier.  It comes with a vignette (written in sweave) showing just what commands to run to replicate the results from the manuscript.

This entire project has been documented in my open lab notebook from its inception. Posts prior to October 2010 can be found on my OWW notebook, the rest in my current phylogenetics notebook (here on wordpress). Of course this project is interwoven with many notes on related and more recent work.