quicklizard99 / cheddar

Analysis and visualisation of ecological communities in R
http://quicklizard99.github.io/cheddar/
Other
13 stars 3 forks source link

Overestimating trophic similarity? #43

Open rfrelat opened 3 years ago

rfrelat commented 3 years ago

I was trying to understand the Jaccard similarity that is computed by the function TrophicSimilarity(). I realised that 'c', the number of resources and consumers common to both nodes could be the prey of one species, and the predator of the other species.

For instance, using the ChesapeakeBay dataset, the trophic similarity between Phytoplankton (#1) and Clupeidae (#21) is 0.125. While in the food web, the two species don't have any prey in common (no prey for Phytoplankton, while Clupeidae prey on Zooplankton) and they don't share any predators (the only predator for Clupeidae is Morone saxatilis, Phytoplankton has 7 predators - Microzooplankton, Zooplankton, Other suspension feeders, Mya, Crassostrea virginica, Anchoa mitchilli, Brevoortia tyrannus.

data("ChesapeakeBay")
Sim <- TrophicSimilarity(ChesapeakeBay)
Sim[1,21] #0.125

In the calculation of similarity, the number of common prey and predator is equal to 1 (because Zooplankton is a predator of Phytoplankton and a prey for Clupeidae).

I am not sure it is an issue (the calculation is correct and correspond to the formula explained in the documentation), but the formula doesn't feel right from an ecological point of view. I would recommend to calculate separately the number of common prey and the number of common predators. But maybe I misunderstood the original calculation from Neo Martinez and this issue can be closed without any modifications.

quicklizard99 commented 11 months ago

Apologies for my very late reply.

As you pointed out, the TrophicSimilarity function implements the method described by Martinez. One of the goals for Cheddar was to make it easy to compute existing commonly quoted food-web statistics. I would prefer to stick to this philosophy and would like to avoid both adding new methods and altering existing ones.

Incidentally, you can access values here (and elsewhere) using node names: Sim["Phytoplankton", "Clupeidae"].

Sorry again for having taken so long to reply.