stefpeschel / NetCoMi

Network construction, analysis, and comparison for microbial compositional data
GNU General Public License v3.0
146 stars 26 forks source link

nlambda and rep.num options #31

Closed MushroomToast closed 2 years ago

MushroomToast commented 2 years ago

Great package - I was hoping for more insight into how to choose the appropriate nlambda and rep.num for the SPRING measure.

How do you determine which metric is best for your dataset? Increasing the nlambda changes the hubs in my dataset, but how do you know what number is the right one?

Any help would be greatly appreciated.

stefpeschel commented 2 years ago

I would highly recommend reading the corresponding manuscript , which describes the SPRING method, it's parameters, and also the influence of different choices for lambda on the outcome in great detail.

The StARS method is used to find the optimal tuning parameter lambda by subsampling from the original data, where rep.num is the number of samples that are taken and nlambda defines the size of the set of possible tuning parameters from which the optimal lambda is chosen. In application section of the manuscript, a number of 50 is used for both parameters.

Generally speaking, the larger the two values (especially rep.num), the better. However, there's a tradeoff between stability of the resulting network and execution time. I would recommend choosing the values as high as possible so that the runtime is still acceptable for your data, but at least nlambda = 50 and rep.num = 50. Actually, the hubs in your network should stabilize when increasing the number of repetitions. For greater advice I would like to refer to the authors of SPRING.

Note that the parameter choice also depends on whether you want to perform permutation tests for network comparison, because the network is estimated for each single permutation so that a longer runtime of network construction does considerably increase the overall runtime of the network comparison.

Best, Stefanie

MushroomToast commented 2 years ago

Cheers @stefpeschel. That really helps me understand it a bit better. Thank you for your detailed answer and reference.