Giter Club home page Giter Club logo

Comments (3)

daijiang avatar daijiang commented on May 30, 2024

The differences between results from FD and here is because of different formulas used in calculating RaoQ.

FD uses ade4::divc() to calculate Rao's Q, which is (here for source code lines 564-565):

     `div[i, ] <- (t(df[, i]) %*% (as.matrix(dis)^2) %*% df[, i])/2/(sum(df[, i])^2)`

See that instead of use formula $\sum \sum p_{i} d_{ij} p_{j}$, they used d_ij ^2 and then divided results with 2 and then (sum(df[, i])^2).

Instead, in my code, i just used the original formula $\sum \sum p_{i} d_{ij} p_{j}$, c.f. Chiu and Chao 2013 Plos One.

If you change the FD code, (lines 564-565 in the above url) to div[i, ] <- (t(df[, i]) %*% (as.matrix(dis)^1) %*% df[, i]), we get the same results.

Another possible result for potential differences between results from FD and here is the many many pre-calculation data manipulations.

Thanks for your comment.

from hillr.

BErfanian avatar BErfanian commented on May 30, 2024

I've checked both of codes, and I noticed it before, Chiu and Chao 2013 formula for Q is as the Botta-Dukát 2005 (FD refers to this article for Rao's Q formula).
I don't know why FD use ^2 and /2 in it's code.
Thanks.
p.s: It will be great if you implement hill phylogenetic diversity in your package.

from hillr.

daijiang avatar daijiang commented on May 30, 2024

I think the FD::divc() and ade4::divc() used d_ij^2 and then divided 2 and sum of d_ij^2 to try to standardize Rao's Q results, so they are less dependent with the number of species. I am not sure how effective is it. But, if one will use something like null models to account for species richness, then it will be better just use the original formula $\sum \sum p_{i} d_{ij} p_{j}$.

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.