Jaccard index, matrix notation

Use the all-ones matrix $N,$ with the same dimensions as $A,$ to define the symmetric matrix $$\eqalign{ L &= A^TN + N^TA \\ }$$ Then the Jaccard matrix can be written as $$\eqalign{ J &= (A^TA)\oslash(L-A^TA) \\ }$$ where $\oslash$ denotes elementwise (aka Hadamard) division.

The elements of this $J$-matrix are the Jaccard distances, i.e. $$J_{ik} = J(U_i,U_k)\\$$


NB: $\;$The third column of your $A$-matrix is problematic and results in $J_{33}=\frac{0}{0}$
One way to address this is to use the elementwise pseudoinverse $$ \big(M^\oplus\big)_{ij} = \big(M_{ij}\big)^+ = \begin{cases} M_{ij}^{-1}\;&{\rm if\;}|M_{ij}|\ge\varepsilon\\0\;&{\rm otherwise}\end{cases} $$ Then the expression for the $J$-matrix becomes $$J = (A^TA)\odot(L-A^TA)^\oplus$$ where $\odot$ denotes the elementwise (aka Hadamard) product.

Tags:

Matrices