Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Nick Matzke
It's a shame there aren't awards for great threads, because this is one!

The minor twist I would throw in is that it's difficult to make universal
generalizations about the quality of ancestral state estimation.  If one is
interested in the ancestral state value at node N, it might be reasonably
estimated if it is nested high up within the phylogeny, if the rates of
change aren't high, etc. And (local) trends etc might well be reliably
inferred.  We are pretty confident that the common ancestor of humans and
chimps was larger than many deeper primate ancestors, for instance. If N is
the root of your available phylogeny, however, you have to be much more
cautious.

Cheers,
Nick


On Wed, Jun 13, 2018 at 6:57 AM, Joe Felsenstein 
wrote:

> Let me add more warnings to Marguerite and Thomas's excellent
> responses.   People may be tempted to infer ancestral states and then
> treat those inferences as data (and also to infer ancestral
> environments and then treat those inferences as data).  In fact, I
> wonder whether that is not the main use people make of these
> inferences.
>
> But not only are those inferences very noisy, they are correlated with
> each other.  So if you infer the ancestral state for the clade (Old
> World Monkeys, Apes) and also the ancestral state for the clade (New
> World Monkeys, (Old World Monkeys, Apes)) the two will typically not
> only be error-prone, but will also typically be subject to strongly
> correlated errors.  Using them as data for further inferences is very
> dubious.  It is better to figure out what your hypothesis is and then
> test it on the data from the tips of the tree, without the
> intermediate step of taking ancestral state inferences as
> observations.
>
> The popular science press in particular demands a fly-on-the-wall
> account of what happened in evolution, and giving them the ancestral
> state inferences as if they were known precisely is a mistake.
>
> Joe
> 
> Joe Felsenstein j...@gs.washington.edu
>  Department of Genome Sciences and Department of Biology,
>  University of Washington, Box 355065, Seattle, WA 98195-5065 USA
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Joe Felsenstein
Let me add more warnings to Marguerite and Thomas's excellent
responses.   People may be tempted to infer ancestral states and then
treat those inferences as data (and also to infer ancestral
environments and then treat those inferences as data).  In fact, I
wonder whether that is not the main use people make of these
inferences.

But not only are those inferences very noisy, they are correlated with
each other.  So if you infer the ancestral state for the clade (Old
World Monkeys, Apes) and also the ancestral state for the clade (New
World Monkeys, (Old World Monkeys, Apes)) the two will typically not
only be error-prone, but will also typically be subject to strongly
correlated errors.  Using them as data for further inferences is very
dubious.  It is better to figure out what your hypothesis is and then
test it on the data from the tips of the tree, without the
intermediate step of taking ancestral state inferences as
observations.

The popular science press in particular demands a fly-on-the-wall
account of what happened in evolution, and giving them the ancestral
state inferences as if they were known precisely is a mistake.

Joe

Joe Felsenstein j...@gs.washington.edu
 Department of Genome Sciences and Department of Biology,
 University of Washington, Box 355065, Seattle, WA 98195-5065 USA

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Thomas F Hansen
Hi Marguerie, Simone and everyone,

Like Marguerie says there is no need to transform the OU process. If you have 
fitted an OU process, then you know the joint  distribution of all the the 
species and nodes. It is a multivariate normal, and you can use standard 
formulas for prediction of the nodes. We gave a general formula for such 
prediction in Martins and Hansen (1997. Am. Nat. 149: 646-667), but it is just 
standard prediction theory. The one thing to add to Marguerite's descriptions 
is that you need to include the fixed effects (predicted optima) for the nodes 
in your prediction. 

While I am at it, let me echo Simone and Marguerite's warnings. The predicted 
ancestral states will reflect the process you assumed to predict them. Hence, 
if you  use them to make inferences about evolution, you will recover your own 
assumptions. I.e. if you predict from a model with no trend, you will find no 
trend, etc. Many comparative studies are flawed for this reason. 

Cheers,

Thomas

