Giter VIP home page Giter VIP logo

Comments (2)

TGuillerme avatar TGuillerme commented on September 25, 2024

Hi Armin,

That’s a good suggestion! Thanks for asking:

    1. Could you incorporate the log-likelihood and the AIC value in the multi.ace() output?

I’ve update multi.ace in dispRity 1.5.9 to handle the extra argument estimation.details to extract some specific output from castor::asr_mk_model. For example, you can now also get the likelihood from the each model (per character and per tree) and their transition matrices using multi.ace(…, estimation.details = c("loglikelihood", "transition_matrix")) (you can also get the ancestral states specific likelihood values by asking for "ancestral_likelihoods" for example… Let me know if that works for you. Unfortunately for the AIC, you’ll have to compute yourself I’m afraid (but see point 2)

    1. This one might be a bit more work: Could you implement a summary function for the ancestral estimates (i. e. summarize ancestral states across a set of trees)? Maybe the mean of the ancestral estimates across the analyses set of trees (for a fixed topology it is relatively straightforward, but for trees that differ in topology it might be a bit more work)? I have also attached a little function, that is meant to produce the mean of ancestral state estimates based on the ace() output (unfortunately I only saw your multi.ace() function later on, but I reckon this could be easily modified accordingly).

I think this would be really useful (for example for calculating AIC values ;)) and this could be incorporated to some specific print, summary and plot functions however, this would require some more time and some more thinking: although it’ll be possible to get some average trait likelihood values and stuff like that, I’m not sure yet how to summarise variance and “average” with discrete trait values. But maybe by summarising the variance per character and per tree that would work? Like character table where each cell contains either the modal character, the average scaled likelihood for that character across the multiple trees and the variance in scaled likelihood across trees. Something like that:

Modal character:

Character 1 Character 2
Taxa1 "0" "0"
Taxa2 "0/1" "1"

Scaled likelihood for modal character:

Character 1 Character 2
Taxa1 0.9 0.9
Taxa2 0.9 0.3

Scaled likelihood variance:

Character 1 Character 2
Taxa1 0.01 0.01
Taxa2 0.5 0.9

This could easily show that character 1 and 2 for taxa 1 are pretty well estimated (i.e. with confidence) whereas there are a bit shittier for taxa 2 (with character 1 for taxa 2 maybe being better because of uncertainty, etc...).

Would that work? Unfortunately I won't have time to do it these days but I'll put it on my TODO list for a future version. Alternatively, I encourage you to propose me an implementation if you have time!

Cheers,
Thomas

from disprity.

AEgit avatar AEgit commented on September 25, 2024

Hi Thomas,

cheers, thanks for the update!
Yes, what you propose looks like the way to go - I will see, whether I can find the time to implement your suggestions. For now, I am also happy with my primitive solution, which just calculates the mean likelihood values for each ancestral state value.

Thanks a lot for your help!

from disprity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.