View source: R/Optimal.Similarity.R
Optimal.Similarity | R Documentation |
Calculates the scale parameter u
that maximizes the variance of the similarity matrix exp(-u*DistanceMatrix)
.
Optimal.Similarity(Distance, CheckArguments = TRUE)
Distance |
A distance matrix, i.e. a square matrix with zeros on its diagonal or a |
CheckArguments |
Logical; if |
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:
u |
The optimal scale |
Matrix |
The optimal similarity matrix |
Marcon, E., Zhang, Z. and Herault, B. (2014). The decomposition of similarity-based diversity and its bias correction. HAL hal-00989454(version 3).
Dqz
# 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
# Calculate diversity of order 2
bcDqz(Paracou618.MC$Ns, 2, optimal$Matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.