> On Jun 12, 2018, at 09:43, Simone Blomberg  wrote:
> 
> I would add an extra caveat to Marguerite’s excellent post: Most researchers 
> work with extant taxa only, ignoring extinction. This causes a massive 
> ascertainment bias, and the character states of the extinct taxa can often be 
> very different to the ancestral state reconstructions, particularly if the 
> evolutionary model is wrong. Eg. there has been an evolutionary trend for 
> example. Ancestral state reconstructions based only on extant taxa should be 
> treated as hypotheses to be tested with fossil data. I wouldn’t rely on them 
> for much more.
> 
> Cheers,
> Simone.
> 
> Sent from my iPhone
> 
> On 12 Jun 2018, at 4:59 pm, Marguerite Butler  > wrote:
> 
>> Aloha all,
>> 
>> There is no requirement for an ultra metric tree in the formulae reported in 
>> Butler-King 2004. Interested investigators should in particular read the 
>> supplementary materials where the mathematical details are worked out. 
>> 
>> We do generally use ultrametric trees because as comparative biologists, it 
>> is more straightforward to think about evolution in units of time rather 
>> than in terms of mutational units, etc. However this is by choice, not any 
>> methodological limitation. 
>> 
>> Once the model parameters are found, the phylogenetic variance-covariance 
>> matrix defined by the alpha, thetas, and sigmas can be used to compute 
>> ancestral states using a weighted least squares reconstruction method 
>> (instead of the typical BM var-cov matrix). The mapping of the alphas, 
>> thetas, and sigmas onto the tree are incorporated into this V-COV matrix, so 
>> that accounts for the OU model. 
>> 
>> NOTES: 
>> 1) without knowing why you are doing this, I do feel compelled to warn you 
>> that it is unclear why one would want to estimate ancestral states for 
>> poorly-fitting models. Be careful!
>> 
>> 2) I hope you realize that ancestral states are in general poorly estimated, 
>> even assuming the “correct” model. This is because there is less and less 
>> information to anchor the values as you get farther from the tips, similar 
>> to the root estimation problem described below.  This issue was clearly 
>> exposed in Schluter et al 1997 (and less famously so in Butler and Losos 
>> 1997). These depressing results were among the motivations for developing 
>> model-fit approaches in the first place. 
>> 
>> 3) In 2008/2009 the algorithms in OUCH, SLOUCH, and possibly other methods 
>> have changed in the estimation of the value of the root state (X0) which is 
>> an internal calculation in fitting the model.  Ho and Ane 2013, and Hansen 
>> et al 2008 both reported that the root state X0 is ill-defined (unless there 
>> are fossil data to anchor the value). This makes sense intuitively, as all 
>> of the information is from the tips, and the root is very far down the tree. 
>> A reasonable assumption is that it is distributed according to the 
>> stationary distribution of the OU process (X0 ~ N(theta(0), sigma^2/2*alpha) 
>> and this assumption is what these methods now employ. 
>> 
>> 4) Whatever you end up doing, do check for the robustness of your results 
>> with parametric bootstrap on your fitted models (a la Boettinger et al 
>> 2012). As many investigators have reported, these parameters can have large 
>> confidence intervals, and can covary with one another (being on a likelihood 
>> ridge, etc.). But do note that even when parameters may not be uniquely 
>> identifiable, it may still be possible to have robust model selection (see 
>> Cressler et al 2015).  So perhaps you want to fit ancestral states to see if 
>> the different models give you the same states? IDK?
>> 
>> So in short, yes, you can do it, with any number of methods. But why? If you 
>> can answer your biological question with methods that do not involve 
>> estimation of a parameter that is inherently fraught with error, it might be 
>> better to go 

Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread John Soghigian
Hello all,

The package mvMORPH can also do ancestral state reconstruction of
continuous characters for some OU-related models, including OUM, but I
don't believe it has all the models Bruno is after. There's an example
given in one of the vignettes of using mvMORPH for reconstructing a
continuous character.

John


John Soghigian, Ph.D.
Postdoctoral Associate
Deparment of Ecology and Evolutionary Biology
Yale University
21 Sachem Street
New Haven, CT
06511


On Mon, Jun 11, 2018 at 11:55 PM, Brian O'Meara 
wrote:

