cordist: Similarity measure which combines elements from Pearson...

View source: R/helpers_misc.R

cordistR Documentation

Similarity measure which combines elements from Pearson correlation and Euclidean distance.

Description

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.

Usage

cordist(
  data,
  cor_method = "pearson",
  dist_method = "euclidean",
  cor_weight = 0.5,
  ...
)

Arguments

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

Value

Matrix of the correlation-modified distances of the original matrix.

Author(s)

Keigth Hughitt


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.