How to compare two similarity matrices? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-25T06:27:58Z http://mathoverflow.net/feeds/question/91001 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/91001/how-to-compare-two-similarity-matrices How to compare two similarity matrices? Ahmet 2012-03-12T17:18:52Z 2012-03-12T22:48:12Z <p>Hi,</p> <p>Suppose that I have two nxn similarity matrices. These matrices contain similarity information between n items. Although both matrices contain similarities of the same n items they do not contain the same similarity values. This might be because the similarities between the items are calculated using different information.</p> <p>I want to know how similar these matrices are. One simple thing is to find the frobenius distance between the two matrices. But this might be misleading I think. </p> <p>Are there better ways? What I want to understand whether the structure contained in the two similarity matrices are similar or not.</p> <p>Let me clarify what I mean by a similarity matrix. Suppose that we have n items. And suppose that each item i is represented with a vector of numbers. Then each element of the similarity matrix \$S(i,j) = cosine(v_i, v_j)\$ where \$v_i\$ and \$v_j\$ are the \$ith\$ and \$jth\$ item vectors and \$cosine(v_i, v_j)\$ is the cosine of the angle between \$v_i\$ and \$v_j\$. (Distance metrics other then cosine may also be used)</p> <p>May be I should have used distance matrix instead of similarity matrix.</p> <p>Thanks Ahmet</p> http://mathoverflow.net/questions/91001/how-to-compare-two-similarity-matrices/91003#91003 Answer by Steve Huntsman for How to compare two similarity matrices? Steve Huntsman 2012-03-12T17:23:03Z 2012-03-12T18:30:26Z <p>EDIT: I naively thought similarity matrix == dissimilarity matrix, this isn't the case. It's been too long since I did bioinformatics. My answer below should properly say "dissimilarity matrix satisfying the triangle inequality". Such a matrix can be constructed along the lines in the comments above.</p> <p>A similarity matrix is just a metric on a finite space. The standard metric on the space of all finite metric spaces is the <a href="http://en.wikipedia.org/wiki/Gromov-Hausdorff_convergence#Gromov-Hausdorff_distance" rel="nofollow">Gromov-Hausdorff metric</a>.</p> http://mathoverflow.net/questions/91001/how-to-compare-two-similarity-matrices/91026#91026 Answer by Gottfried Helms for How to compare two similarity matrices? Gottfried Helms 2012-03-12T22:41:55Z 2012-03-12T22:48:12Z <p>As far as you use the cosine as similarity measure, the matrix is a correlation matrix. For this situation in statistics there is the concept of "<a href="http://en.wikipedia.org/wiki/Canonical_correlation" rel="nofollow">canonical correlation</a>", and this might be then the most appropriate for your case: it gives an index how much "variance of one set of variables is explained by the other". The two set of variables are the two sets of vectors \$\small v_i \$ here. </p> <p>Another option could be to compute the cholesky factors ("factor loadings matrices") <strong>L1</strong> and <strong>L2</strong> of each of the correlation matrices <strong>R1</strong> and <strong>R2</strong> and do a target-rotation of <strong>L1</strong> to <strong>L2</strong>. Then, for instance, the squared distances of the vector-tips of each related vector in <strong>rotated(L1)</strong> and <strong>L2</strong> could be summed and this could be understood as similarity measure <em>of the matrices(!)</em> - but this is no standard method as far as I know... </p>