William Gelnaw
2017-10-20 06:32:34 UTC
Hi all,
I've been investigating the use of Pagel's lambda and run into a problem
comparing trees that have a low speciation rate and no extinction with
trees that have a high speciation rate and lots of extinction. I'm
comparing phylogenetic signal in two characters. In the first, I simulate
a character under Brownian evolution over a 200 taxon tree and then prune
it down to 100 taxa. The second character was evolved over the pruned-down
tree. I then estimated Pagel's lambda for both characters on the
pruned-down tree. Doing this 500 times, I found that the error rate in the
estimate of lambda was not the same for the two methods of generating the
data. The difference was small but statistically significant. To my
understanding though, there shouldn't be a difference. The rate of
evolution is the same in both cases and the tree topology and branch
lengths are identical. If the characters are evolving in a Brownian way,
shouldn't there be, on average, no difference between the characters with
respect to phylogenetic signal? Could this be an artifact of using fastBM
to simulate the characters? Is there another function that I should be
using to simulate a character evolving under Brownian motion?
Here's the script I'm using:
library(phytools)
library(TreeSim)
library(adephylo)
age<-2
lambda <- 2.0
mu <- 0.5
frac <-0.6
sample_size<-100
smalltrees<-list()
Bigtrees<-sim.bd.taxa.age(200,500,lambda,mu,frac,age)
## using sim.bd.taxa.age to get an ultrametric tree with known age
subtrees<-list()
sig<-vector()
sig_sub<-vector()
for (i in 1:500){
var<-fastBM(Bigtrees[[i]],nsim=1)
tips_to_drop<-sample(1:200, 200-sample_size, replace=FALSE)
subtrees[[i]]<-drop.tip(Bigtrees[[i]], tips_to_drop)
var1<-fastBM(subtrees[[i]],nsim=1)
sig_sub[i]<-phylosig(subtrees[[i]],var,method="lambda")$lambda
sig[i]<-phylosig(subtrees[[i]],var1,method="lambda")$lambda}
lamb<-(2-sig)
## reflected the data around lambda=1 so that standard deviation has a
symmetric distribution
lamb<-c(lamb,sig)
lamb_sub<-(2-sig_sub)
lamb_sub<-c(lamb_sub,sig_sub)
var.test(lamb,lamb_sub)
Best regards,
- Will Gelnaw
[[alternative HTML version deleted]]
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/
I've been investigating the use of Pagel's lambda and run into a problem
comparing trees that have a low speciation rate and no extinction with
trees that have a high speciation rate and lots of extinction. I'm
comparing phylogenetic signal in two characters. In the first, I simulate
a character under Brownian evolution over a 200 taxon tree and then prune
it down to 100 taxa. The second character was evolved over the pruned-down
tree. I then estimated Pagel's lambda for both characters on the
pruned-down tree. Doing this 500 times, I found that the error rate in the
estimate of lambda was not the same for the two methods of generating the
data. The difference was small but statistically significant. To my
understanding though, there shouldn't be a difference. The rate of
evolution is the same in both cases and the tree topology and branch
lengths are identical. If the characters are evolving in a Brownian way,
shouldn't there be, on average, no difference between the characters with
respect to phylogenetic signal? Could this be an artifact of using fastBM
to simulate the characters? Is there another function that I should be
using to simulate a character evolving under Brownian motion?
Here's the script I'm using:
library(phytools)
library(TreeSim)
library(adephylo)
age<-2
lambda <- 2.0
mu <- 0.5
frac <-0.6
sample_size<-100
smalltrees<-list()
Bigtrees<-sim.bd.taxa.age(200,500,lambda,mu,frac,age)
## using sim.bd.taxa.age to get an ultrametric tree with known age
subtrees<-list()
sig<-vector()
sig_sub<-vector()
for (i in 1:500){
var<-fastBM(Bigtrees[[i]],nsim=1)
tips_to_drop<-sample(1:200, 200-sample_size, replace=FALSE)
subtrees[[i]]<-drop.tip(Bigtrees[[i]], tips_to_drop)
var1<-fastBM(subtrees[[i]],nsim=1)
sig_sub[i]<-phylosig(subtrees[[i]],var,method="lambda")$lambda
sig[i]<-phylosig(subtrees[[i]],var1,method="lambda")$lambda}
lamb<-(2-sig)
## reflected the data around lambda=1 so that standard deviation has a
symmetric distribution
lamb<-c(lamb,sig)
lamb_sub<-(2-sig_sub)
lamb_sub<-c(lamb_sub,sig_sub)
var.test(lamb,lamb_sub)
Best regards,
- Will Gelnaw
[[alternative HTML version deleted]]
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.org/