CmlMagneville / mFD

:package: A Computation of Functional Spaces and Functional Diversity Indices
https://cmlmagneville.github.io/mFD/
GNU General Public License v2.0
25 stars 5 forks source link

How should I choose the right functional space when I can only use 4 functional space? #43

Closed gxxin1994 closed 5 months ago

gxxin1994 commented 5 months ago

Hello! I'm trying to use mFD to calculate beta functional diversity following the "General Workflow". I've computed multimensional functional spaces and assessed their quality,and Here are the mad values:

pcoa_1d | 0.16471 |   |   |   pcoa_2d | 0.08513 |   |   |   pcoa_3d | 0.04781 |   |   |   pcoa_4d | 0.03724 |   |   |   pcoa_5d | 0.03630 |   |   |   pcoa_6d | 0.03933 |   |   |   pcoa_7d | 0.04520 |   |   |   pcoa_8d | 0.05091 |   |   |   pcoa_9d | 0.05610 |   |   |   pcoa_10d | 0.06066

The space with the best quality has the lowest mad value. So the 5D space is the best one. So I chose "PC1","PC2","PC3","PC4" and "PC5" for the species coordinates matrix (like sp_faxes_coord = sp_faxes_coord_test[,c("PC1","PC2","PC3","PC4","PC5")]) when I calculate beta functional diversity using mFD::beta.fd.multidim() function. the function running for 1 hr with parallel computation using 24 cores, and the display of the % of progress is 0:

Serial computing of convex hulls shaping assemblages with conv1 |======================================================================| 100% Parallel computing of intersections between pairs of assemblages with inter_geom_coord |======================================================================| 100% Parallel computing of intersections between pairs of assemblages with inter_rcdd_coord & conv1 | | 0%

Also I noticed that the description page for mFD::beta.fd.multidim() function says "Computing intersection of convex hulls in space of >5 dimensions is yet impossible with most computers.”

So, here is my question: How should I choose the right functional space when I can only use 4 functional space? Would you have any tips or advice concerning this issue ? I really appreciate it.

CmlMagneville commented 5 months ago

Hi,

Choosing the functional space on which to work is always a trade off between its quality and the number of axes you're using (for some alpha indices such as FRic) or the computation speed/feasibility (as here). There is no rule about taking the functional space that has the lowest deviation metric: as long as you can chose it, go for it, but if not, you have to look at the values of the deviation metrics for all the functional spaces. Here you can see that the 4D space has a mad quite close to the 5D and thus still good, so I would suggest you to use the 4D space.

Camille