A table of pairwise comparisons
Put two column vectors and into a matrix . Transposing turns those columns into rows. Multiplying then pairs every original column with every other column:
This is a Gram matrix. Its diagonal describes each vector on its own; its off-diagonal entries compare different vectors.
Read an example
Choose and . Then
The diagonal entries 5 and 4 are squared lengths. The two matching 2s are the same dot product in opposite orders. This is why a real Gram matrix is symmetric.
If we normalized each nonzero column to length one first, the diagonal would be all ones and the off-diagonal entries would be cosine similarities. Without that normalization, vector length also influences the comparisons.
Which objects are being compared?
compares the columns of . The reversed product compares its rows. When rows represent observations and columns represent features, this distinction tells you whether the comparison table is about features or observations.
Read a zero
What would an off-diagonal zero mean?
Answer: The corresponding columns are orthogonal under the ordinary real dot product. It does not by itself establish statistical independence.
