Description Usage Arguments Details Value Note References See Also Examples
Calculates the cosine correlation(s) between two vectors or conformable matrices.
1 | corCosine(x, y)
|
x |
a numeric vector or matrix. |
y |
a vector or matrix with compatible dimensions to x. |
For two vectors, X and Y, the cosine similarity is defined as
similarity=cos(θ)=(∑ XY) \div (√(∑ X^2)\times √(∑ Y^2))
. For centered data the cosine and Pearson's correlation coefficients are equivalent.
a numeric matrix of cosine correlations.
does not support missing values ('NA' nor 'NaN')
van Dongen S, Enright AJ. Metric distances derived from cosine similarity and Pearson and Spearman correlations. arXiv:1208.3145 [cs, stat] [Internet]. 2012 [cited 2016 Apr 22]; http://arxiv.org/abs/1208.3145
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.