Optimal.Similarity.Rd
Calculates the scale parameter \(u\) that maximizes the variance of the similarity matrix \(exp(-u*DistanceMatrix)\).
Optimal.Similarity(Distance, CheckArguments = TRUE)
A distance matrix, i.e. a square matrix with zeros on its diagonal or a dist
object.
Logical; if TRUE
, the function arguments are verified. Should be set to FALSE
to save time when the arguments have been checked elsewhere.
The similarity matrix used by Dqz
) can be optimized following Marcon et al. (2014) such that the variance of similarities between pairs of species is maximized. See the example.
A list:
The optimal scale \(u\).
The optimal similarity matrix Z
.
Marcon, E., Zhang, Z. and Herault, B. (2014). The decomposition of similarity-based diversity and its bias correction. HAL hal-00989454(version 3).
# Load Paracou data (number of trees per species in two 1-ha plot of a tropical forest)
data(Paracou618)
# Prepare the similarity matrix. The square root of Paracou618.dist is euclidean.
optimal <- Optimal.Similarity(sqrt(Paracou618.dist))
# Optimal scale
optimal$u
#> [1] 2.348622
# Calculate diversity of order 2
bcDqz(Paracou618.MC$Ns, 2, optimal$Matrix)
#> Best
#> 1.558321