> Prompted by Bruno's email, and similar requests by some students at the
> Arnold & Felsenstein Evolutionary Quantitative Genetics course, we've
> started adding ancestral state reconstruction to OUwie. It still needs
> debugging and testing, but should be ready fairly soon. I do believe bayou
> does ancestral state estimation, too, but I don't think all the models you
> want will be in the set. Could be adequate to answering the biological
> question, though.
>
> Best,
> Brian
>
> ___
> Brian O'Meara, http://www.brianomeara.info, especially Calendar
> , CV
> , and Feedback
> 
>
> Associate Professor, Dept. of Ecology & Evolutionary Biology, UT Knoxville
> Associate Head, Dept. of Ecology & Evolutionary Biology, UT Knoxville
> Associate Director for Postdoctoral Activities, National Institute for
> Mathematical & Biological Synthesis  (NIMBioS)
>
>
>
> On Mon, Jun 11, 2018 at 6:01 PM David Bapst  wrote:
>
> > Just to follow off what Lucas said, but please note you cannot rescale
> > branches of a phylogeny using an OU model when the tree is
> > non-ultrametric (such as when it contains extinct, fossil taxa as
> > tips). Slater (2014, MEE) discusses this more in a brief correction to
> > Slater (2013).
> >
> > I don't know if anyone in this conversation has a non-ultrametric
> > tree, but I wanted to make that clear for anyone who stumbles on this
> > thread n the future using a google search.
> > -Dave
> >
> >
> >
> > On Sun, Jun 10, 2018 at 12:25 PM, Lucas Jardim  >
> > wrote:
> > > Hi Bruno,
> > >
> > > You can transform the branches of your phylogeny using the estimated
> > > parameters of OU models. Then, if those models describe the observed
> data
> > > adequatly, the transformed tree should model the observed data as a
> > > Brownian motion model. So you can use an ancestral state reconstruction
> > > based on Brownian motion model. However, I do not know if that is the
> > best
> > > approach as optimum values would not be included into the
> reconstruction
> > > process.
> > >
> > > Best,
> > > --
> > > Lucas Jardim
> > > Doutor em Ecologia e Evolução
> > > Bolsista do INCT-EECBio (Ecologia, Evolução e Conservação da
> > > Biodiversidade)
> > > Instituto de Ciências Biológicas
> > > Laboratório de Ecologia Teórica e Síntese
> > > Universidade Federal de Goiás
> > > http://dinizfilho.wix.com/dinizfilholab
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > ___
> > > R-sig-phylo mailing list - R-sig-phylo@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> > > Searchable archive at
> > http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >
> >
> >
> > --
> > David W. Bapst, PhD
> > Asst Research Professor, Geology & Geophysics, Texas A & M University
> > https://github.com/dwbapst/paleotree
> > Google Calendar: https://goo.gl/EpiM4J
> >
> > ___
> > R-sig-phylo mailing list - R-sig-phylo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> > Searchable archive at
> > http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-
> sig-ph...@r-project.org/
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Simone Blomberg
I would add an extra caveat to Marguerite’s excellent post: Most researchers 
work with extant taxa only, ignoring extinction. This causes a massive 
ascertainment bias, and the character states of the extinct taxa can often be 
very different to the ancestral state reconstructions, particularly if the 
evolutionary model is wrong. Eg. there has been an evolutionary trend for 
example. Ancestral state reconstructions based only on extant taxa should be 
treated as hypotheses to be tested with fossil data. I wouldn’t rely on them 
for much more.

Cheers,
Simone.

Sent from my iPhone

On 12 Jun 2018, at 4:59 pm, Marguerite Butler 
mailto:mbutler...@gmail.com>> wrote:

Aloha all,

There is no requirement for an ultra metric tree in the formulae reported in 
Butler-King 2004. Interested investigators should in particular read the 
supplementary materials where the mathematical details are worked out.

We do generally use ultrametric trees because as comparative biologists, it is 
more straightforward to think about evolution in units of time rather than in 
terms of mutational units, etc. However this is by choice, not any 
methodological limitation.

