User:Carl Boettiger/Notebook/Comparative Phylogenetics/2010/08/26

{| width="800"
 * style="background-color: #EEE"|[[Image:owwnotebook_icon.png|128px]] Comparative Phylogenetics
 * style="background-color: #F2F2F2" align="center"|  |Main project page
 * style="background-color: #F2F2F2" align="center"|  |Main project page


 * colspan="2"|
 * colspan="2"|

Power in Trees tests (Results from single OU simulation per alpha, run yesterday)
2000 replicates gives a cleaner picture of the critical alpha, though with low alpha values the estimates of p are quite variable. Also more variable on the smaller trees. Even arbitrarily large alpha aren't significant on the 5-taxa primate tree. On the small geospiza tree (13 taxa) from the geiger package we find:

P values on top row, alpha values in quotes below the p value. Notice 9 fails to be significant at 0.95% confidence level, though might as easily be somewhere around 6. For the Labrid tree with 114 taxa the pattern is clearer though not perfect:

Significance clearly sets in between alpha of 0.9 and 1.

Summary:

reducing the noise in the power estimation
I've just implemented the power test for the smallest alpha that can be detected at the 95% level using the (whatarewecallingitnow) likelihood ratio monte carlo approach on a given tree. I try simulating under successively higher alpha values and then see if the resulting dataset can be distinguished. In my first implementation, this involves only one simulation from the OU model at a given alpha, and then the N bootstrap simulations from the null brownian model per alpha.

Obviously I want more than one simulation from the OU process. It seems I could (1) simulate under the OU model of a given alpha, (2) fit the BM model to the resulting data, (3) simulate under that BM model to get the "bootstrap" data, for which (4) I refit the BM and OU models and compare the likelihood ratio of these refit models. That sounds pretty convoluted when I describe it that way, but I think this is the "natural" thing to do? i.e. steps 2-4 are the bootstrap process which I normally repeat N times for a single dataset, now instead of using a single dataset I draw a dataset from the distribution....

Plots show decreasing power with decreasing alpha






New procedure:

From these it is possible to estimate the power (see powertest.R code)

Note that the null distribution (the blue curve) doesn't actually differ and so doesn't need to be re-simulated with different values.



Meanwhile

 * Finishing the story on model choice in the Anoles dataset. Resimulating with extra replicates and including all 5 original models.
 * Good news is that 2000 bootstraps on all 6 models against each other is quite fast on the 16-processor zero, an hour or so. Bad news is the ou2 funny painted model isn't bootstrapping the LR correctly, though all the other pairs are.
 * Other sorta bad news is that OU_LP does a handy job at beating all other models under Monte Carlo Likelihood Ratio test, so the final conclusion doesn't have the punchiness a contradiction would. At least the contrived OU2 contradicts this.  Should also add the "all different" painting to the mix to demonstrate.  --Carl Boettiger 01:24, 27 August 2010 (EDT) Fixed, order of nodes conflicted.

Slideshow of results


Code updates
--Carl Boettiger 03:26, 27 August 2010 (EDT)
 * Just implemented the fast version of the power test, which avoids re-simulating from the Brownian motion null, and handles the parallelization with more finesse, and as a single function. Set to run examples overnight.


 * Removed the traitmodels support from the power test for the moment, until the convergence issues are dealt with. The s3/s4 class differences to access elements make this annoying as method dependency must be handled explicitly by if statements not automatically by class generics.  (guess could access by index? -- Nope, S4 classes aren't subsettable)

Updated power curves for trees
Using the faster approach avoiding re-sampling the null distribution for each alpha, I generate power curves for trees of different sizes and complexity. The larger, richer trees show more power.


 * Code for method
 * Code for example




 * }