cordist | R Documentation |
Here is Keith's summary: Where the cor returns the Pearson correlation matrix for the input matrix, and the dist function returns the Euclidean distance matrix for the input matrix. The LHS of the equation is simply the sign of the correlation function, which serves to preserve the sign of the interaction. The RHS combines the Pearson correlation and the log inverse Euclidean distance with equal weights. The result is a number in the range from -1 to 1 where values close to -1 indicate a strong negative correlation and values close to 1 indicate a strong positive corelation. While the Pearson correlation and Euclidean distance each contribute equally in the above equation, one could also assign tuning parameters to each of the metrics to allow for unequal contributions.
cordist(
data,
cor_method = "pearson",
dist_method = "euclidean",
cor_weight = 0.5,
...
)
data |
Matrix of data |
cor_method |
Which correlation method to use? |
dist_method |
Which distance method to use? |
cor_weight |
0-1 weight of the correlation, the distance weight will be 1-cor_weight. |
... |
extra arguments for cor/dist |
Matrix of the correlation-modified distances of the original matrix.
Keigth Hughitt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.