Once the model parameters are found, the phylogenetic variance-covariance 
matrix defined by the alpha, thetas, and sigmas can be used to compute 
ancestral states using a weighted least squares reconstruction method (instead 
of the typical BM var-cov matrix). The mapping of the alphas, thetas, and 
sigmas onto the tree are incorporated into this V-COV matrix, so that accounts 
for the OU model.

NOTES:
1) without knowing why you are doing this, I do feel compelled to warn you that 
it is unclear why one would want to estimate ancestral states for 
poorly-fitting models. Be careful!

2) I hope you realize that ancestral states are in general poorly estimated, 
even assuming the “correct” model. This is because there is less and less 
information to anchor the values as you get farther from the tips, similar to 
the root estimation problem described below.  This issue was clearly exposed in 
Schluter et al 1997 (and less famously so in Butler and Losos 1997). These 
depressing results were among the motivations for developing model-fit 
approaches in the first place.

3) In 2008/2009 the algorithms in OUCH, SLOUCH, and possibly other methods have 
changed in the estimation of the value of the root state (X0) which is an 
internal calculation in fitting the model.  Ho and Ane 2013, and Hansen et al 
2008 both reported that the root state X0 is ill-defined (unless there are 
fossil data to anchor the value). This makes sense intuitively, as all of the 
information is from the tips, and the root is very far down the tree. A 
reasonable assumption is that it is distributed according to the stationary 
distribution of the OU process (X0 ~ N(theta(0), sigma^2/2*alpha) and this 
assumption is what these methods now employ.

4) Whatever you end up doing, do check for the robustness of your results with 
parametric bootstrap on your fitted models (a la Boettinger et al 2012). As 
many investigators have reported, these parameters can have large confidence 
intervals, and can covary with one another (being on a likelihood ridge, etc.). 
But do note that even when parameters may not be uniquely identifiable, it may 
still be possible to have robust model selection (see Cressler et al 2015).  So 
perhaps you want to fit ancestral states to see if the different models give 
you the same states? IDK?

So in short, yes, you can do it, with any number of methods. But why? If you 
can answer your biological question with methods that do not involve estimation 
of a parameter that is inherently fraught with error, it might be better to go 
another way. Bottom line - use caution and be thoughtful!

I am sure if I have made any errors Aaron, Clay, or Thomas will help.

Hope this helps

Marguerite


Schluter, D., T. Price, A. O. Mooers, and D. Ludwig. 1997. Likelihood of 
ancestor states in adaptive radiation. Evolution 51:1699–1711.

Butler, M. A., and J. B. Losos. 1997. Testing for unequal amounts of evolution 
in a continuous character on dif- ferent branches of a phylogenetic tree using 
linear and squared-change parsimony: an example using Lesser Antillean Anolis 
lizards. Evolution 51:1623–1635.

Hansen T.F., Pienaar J., Orzack S.H. 2008. A comparative method for studying 
adaptation to a randomly evolving environment. Evolution 62:1965–1977.

Ho L.S.T., Ané C.. 2014. Intrinsic inference difficulties for trait evolution 
with Ornstein-Uhlenbeck models. Methods Ecol. Evol. 2:1133–1146.

Cressler C., Butler M.A., and King A. A. (2015) Detecting adaptive evolution in 
phylogenetic comparative analysis using the Ornstein-Uhlenbeck model.  Sys. 
Bio. 64(6):953-968. DOI: 10.1093/sysbio/syv043

Boettiger C., Coop G., Ralph P. 2012. Is your phylogeny informative? Measuring 
the power of comparative methods. Evolution 66: 2240–2251.



Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Marguerite Butler
Aloha all,

There is no requirement for an ultra metric tree in the formulae reported in 
Butler-King 2004. Interested investigators should in particular read the 
supplementary materials where the mathematical details are worked out. 

We do generally use ultrametric trees because as comparative biologists, it is 
more straightforward to think about evolution in units of time rather than in 
terms of mutational units, etc. However this is by choice, not any 
methodological limitation. 

Once the model parameters are found, the phylogenetic variance-covariance 
matrix defined by the alpha, thetas, and sigmas can be used to compute 
ancestral states using a weighted least squares reconstruction method (instead 
of the typical BM var-cov matrix). The mapping of the alphas, thetas, and 
sigmas onto the tree are incorporated into this V-COV matrix, so that accounts 
for the OU model. 

