The Jaccard dissimilarity measure, sometimes called Tanimoto dissimilarity, has it origins in ecology. It was developed by Paul Jaccard as a measure of similarity of plant distribution in different regions.
The measure can be used in a number of fields, as shown by the following examples. The role of object and attribute can also be reversed, and the first application demonstrates this duality.
Here are some ground-based animal index counts:
Here the different blocks (habitats) are compared using the animals present as characters. The arrangement of the table in this manner originated in the field of psychology and was later adopted by numerical taxonomy.
The MultisetJaccardDissimilarity distance matrix of the blocks:
A Dendrogram showing how the blocks cluster:
The preceding analysis that compares the columns of the table is known as a Q-type (deriving from early factor analysis studies in the area of psychology). Conversely, comparing the rows is known as an R-type analysis and in this case compares the animals. Begin by first transposing the data table:
A Dendrogram shows that elephants and zebras, for example, are distributed similarly:
This example compares households on a single city block using the composition of household members (head, wife, daughter, brother-in-law, etc.). The data was compiled from the 1920 US Census for the 300 block of Wyoming Ave., Buffalo, NY. The households are labeled by street number.
Load the data:
The distance matrix using MultisetDiceDissimilarity can be displayed with an ArrayPlot (note the presence of off-diagonal 0s colored yellow):
The clustering of the households as shown by a Dendrogram:
The 14 yellow-colored, off-diagonal 0s of the preceding distance matrix represent pairs of identical households. They also appear in the preceding dendrogram as leaves with no initial height. Here they are extracted as clusters:
Mapping back to the original household data gives:
Because the MultisetJaccardDissimilarity is a distance metric, the distance matrix can be used to generate a set of 3D coordinates with distance geometry methods:
Understanding market forces and characteristics of the competition are essential components of profitable business decisions. This example shows how shopping malls might be compared using the numbers of kinds of businesses in each. The data was collected from the websites of each mall using the self-reported number of businesses in each category. These malls are all managed by the same organization, so the categories can be assumed to be consistent.
Load the data:
The distance matrix using MultisetJaccardDissimilarity can be displayed with an ArrayPlot:
The Dendrogram shows that The Mills at Jersey Gardens is very different from the others:
Similarity analysis of chemical structures goes back to the original work of Carhart et al. at Lederle Laboratories. It is used extensively to search though chemical databases to find compounds of interest and to cluster chemical structures into similar groups.
Here is small set of entities from the ChemicalData collection:
They can be converted into computable Molecule objects:
These are the topological features that will characterize each chemical structure (they are not the same as those used by Carhart et al., but are easily computable with MoleculeValue):
Using Dataset, a searchable database can be made:
Estradiol, for example, can be taken as the query molecule:
Properties and Relations
Jaccard multiset dissimilarity is bounded by 0 and 1:
The result is the same as JaccardDissimilarity when the multisets are sets:
The MultisetJaccardDissimilarity is a true distance measure, as it does obey the triangle inequality:
The same is true for JaccardDissimilarity: