Re: [R-sig-phylo] Possible problem with Scaled likelihoods in ancestral state estimation

2023-07-28 Thread Liam J. Revell
Dear Laura.

The marginal ancestral states that you obtained under the "ER" model are 
consistent with a very high backward/forward rate of transitions between 
the two states. If the best-fitting model implies a very high 
transitions rate between the two states, then we can say almost nothing 
about the character condition for internal nodes (hence the "50:50" 
results you see).

Sometimes the /cause/ of very high estimated transition rates in an M/k/ 
model can easily be pinpointed -- for example, a pair of sister taxa 
separated by a short evolutionary distance but with different states. In 
your case, however, I don't see it. Something I've seen on rare 
occasions is a /likelihood surface/ for the M/k/ model that has a sharp 
peak close to zero, but then monotonically increases towards infinite 
(but with a much lower likelihood). Optimization can miss this first 
peak and spuriously convergence on large values for the transition rate 
/q/. One way to identify this problem would be by visualizing the 
likelihood surface. This is pretty easy with /fitMk/ (as shown on my 
blog here 
)
 
-- but if you'd like help, please send me your tree & data (or, even 
better, a saved .RData workspace) and I will take a look at your problem.

All the best, Liam

Liam J. Revell
Professor of Biology, University of Massachusetts Boston
Web: http://faculty.umb.edu/liam.revell/
Book: Phylogenetic Comparative Methods in R 
 
(/Princeton University Press/, 2022)


On 7/28/2023 9:57 AM, Laura Schaedler wrote:
>
>   
> You don't often get email from schaedler.la...@gmail.com. Learn why 
> this is important 
>   
>
> CAUTION: EXTERNAL SENDER
> Hello all,
>
> I am doing ancestral state estimation analyses with binary traits 
> (presence or absence of a behavior), and while doing so I ran into 
> something that is puzzling me.
>
> For one particular behavior, the results look wrong to me, although R 
> doesn't report any errors during the analyses. Assuming Equal rates is 
> the best model (which I previously assessed with /fitDiscrete/), no 
> matter if I use function /ace/, /make.simmap/, or /ancr/ after 
> /fitMk/, this behavior shows the same values of scaled likelihoods for 
> all ancestral states (0.5, figure attached). Setting marginal = T does 
> not change the results.
>
> When looking at this information plotted on my tree that just doesn't 
> feel right.
> I would expect likelihood values to be greater in some ancestral nodes 
> (those immediately before groups of species where all of them have the 
> behavior) and smaller in others (those before groups without the 
> behavior), not the same likelihood for all of them.
>
> Now, if I choose to run analyses with model = ARD, for /ace /and 
> /ancr/ I get results that look similar to what I would expect 
> (although /make.simmap/ yields the same result as model = ER; figure 
> attached). However, as I have previously run /fitDiscrete/ to 
> determine what is the best model for this behavior, and it was ER, I 
> don't think it makes sense to just choose ARD instead because 'it 
> looks better' (AIC weight ER = 0.74 /vs./ AIC weight ARD = 0.25).
>
> As I have congruent results no matter which functions I use, I wonder 
> if this could be influenced by the way that this behavior is 
> distributed across the tree (too dispersed? - but not a 'problem' that 
> I could fix, it's just how my data is).
> Does anyone have any thoughts on whether my results are correct or if 
> something might be off?
>
> I appreciate your time and effort.
> Best,
> Laura
>
> -- 
> Laura Maria Schaedler
> Doutoranda em Ecologia
> Laboratório de Biologia Evolutiva e Comportamento Animal
> Instituto Nacional de Pesquisas da Amazônia
> http://lattes.cnpq.br/5795430755021849 
> 
>
> /PhD student in Ecology
> Evolutionary Biology and Animal Behavior Lab
> National Institute for Amazon Research
> Manaus, AM, Brazil/
>
> ___
> R-sig-phylo mailing list -R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive athttp://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-phylo@r-project.org/


[R-sig-phylo] Possible problem with Scaled likelihoods in ancestral state estimation

2023-07-28 Thread Laura Schaedler
Hello all,

I am doing ancestral state estimation analyses with binary traits (presence
or absence of a behavior), and while doing so I ran into something that is
puzzling me.

For one particular behavior, the results look wrong to me, although R
doesn't report any errors during the analyses. Assuming Equal rates is the
best model (which I previously assessed with *fitDiscrete*), no matter if I
use function *ace*, *make.simmap*, or *ancr* after *fitMk*, this behavior
shows the same values of scaled likelihoods for all ancestral states (0.5,
figure attached). Setting marginal = T does not change the results.

When looking at this information plotted on my tree that just doesn't feel
right.
I would expect likelihood values to be greater in some ancestral nodes
(those immediately before groups of species where all of them have the
behavior) and smaller in others (those before groups without the behavior),
not the same likelihood for all of them.

Now, if I choose to run analyses with model = ARD, for *ace *and *ancr* I
get results that look similar to what I would expect (although
*make.simmap* yields
the same result as model = ER; figure attached). However, as I have
previously run *fitDiscrete* to determine what is the best model for this
behavior, and it was ER, I don't think it makes sense to just choose ARD
instead because 'it looks better' (AIC weight ER = 0.74 *vs.* AIC weight
ARD = 0.25).

As I have congruent results no matter which functions I use, I wonder if
this could be influenced by the way that this behavior is distributed
across the tree (too dispersed? - but not a 'problem' that I could fix,
it's just how my data is).
Does anyone have any thoughts on whether my results are correct or if
something might be off?

I appreciate your time and effort.
Best,
Laura

-- 
Laura Maria Schaedler
Doutoranda em Ecologia
Laboratório de Biologia Evolutiva e Comportamento Animal
Instituto Nacional de Pesquisas da Amazônia
http://lattes.cnpq.br/5795430755021849




*PhD student in EcologyEvolutionary Biology and Animal Behavior LabNational
Institute for Amazon ResearchManaus, AM, Brazil*
___
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/