NOTES: 
1) without knowing why you are doing this, I do feel compelled to warn you that 
it is unclear why one would want to estimate ancestral states for 
poorly-fitting models. Be careful!

2) I hope you realize that ancestral states are in general poorly estimated, 
even assuming the “correct” model. This is because there is less and less 
information to anchor the values as you get farther from the tips, similar to 
the root estimation problem described below.  This issue was clearly exposed in 
Schluter et al 1997 (and less famously so in Butler and Losos 1997). These 
depressing results were among the motivations for developing model-fit 
approaches in the first place. 

3) In 2008/2009 the algorithms in OUCH, SLOUCH, and possibly other methods have 
changed in the estimation of the value of the root state (X0) which is an 
internal calculation in fitting the model.  Ho and Ane 2013, and Hansen et al 
2008 both reported that the root state X0 is ill-defined (unless there are 
fossil data to anchor the value). This makes sense intuitively, as all of the 
information is from the tips, and the root is very far down the tree. A 
reasonable assumption is that it is distributed according to the stationary 
distribution of the OU process (X0 ~ N(theta(0), sigma^2/2*alpha) and this 
assumption is what these methods now employ. 

4) Whatever you end up doing, do check for the robustness of your results with 
parametric bootstrap on your fitted models (a la Boettinger et al 2012). As 
many investigators have reported, these parameters can have large confidence 
intervals, and can covary with one another (being on a likelihood ridge, etc.). 
But do note that even when parameters may not be uniquely identifiable, it may 
still be possible to have robust model selection (see Cressler et al 2015).  So 
perhaps you want to fit ancestral states to see if the different models give 
you the same states? IDK?

So in short, yes, you can do it, with any number of methods. But why? If you 
can answer your biological question with methods that do not involve estimation 
of a parameter that is inherently fraught with error, it might be better to go 
another way. Bottom line - use caution and be thoughtful!

I am sure if I have made any errors Aaron, Clay, or Thomas will help.

Hope this helps

Marguerite

Schluter, D., T. Price, A. O. Mooers, and D. Ludwig. 1997. Likelihood of 
ancestor states in adaptive radiation. Evolution 51:1699–1711.

Butler, M. A., and J. B. Losos. 1997. Testing for unequal amounts of evolution 
in a continuous character on dif- ferent branches of a phylogenetic tree using 
linear and squared-change parsimony: an example using Lesser Antillean Anolis 
lizards. Evolution 51:1623–1635. 

Hansen T.F., Pienaar J., Orzack S.H. 2008. A comparative method for studying 
adaptation to a randomly evolving environment. Evolution 62:1965–1977.

Ho L.S.T., Ané C.. 2014. Intrinsic inference difficulties for trait evolution 
with Ornstein-Uhlenbeck models. Methods Ecol. Evol. 2:1133–1146.

Cressler C., Butler M.A., and King A. A. (2015) Detecting adaptive evolution in 
phylogenetic comparative analysis using the Ornstein-Uhlenbeck model.  Sys. 
Bio. 64(6):953-968. DOI: 10.1093/sysbio/syv043

Boettiger C., Coop G., Ralph P. 2012. Is your phylogeny informative? Measuring 
the power of comparative methods. Evolution 66: 2240–2251. 


Marguerite A. Butler
Professor

Department of Biology 
2538 McCarthy Mall, Edmondson Hall 216 
Honolulu, HI 96822

Office: 808-956-4713
Dept: 808-956-8617
Lab:  808-956-5867
FAX:   808-956-4745
http://butlerlab.org
http://manoa.hawaii.edu/biology/people/marguerite-butler
http://www2.hawaii.edu/~mbutler


> On Jun 11, 2018, at 7:33 PM, Simone Blomberg  wrote:
> 
> This sounded wrong to me, as the OU process should be agnostic to the 
> dataset: There are no restrictions inherent in the OU process that apply 
> particularly to phylogenetic data, whether the tree is ultrametric or not. I 
> re-read Slater 2014 and it is clear that you can use branch length 
>