# Computing document similarity in latent semantic analysis

I have a question regarding Latent Semantic Analysis - after performing SVD decomposition of term-document matrix and choosing some number of dimensions, I get the set of new document vectors.

Now, how can I calculate similarity between two documents? New document vectors contain negative values, and results produced by cosine similarity make no sense.

• What I mean is that if we have the following vectors: $(2, -4)$ and $(6,3)$, cosine similarity will be 0, indicating no relations between them. There is one more question, just to make sure - if I have 500 documents and 6000 terms, and the rank of term-document matrix equals 500, then the matrix $D$ in $TSD^{\top}$ will have size $500 \times 500$. Is that correct? Then, can I work with document vectors of size 500, or should I perform dimensionality reduction anyway? – user1315305 Aug 23 '13 at 22:16
• And also, in similarity computations, do I use document vectors taken directly from matrix $D$, or should I use $SD^{\top}$ (the second solution is given e.g. on Wikipedia). – user1315305 Aug 23 '13 at 22:25
• Since $S$ is a diagonal matrix multiplying a matrix by $S$ will only change the magnitudes of the vectors in the matrix, so cosine similarity between vectors in the matrix will not change. That is, you can use both of them. – Sanyo Mn Aug 23 '13 at 22:51
• I have one more question - how can I convert cosine similarity into distance value when using LSA? In traditional vector space model, it was $1 - cosine$, but I guess it won't work correctly in this case? – user1315305 Aug 24 '13 at 13:11