Giter Club home page Giter Club logo

Comments (6)

daijiang avatar daijiang commented on May 31, 2024

Hi Jarrett, thanks for the issue!

I think here, D_q of 5 is what it supposes to be. The abundances of species in this example are very similar, so their effects are minimal. We can even set all of them to be 1 to remove the effects of abundance.

First, the trait data with 4 species to be identical, the fifth to be different; no matter how different it will be, the trait data frame will be scaled (mean 0, sd 1) and then the distance matrix will be the same. This explains why changing 1.1 to 100 does not affect the results.

Second, D_q is the functional hill number, which represents the effective number of equally abundant and functionally distinct functional entity. A functional entity is a species-pair with a unit of distance between the two species. So in this example, there will be 5 such pairs (sp 1 vs 5, 2 vs 5, 3 vs 5, 4 vs 5, and 1 vs 2 vs 3 vs 4).

Hope this helps.
Cheers,
Daijiang

from hillr.

jebyrnes avatar jebyrnes commented on May 31, 2024

I think I'm still missing something. Let's say we had one species. But, we divided it's abundance into 5 "species". The traits are the same across all "species". My expectation is that D_q should be 1 - because of the lack of functional uniqueness. Is that the case?

Similarly, in the example I put above, I expected D_q to be ~2. When I changed the correlation between abundances, I expected D_q to go up, as species were no longer equally abundance. What am I missing. And THANK YOU for answering this (sidenote: tyring to use this concept in a different context, and this is helping enormously).

from hillr.

daijiang avatar daijiang commented on May 31, 2024

If traits of all species are the same, then distances of all species pairs will be 0, this will result 0 of Rao's Q and currently hill_func will throw an error I think.

Let's take a very simple example, with 5 species all equally distributed in 10 sites. Using the traits matrix above (4 species have same traits, the 5th have different traits). So Rao'Q = $\sum(d_{ij}p_ip_j)$ where $d_{ij}$ is the distance between species pairs, $p_i$ and $p_j$ are the relative abundance of species i and j, respectively (that's 0.2 for all species since they are equally abundant in all sites here). Then when q = 0 (again for simplicity), D_q of site k = sum(dij/Q)^0.5, so sum(dij) will cancel out (because pi, pj are all the same), leading to D_q = (1/p_ip_j)^0.5 = 5. This is how the 5 comes from. In your example, changing correlations of species abundance did not change pi and pj much in most cases I guess; thus D_q mostly are around 5.

from hillr.

FabianRoger avatar FabianRoger commented on May 31, 2024

Hi Daijiang. Thank you for taking the time to walk us through! I'll chime in here as I am working together with @jebyrnes on this and have taken a deep-dive to try to understand what is going on reading Chao et al 2018. The code for the article can be found here.

Following the logic laid out in the article, the functional diversity / effective number of functional distinct groups should go down as the trait distance between the species decreases. Calculating FD with the code linked above (function FD_MLE) I cannot reproduce the values given by D_q. However, the values seem to be strongly correlated (but not identical) to Q given by hillR. Note that I set tau = max(dij) as this should remove the effect of tau.

Could you comment on why FD calculated above seems to correspond to Q but is uncorrelated to D_q?

from hillr.

daijiang avatar daijiang commented on May 31, 2024

Hi @FabianRoger , I have not had the time to incorporate Chao et al. 2018 into this package. See #10 issue. If you have time, feel free to make a pull request!

from hillr.

Related Issues (17)

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.