Traits

Calculate the trait similarity

RegionalGrasslandSim.Traits.similarity_matrixFunction
similarity_matrix(; scaled_traits, similarity_exponent)

Computes the trait similarity of all plant species.

The trait similarity between plant species $i$ and plant species $u$ for $T$ traits is calculated as follows:

\[\text{trait_similarity}_{i,u} = 1-\frac{\sum_{t=1}^{t=T} |\text{scaled_trait}_{t,i} - \text{scaled_trait}_{t,u}|}{T}\]

To give each functional trait an equal influence, the trait values have been scaled by the 5 % ($Q_{0.05, t}$) and 95 % quantile ($Q_{0.95, t}$) of trait values of 100 plant species:

\[\text{scaled_trait}_{t,i} = \frac{\text{trait}_{t,i} - Q_{0.05, t}} {Q_{0.95, t} - Q_{0.05, t}}\]

If the rescaled trait values were below zero or above one, the values were set to zero or one respectively.

source