Luciano Da Fontoura Costa
email: luciano@ifsc.usp.br

Luciano Da Fontoura

Costa Multisets

Introduction

Multisets (e.g. [START_REF] Hein | Discrete Mathematics[END_REF][START_REF] Knuth | The Art of Computing[END_REF][START_REF] Blizard | Multiset theory[END_REF][START_REF] Blizard | The development of multiset theory[END_REF][START_REF] Mahalakshmi | Properties of multisets[END_REF][START_REF] Singh | Complementation in multiset theory[END_REF]) -henceforth msetscan be informally understood as sets allowing repeated entries of the same element. In a sense, they are at least as much compatible with human intuition than sets. For instance it is often more relevant to know that our bag contains 4 apples than knowing simply that there are only apples in it. Given their enhanced potential for representing real-world structures and dynamics, msets result provide particularly effective resources for scientific modeling (e.g. [START_REF] Da | An ample approach to modeling[END_REF]).

The present work has three main objectives: (i) to present an introduction to msets; (ii) develop extensions and generalizations to real-valued functions and scalar and vector fields; and (iii) illustrate the potential of the presented and proposed concepts and methods with respect to applications of the real-valued Jaccard and coincidence indices. The latter index [START_REF] Da | Further generalizations of the Jaccard index[END_REF] integrates the information provided by the Jaccard and interiority indices, therefore providing a more strict and detailed quantification of the similarity between the two compared msetes.

Special attention is given to extending element multi-plicity to negative values, which is necessary condition for generalizing msets to functions and fields. This generalization has several interesting effects, such as allowing the important complement operation to be performed by using the empty mset instead of the universe mset. In addition, several additional mset operations can be defined respectively to how the positive and negative multiplicities are to be taken into account, some of which directly related to the Jaccard and coincidence similarity indices [START_REF] Da | Further generalizations of the Jaccard index[END_REF]. We start by reviewing the main concepts and properties of traditional sets, and then present the concept of msets, as well as some of their simpler properties, also including several examples. The challenges implied by the definition of a universe set for musets is briefly characterized and discussed. It is also argued that the operations of sum and subtraction between msets correspond to one of the main distinction between multiset and set theories.

The possibility to generalize msets to several other mathematical structures including vectors, matrices, functions, scalar and vector fields, as well as probability densities are approached next, including several examples. In particular, the extension of msets as representations of functions and scalar fields paves the way for obtaining hybrid expressions involving combinations of the the set operations of union and intersection with algebraic expressions involving sum, subtraction, product and division of sets. We illustrate the potential of this approach by extending the De Morgan theorem to functions and fileds.

The interesting possibility to approach similarity indices such as the Jaccard and coincidence in terms of msets is then developed. We then presents how the definition of the common product between two msets or mfunctions paves the way to obtaining integrated signal operations including filtering and enhanced template matching. In particular, we illustrate the enhanced potential of the real-valued Jaccard and coincidence indices for template matching, an operation frequently performed in the areas of pattern recognition and neuronal networks. When compared to the classic cross-correlation, the real-valued Jaccard, and particular the coincidence index are verified to yield substantially sharper and narrower peaks indicating the position of the pattern matches, while secondary smaller scale structures are attenuated. This important property paves the way to several related applications of the coincidence index in artificial intelligence, deep learning, and scientific modeling.

The application of msets and the Jaccard index to quantify the relationship between two or more densities or clusters is then described with respect to an example related to the iris dataset. The measurement of the separation between clusters corresponds to an important issue in both pattern recognition (e.g. [START_REF] Duda | Pattern Classification[END_REF][START_REF] Koutrombas | Pattern Recognition[END_REF]), deep learning (e.g. [START_REF] Hinton | Training products of experts by minimizing contrastive divergence[END_REF][START_REF] Schmidhuber | Deep learning in neural networks:an overview[END_REF][START_REF] De Arruda | Learning deep learning. Researchgate[END_REF]), and modeling (e.g. [START_REF] Da | Modeling: The human approach to science[END_REF][START_REF] Da | An ample approach to modeling[END_REF]) For simplicity's sake, the term msets are henceforth abbreviated as msets.

Traditional Sets

A set (e.g. [START_REF] Hein | Discrete Mathematics[END_REF][START_REF] Rudin | Elemets of Algebraic Topology[END_REF]) is an unordered collection of items, or elements, which are not allowed to repeat. A set A with elements a, b, and c is typically represented as:

A = {a, b, c}
The two essential properties of sets therefore are that the elements may appear in any order, which distinguish sets from vectors, and that the elements cannot be repeated.

Observe that a set can also have sets as elements. The number of elements in a set is called its cardinality or size, being represented as |A|.

A subset B of a given set A consists of a set so that any of its elements belong to A. If A contains N elements, there will be |A| = 2 N possible subsets that can be derived from it. The set containing all possible subsets of A is called its power set P A .

An important point about sets that is sometimes overlooked regards the fact that they always refer to a respective universe set Ω. More specifically, once this set is established, any possible set needs to be a subset of Ω. Observe that Ω can have any type of elements, though the situation where the elements are homogenous (e.g. positive integers, or real values) is of particular interest.

In case some sets are given but the universe set is not provided, it is still possible to estimate the respective universe set as corresponding to the union of all the existing sets.

The universe set is of fundamental importance because the operation of complement of a set is defined with respect to it. More specifically, the complement of a set A consists of all elements of Ω that are not in A. The complement of a set is henceforth represented as A C , being implicit that the operation refers to a given Ω.

Sets can be finite or infinite, as well as discrete or continuous. A finite set is any set A so that |A| < ∞. A discrete set is characterized by having all its elements corresponding to isolated points p. Any continuous set is infinite, but discrete sets can be finite or infinite.

An interesting point regards the relationship between an element, let's say 'a' and the set {a}. These two mathematical structures are not identical because it is possible to include an element into {a}, but not into 'a'.

The empty set, represented as φ = {} is a subset of any possible set.

Given two sets A and B, their union consists of a third set C containing all elements from A and B. The intersection of these two sets corresponds to a set C containing all elements that are in both A and B. A subset B of A can therefore be understood as to be so that A ∩ B = A. Any set is a subset of itself.

The difference between two sets A and B, indicated as A -B, corresponds to the set C containing all elements that are in A but are not in B.

Given three sets A, B, and C derived from a given Ω, the following properties directly involving the universe and empty set are verified:

Ω C = Ω -Ω = Φ (1)
Φ C = Ω -Φ = Ω (2)
A C = Ω -A (3)
Ω ∪ Φ = Ω (4)
Ω ∩ Φ = Φ (5)

A ∪ A C = Ω (6) A ∩ A C = A (7)
A ∪ Φ = A (8)

A ∩ Φ = φ (9)
Additional operations involving one or two sets A and B include the following:

A ∪ A = A (10) A ∩ A = A (11) A ∪ B = B ∪ A (12)
A ∩ B = B ∩ A (13)

A ∪ B C = Ω -(B -A) (14)
A ∩ B C = A -B (15)
And operations involving three sets A, B and C include:

A ∪ (B ∪ C) = (A ∪ B) ∪ C (16) A ∩ (B ∪ C) = (A ∩ B) ∪ C (17) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) (18)
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) (19)
(A ∪ B) C = A C ∩ B C (De Morgan) (20)
(A ∩ B) C = A C ∪ B C (De Morgan) (21)
Examples of continuous sets include intervals along the real line, e.g. [0, 1] and (b, c], and regions in R 2 , such as (x, y) satisfying x 2 + y 2 ≤ r.

Multisets

Basically, msets are sets allowing the repetition of elements, which is understood as their multiplicity or frequency. As with sets, the order of the elements is immaterial. Examples of msets include:

A = {|a, a, b, b, b, d| }; B = {|1, 2, 1, 2, 1, 2, 1| } = {|1, 1, 1, 1, 2, 2, 2| }; C = {|1, a, 2, b, b, 3, c, c, c, 1, d, 2, a, a| } = = {|1, 1, 2, 2, 3, a, a, a, b, b, c, c, c| }; D = {|a, a, b, d| }.
Observe the different symbol adopted henceforth in this work in order to emphasize the distinction between a traditional set ({}), and a mset ({|| }).

A more compact representation of a mset A can be obtained by using 2-tuple or pairs [a, m(a)], where 'a' is an element and m(a) it its multiplicity, i.e. the number of times it appear in A. In the case of the above examples, we have:

A = {|a, a, b, b, b, d| } = {|[a, 2]; [b, 2]; [d, 1]| }; B = {|1, 1, 1, 1, 2, 2, 2| } = {|[1, 4]; [2, 3]| }; C = {|1, 1, 2, 2, 3, a, a, a, b, b, c, c, c| } = = {|[1, 2]; [2, 2]; [3, 1]; [a, 3]; [b, 2]; [c, 3]| }; D = {|a, a, b, d| } = {|[a, 2]; [b, 1]; [d, 1]| }. ( 22
)
Though this type of representation of msets actually corresponds to a set, because it is impossible to have two identical entries, we shall maintain the '{|| }' notation in order to emphasize that a mset is being meant.

When referring to the multiplicity of an element, it is important to specify to which mset this is being referred. This can be done by writing m A (a), meaning the multiplicity of the element a in the mset A.

The property analogous to inclusion in sets can be stated as follows. A mset A is included in another mset B whenever m A (a) ≤ m B (a). For instance, in the case of the examples above, we have m A (a) = 2 and m C (a) = 2.

The support of a given mset A is defined as:

S A = {x|x ∈ Ω, m(x) > 0} (23)
As such, this set can be understood as containing all distinct elements in A. Observe that the support set provides a useful index for identifying the possible elements in the respective msets.

For instance, the supports of the msets in Equation 22S A = {a, b}

S B = {1, 2} S C = {1, 2, a, b, c} S D = {a, b, d} (24)
The combined support of two msets is the union of their respective supports. Thus, in the case of the previous example, we have:

S A,B = {a, b, d, 1, 2} (25)
S A,B,C,D = {a, b, c, d, 1, 2} (26)

Multiset Operations

A set A is said to be included into another set whenever:

m A (x) ≤ m b (x), ∀x ∈ A (27)
For simplicity's sake, we will indicate this operation using the same symbol as for sets, i.e. A ⊆ B, as the type of operation can be inferred from A and B being sets or msets.

In the case of the mset examples above, we can write that D ⊆ A.

The union C of two msets A and B can be defined as:

C = A ∪ B = {|[x, m C (x)], x ∈ S A,B | }, with m C (x) = max {m A (x), m B (x)} (28)
Examples considering the msets in the beginning of Section 3 include:

A ∪ B = {|a, a, b, b, b, d, 1, 1, 1, 1, 2, 2, 2| } = {|[1, 2]; [b, 2]; d, 1]; 1, 4]; [2, 3]| } A ∪ D = {|a, a, b, d| } = {|[a, 4]; [b, 4]; [d, 2]| }
Let A and B be msets. The sum of these two sets, henceforth represented as C = A + B, is defined as:

C = A + B = {|[x, m C (x)], x ∈ S A,B | }, with m C (x) = m A (x) + m B (x) (29)
Figure 1 illustrates the two different ways in which the common elements of two msets A and B are collected into their respective union and sum msets. Examples respective to the msets in the beginning of Section 3 include:

A + B = {|a, a, b, b, b, d, 1, 1, 1, 1, 2, 2, 2| } = {|[1, 2]; [b, 2]; [d, 1]; 1, 4]; [2, 3]| } A + D = {|a, a, a, a, b, b, b, b, d, d| } = {|[a, 4]; [b, 4]; [d, 2]| }
Thus, we have that the mset operations of union and sum are related in the sense that both collect the elements from the two msets, but the way in which this is done is quite different, with the multiplicities of the mset obtained by union becoming necessarily smaller or equal than that of the mset obtained by sum, i.e. m A∪B (x i ) ≤ m A+B .

It is interesting to consider these two operations in the context of possible respective applications. The sum of the two msets ensures conservation of the total number of elements (such as in conservative or flow-related problems), being therefore more indicated for related situations. The union of two msets can be conceptually understood as a choice procedure which does not ensure conservation of the multiplicities.

The intersection between two msets A and B can be defined as:

C = A ∩ B = {|[x, m C (x)], x ∈ S A,B | }, with m C (x) = min {m A (x), m B (x)} ( 30
)
Examples drawn from the msets in the beginning of Section 3 include:

A ∩ B = {|| } A ∩ D = {|a, a, b| } = {|[a, 4]; [b, 4]; [d, 2]| } (31)
The difference or subtraction between two msets is expressed as:

C = A -B = {|[x, m C (x)], x ∈ S A,B | }, with m C (x) = max {m A (x) -m B (x), 0} (32)
In Section 8, we will show that allowing negative multiplicities paves the way to defining the mset complement as well as to several additional mset operations.

Figure 2 illustrates the intersection and difference between two msets A and B.

Respective examples include:

A -D = {|b, b| } = {|[b, 2]| } D -A = {|| } (33)

Multisets Properties

It can be shown that msets as presented in the previous section satisfy the following properties:

A ∪ Φ = A (34)
A ∩ Φ = Φ (35)

A ∪ A = A (36) A ∩ A = A (37) A ∪ B = B ∪ A (38) A ∩ B = B ∩ A (39) A ∪ (B ∪ C) = (A ∪ B) ∪ C (40) A ∩ (B ∪ C) = (A ∩ B) ∪ C (41) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) (42) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) ( 43
)
where Φ is the empty mset, which contains null multiplicities for all elements in the respective support. This set can be expressed as:

Φ = {[x i , 0]} i = 1, 2, . . . , |S| (44)
So, we have that msets follow all the properties in Equations 8 to Equations 21 , except those involving complementation.

The definition of the complement of an mset has been a challenging issue (e.g. [START_REF] Singh | Complementation in multiset theory[END_REF]), which has to do with the fact that, typically, multiplicities have been restricted to nonnegative integer multiplicities (see also [START_REF] Blizard | Real-valued multisets and fuzzy sets[END_REF] and [START_REF] Blizard | Negative membership[END_REF]). In particular, restricting the mset difference operation multiplicities to take only non-negative values makes it difficult to define a respective complement operation. For this reason, several useful De Morgan properties, as well as other related results, are not extended msets.

The Multiset Jaccard Indices

The Jaccard index represents an effective and conceptually appealing manner to quantify the similarity between any two sets A and B (e.g. [START_REF] Jaccard | Distribution de la flore alpine dans le bassin des dranses et dans quelques régions voisines[END_REF][START_REF] Schubert | Measuring the similarity between the reference and citation distributions of journals[END_REF][START_REF] Schubert | A note on the jaccardized czekanowski similarity index[END_REF][START_REF] Rozinek | The duality of similarity and metric spaces[END_REF][START_REF] Ružička | Anwendung mathematisch-statistischer methoden in der geobotanik[END_REF][START_REF]Jaccard index[END_REF][START_REF] Samanthula | Secure multiset intersection cardinality and its application to jaccard coefficient[END_REF][START_REF] Bacciu | Generative kernels for tree-structured data[END_REF][START_REF] Yuan | Automatic skin lesion segmentation using deep fully convolutional networks with jaccard distance[END_REF][START_REF]Jaccard index[END_REF][START_REF] Hamers | Similarity measures in scientometric research: The jaccard index versus salton's cosine formula[END_REF][START_REF] Leydesdorff | On the normalization and visualization of author co-citation data: Salton's cosine versus the jaccard index[END_REF][START_REF] Park | Assessing language discrepancies between travelers and online travel recommendation systems: Application of the jaccard distance score to web data mining[END_REF][START_REF] Da | Further generalizations of the Jaccard index[END_REF]), having therefore being extensively applied in a vast range of problems in several scientific and technological fields.

In its most basic form, the Jaccard index between an two sets A and B can be expressed as:

J (A, B) = |A ∩ B| |A ∪ B| (45)
It is possible to adapt the Jaccard index to msets by making:

J M (A, B) = N i=1 min (m(a i ), m(b i )) N i=1 max (m(a i ), m(b i )) (46)
where a i and b i are the elements of the sets A and B, respectively, and N is the cardinality of the universe of those sets. We also have that 0 ≤ J M (A, B) ≤ 1.

As an example, let's consider A = {a, b, b, c, c, c} and B = {a, b, c, c, d}. Then, we have:

J (A, B) = 1 + 1 + 2 + 0 2 + 3 + 5 + 1 = 4 11 (47)
It is possible to adapt the Jaccard index to mfunctions by making:

J (A, B) = ´Φ min (m A ( x), m B ( x)) ´Φ max (m A ( x), m B ( x)) ( 48
)
where Φ is the common support of the two functions or scalar fields, and 0 ≤ J (A, B) ≤ 1.

As such, the Jaccard index can be understood as a functional, or mfunctional of the two functions of scalar fields.

The Jaccard index has been enhanced and extended to functions, scalar fields, joint variations and more than 2 sets [START_REF] Da | Further generalizations of the Jaccard index[END_REF]. In particular, the latter type of Jaccard index for 3 sets A, ,B and C can be written as:

J (A, B, C) = A ∩ B ∩ C A ∪ B ∪ C (49)
7 Multisets, Vectors, Matrices

In this section we will discuss the relationship between msets and vectors. Observe that a vector can be understood as an mset with real multiplicities. First, we recall that the elements in a vector are expected to follow a well-determined order as indicated by their indices. For instance, in the case of the vector in R 5 :

v = [3, 2.5, π, 0, -1]
we have five indices i = 1, 2, . . . , 5, so that we can specify the respective element values as v

[1] = 3, v[2] = 2.5, v[3] = π, v[4] = 0, and v[5] = -1.
By understanding the values of the components of a vector as generalized multiplicities, we can immediately derive the following mset from the above vector:

V = {|[1, 3]; [2, 2.5]; [3, π]; [4, 0]; [5, -1]| }
More generally, we have that a vector v can be bijectively represented by the following mset:

v = {[i, v[i]]} (50)
Therefore, we have that an mset can be derived from any vector, but that a vector can be obtained from an mset only if their elements are ordered in some manner, e.g. by taking their respective values instead of understanding them as labels. This situation becomes more evident when one considers non-numeric elements. As such, msets can be used to study the elements of vectors without taking into account their relative position along the vector.

It is also interesting to contemplate the relationship between the above discussion and the traditional sets containing multiplicities. More specifically, we can write the set containing all multiplicities in the vector v above as: Ṽ = {3, 2.5, π, 0, -1} = {0, 3, 2.5, -1, π} = etc. Though V and Ṽ are very similar, they are not identical because in V the correspondence of the elements and the respective multiplicity is maintained by the specification of the respective element in the ordered pair. By representing vectors as msets, we not only preserve the operations of subtraction and difference, but also incorporates the possibilities of defining intersections and unions between any two vectors.

Another interesting possibility is to incorporate new operators for multiplication and division into the mset framework, which can be done straightforwardly, while avoiding divisions by zero.

Interestingly, it is also possible to obtain mset representations from matrices or even other more sophisticated mathematical structures as tensors. In the case of matrices, this can be done by incorporating the indexing information in the respective mset. For instance, an N × M matrix can be represented as the mset:

A = {[i, j, A[i, j])]} (51)
An additional point remains to be discussed regarding the fact that vectors, matrices and other mathematical structures are restricted to non-negative integer entries.

In the present work, we propose the mset difference operation to be modified as:

C = A -B = {|[x, m C (x)], x ∈ S A,B | }, with m C (x) = m A (x) -m B (x) (52)
It is now possible to extend the multiplicities to take any real value.

While the empty is as observed before, i.e. corresponding to an mset with null multiplicities for every element in the support, we now need to identify a suitable universe set. In the case of vectors with dimension 1 × N this can be done by making:

Ω + = {[i, ∞]} , i = 1, 2, . . . N (53) Ω -= {[i, -∞]} , i = 1, 2, . . . N (54)
Now, we have that the complement of an mset can be expressed as:

A C = Φ -A (55)
Observed that the empty mset has been used instead of the universe mset.

We can now incorporate the following additional properties to real-valued msets:

Ω C + = Ω + -Ω + = Φ (56) Ω C -= Ω --Ω + -= Φ (57) A C = Φ -A = -A (58) Ω + ∪ Φ = Ω + (59) Ω -∪ Φ = Φ (60) Ω + ∩ Φ = Φ (61) Ω -∩ Φ = Ω - (62) A ∪ A C = |A| (63) A ∩ A C = -|A| (64)
We can also define the following operations on a generic mset A:

A + = {|[x, m A (x)], x ∈ S A | }, with m A (x) = max {m A (x), 0} (65)
and

A -= {|[x, m A (x)], x ∈ S A | }, with m A (x) = min {m A (x), 0} (66)
which allow us to write:

A ∪ Φ = A + (67) A ∩ Φ = A - ( 68
)
The fact that A ∪ Φ is not A and A ∩ Φ is not Φ as in traditional set theory motivates us to find a new mset operation for real-valued msets that could lead to a respective counterpart. This can be done by defining the signed union of two msets A and B as follows:

C = A B = = {|[x, s m A (x) s m B (x) max {|m A (x)|, |m B (x)|}]| } with x ∈ S A,B (69)
where s m A (x) stands for the sign of the multiplicity m A (x) and s m B (x) stands for the sign of the multiplicity m B (x).

The signed intersection can be expressed as:

C = A B = = {|[x, s m A (x) s m B (x) min {|m A (x)|, |m B (x)|}]| } with x ∈ S A,B (70)
The above expression was previously reported [START_REF] Akbas | L1 norm based multiplicationfree cosine similiarity measures for big data analysis[END_REF] in the context of cosine similarity analogous to the L1 norm. Now, we can write:

A Φ = A (71) A Φ = Φ (72)
Observe that the consideration of possibly negative multiplicities has led to additional respective properties.

Functions and Scalar Fields

The possibility to represent vectors as msets paves the way to a number of interesting possibilities. One of them is to represent discrete and continuous functions and scalar fields (vector fields can be approached as vectors of scalar fields). We develop these possibilities in the following.

Let g(x) be a real function of a real variable x in a discrete or continuous support set S, i.e.x ∈ S. This function can be fully represented, in invertible manner, in terms of the following respective real-valued mset:

f (x) = f = {[x, f (x)]} , with x ∈ S (73)
Therefore, the extension of the above characterized real-valued msets to real-valued function is immediate. Though for simplicity's sake we shall often call the msets associated from functions as mfunctions, it should be kept in mind that there is absolutely no difference between realvalued msets and real functions.

All the respective operations and properties are also kept, which means that it becomes possible to combine all the traditional function operations with the multiset operations.

For instance, it becomes possible and valid to write:

r(x) = (g(x) ∩ h(x)) + g(x) s(x) = (g(x) + h(x)) ∪ (g(x) -h(x)) t(x) = [g(x) ∩ h(x)] -[g(x) ∪ h(x)]
where r(x), g(x) and h(x) are generic real-valued functions on a support S.

These three functions are illustrated in Figure 3 assuming the function in Equation 74. We have already seen that the complement of a vector multset becomes the operation of sign change, and so we have with functions in the sense that r(x) C becomes -r(x). This allows us to derive the following De Morgan extension to real-valued functions on a generic support S:

-[g(x) ∩ h(x)] = -g(x) ∪ -h(x) -[g(x) ∪ h(x)] = -g(x) ∩ -h(x)
A similar approach can be applied to transform discrete scalar fields defined on more than one variables into respective msets, involving the index mapping described above.

Let's illustrate the above concepts and possibilities in terms of the two following functions: This examples illustrate several interesting points. First, we have the understanding of functions as respective msets immediately allows them to be operated by mset operations such as union and intersection. In addition, we observe that the sum of two functions is larger or equal than their union, as well as the possibility of the subtraction operation yielding negative values.

g(x) = e -10x 2 h(x) = 2e -10|x-0.1| (74)
It is also interesting to observe the potential of the operations of union and intersection in producing sharp derivatives and discontinuities, which contributes an interesting manner of representing an ample range of function types as combinations of these operations, not to mention the operations of sum, subtraction, product and quotient.

Consequently, it becomes an interesting possibility to develop transformations of functions, analogous to the Fourier transform, considering not only series of basis functions, but also intersections and/or unions, and/or other possible hybrid operations between msets. One particularly useful benefit would be to become able to express functions with discontinuous derivatives as combinations of functions that are completely smooth. Also, it should be observed that the operations of sum and subtraction are bilinear, while the minimum and maximum, which mediate most of the mset operations, are not. Another interesting perspective concerns in understanding the Jaccard similarity index from the perspective of real-valued msets, which yields:

J R (f (x), g(x)) = f (x) g(x) f (x) * g(x) (75)
where:

f (x) * g(x) = ˆS max(s f f (x), s g , g(x))dx (76)
Related similarity indices have appeared previously in discrete manner in the context of analogies between the cosine similarity index in L1 spaces [START_REF] Akbas | L1 norm based multiplicationfree cosine similiarity measures for big data analysis[END_REF][START_REF] Akbas | Multiplication-free neural networks[END_REF].

Given that the Jaccard index does not take into account the relative interiority of the two compared sets [START_REF] Da | Further generalizations of the Jaccard index[END_REF], it has been combined with the interiority (or overlap e.g. [START_REF] Vijaymeena | A survey on similarity measures in text mining[END_REF]) index to yield the coincidence index between two functions, which can be expressed as:

C R (f (x), g(x)) = J R (f (x), g(x))I R (f (x), g(x)) (77) where:

I R (f (x), g(x)) = ´S min(s f f (x), s g , g(x))dx min {S f , S g } (78) S f = ˆS |f (x)|dx (79) S g = ˆS |g(x)|dx (80)
The operation of template matching consists of, given a function f (x), to quantify, along x, the similarity between its portions and another reference template function g(x). This can be immediately implemented by by applying the real-valued Jaccard and coincidence indices to those two functions while one is slid respectively to the other, therefore implementing respective cross-correlations. High resulting values indicate portions of f (x) that are similar to g(x). The templated in (b) is to be compared with the mfunction in (a) and the results obtained by using the traditional cross-correlation (c), the real-valued Jaccard index (d), the interiority index (e) and the and coincidence index (f). The potential of the real-valued Jaccard, and in particular the coincidence index, for obtaining narrower and sharper identification of the peak correspondence between the template and object function, while attenuating the effect of secondary matches, can be plainly observed.

As it can be verified, both the real-valued Jaccard and coincidence indices yielded a precise and well-localized identification of the maximum similarity between the portions of function f (x) with the template function g(x), not only for the positive parts, but also with respect to the negative. The secondary matchings appeared with substantially smaller values. This example illustrates the enhanced potential of the coincidence index for pattern recognition, filtering and neuronal network applications.

Multisets in Pattern Recognition

The possibility to use msets to represent any type of density paves the way to interesting applications in pattern recognition and deep learning (e.g. [START_REF] Duda | Pattern Classification[END_REF][START_REF] Koutrombas | Pattern Recognition[END_REF][START_REF] Schalkoff | Digital Image Processing and Computer Vision[END_REF][START_REF] Hinton | Training products of experts by minimizing contrastive divergence[END_REF][START_REF] Schmidhuber | Deep learning in neural networks:an overview[END_REF][START_REF] De Arruda | Learning deep learning. Researchgate[END_REF]).

In this section we illustrate how msets and the Jaccard index can be readily applied in order to quantify the similarity between two (or more) clusters represented by respective density functions, a frequent problem (e.g. [START_REF] Loudin | A multivariate method for comparing n-dimensional distributions[END_REF]). Let's consider the three sets of points in the scatterplot shown in Figure 6, which corresponds to the three species of iris flower in the frequently adopted iris dataset. Only two out of their 4 features have been chosen in the following example for simplicity's sake. The obtained multiset Jaccard index for each pairwise combination of categories are presented in Table 1.

The obtained results are fully compatible with the interrelationships between the three densities, or clusters, in Figure 6. In addition, the three-wise Jaccard index from Equation 49 result nearly null, indicating a really small chance that the three densities correspond to the same cluster.

Concluding Remarks

The fascinating subject of msets has been presented in a hopefully introductory manner, followed by developments aimed at extending them to real-valued multiplicities. By allowing functions and fields to be understood as msets, several possibilities are made viable, some of which are explored in the present work.

In addition to introducing several of the basic mset concepts, the present work also proposed how the complement operation can be defined in a robust manner by allowing the subtraction of msets to take negative values. This paved the way for recovering several properties analogous to traditional sets involving the complement operation, including the De Morgan theorem, as well as to identifying additional mset operations.

The extension of msets to real functions and fields was also proposed, paving the way to defining functionals, of which the real-valued Jaccard and coincidence indices for are examples. The interpretation of several of the characteristics and properties of real-valued msets become particularly intuitive when approached in terms of functions. For instance, the fact that one function is contained into another can be graphically verified by checking the respective graphs. In addition, the incorporation of mset operations into real functions paves the way to obtained complex non-analytical functions (i.e. with derivative discontinuities) by combining smooth basic functions.

We have also illustrated the impressive potential of the coincidence index for performing template matching, yielding sharper and narrower detection peaks while attenuating secondary matches. These features are a consequence of the enhanced potential of the coincidence index in quantifying similarity in a detailed manner, which can be particularly useful in pattern recognition, deep learning, artificial intelligence and scientific modeling in general. For instance, neuronal networks can be constructed in which the synaptic input and integration, traditionally modeled and implemented in terms of the classic inner product, are performed by using the real-valued Jaccard or coincidence indices, therefore incorporating the respective advantages of these approaches.

The application of the real-valued Jaccard index to quantifying the similarity between two scalar fields corresponding to cluster densities of the iris dataset is also illustrated, with encouraging results.

The presented concepts and methods pave the way to several interesting applications, also motivating further integrations between the structures and properties between the domains of set theory, propositional logic, and analysis.

Figure 1 :

 1 Figure 1: The union (a) and sum (b) of two msets A and B typically yield different resulting msets. In the case of the union operation, each of the elements of the same type are compared, with the elements with the maximum multiplicity being incorporated into C. The sum of the two msets incorporates all the m A (x i ) + m B (x i ) elements into C.

Figure 2 :

 2 Figure 2: The intersection (a) and difference (b) of two msets A and B typically yield quite different resulting msets. In the case of the intersection operation, each of the elements of the same type are compared, with the elements with the minimum respective multiplicity being incorporated into C. The difference between A and B depends on m A (x i ) -m B (x i ). As the result is negative in the case of the present example, no elements are incorporated into A -B.

Figure 3 :

 3 Figure 3: The functions r(x), s(x) and t(x) obtained through mset operations.

Figure 4

 4 Figure 4 depicts the two above functions as well as their union, intersection, sum, and subtraction.

Figure 4 :

 4 Figure 4: Two continuous functions g(x) and h(x) of a single variable (a), and their respective mset operations (b) of union, intersection, sum, and subtraction.

Figure 5

 5 presents the result of matching the template in (b) with the function in (a) by using the traditional cross-correlation (c), the real-valued Jaccard index (d), the interiority index (e) and the and coincidence index (f).

Figure 5 :

 5 Figure5: The templated in (b) is to be compared with the mfunction in (a) and the results obtained by using the traditional cross-correlation (c), the real-valued Jaccard index (d), the interiority index (e) and the and coincidence index (f). The potential of the real-valued Jaccard, and in particular the coincidence index, for obtaining narrower and sharper identification of the peak correspondence between the template and object function, while attenuating the effect of secondary matches, can be plainly observed.

Figure 6 :

 6 Figure 6: A scatterplot representing the distribution of three types of iris flowers represented by two respective features x and y.

Figure 7 :

 7 Figure 7: The three density scalar fields obtained by gaussian kernel expansion of each of the three categories.

Table 1 :

 1 The Jaccard indices obtained for pairwise combinations between the three iris species. The resolution has been limited to 6 digits.

Acknowledgments.

Luciano da F. Costa thanks CNPq (grant no. 307085/2018-0) and FAPESP (grant 15/22308-2).


Luciano Da Fontoura Costa
email: luciano@ifsc.usp.br

Italo Calvino

Le Città

Further Generalizations of the Jaccard Index

Quantifying the similarity between two mathematical structures or datasets constitutes a particularly interesting and useful operation in several theoretical and applied problems. Aimed at this specific objective, the Jaccard index has been extensively used in the most diverse types of problems, also motivating some respective generalizations. The present work addresses further generalizations of this index, including its modification into a coincidence index capable of accounting also for the level of relative interiority between the two compared entities, as well as respective extensions for sets in continuous vector spaces, the generalization to multiset addition, densities and generic scalar fields, as well as a means to quantify the joint interdependence between two random variables. The also interesting possibility to take into account more than two sets has also been addressed, including the description of an index capable of quantifying the level of chaining between three structures. Several of the described and suggested eneralizations have been illustrated with respect to numeric case examples. It is also posited that these indices can play an important role while analyzing and integrating datasets in modeling approaches and pattern recognition activities, including as a measurement of clusters similarity or separation and as a resource for representing and analyzing complex networks.

Introduction

Despite its seeming simplicity, set theory underlies a substantial portion of the mathematical and physical sciences, while being also extensively used in virtually every area of human activity.

In fact, set theory concepts has been so ubiquitous as to have been incorporated into common language and daily conversations. When one says "I will buy bananas and potatoes and tomatoes," it is actually the set operation of union that it is being meant. Interestingly, the tenuous border between set theory and propositional logic is often blurred by humans (see [START_REF] Da | An ample approach to modeling[END_REF][START_REF] Da | Analogies between boolean algebra, set theory and function spaces[END_REF]). At the same time, multisets (e.g. [START_REF] Samanthula | Secure multiset intersection cardinality and its application to jaccard coefficient[END_REF][START_REF] Bacciu | Generative kernels for tree-structured data[END_REF][START_REF] Hein | Discrete Mathematics[END_REF][START_REF] Knuth | The Art of Computing[END_REF][START_REF] Blizard | Multiset theory[END_REF][START_REF] Blizard | The development of multiset theory[END_REF][START_REF] Mahalakshmi | Properties of multisets[END_REF][START_REF] Singh | Complementation in multiset theory[END_REF][START_REF] Da | Multisets[END_REF]) offer means for extending set so as to consider the multiplicity of elements which, in a sense, seems at least as compatible with human intuition than the classic set theory.

Other concepts that are as ubiquitously employed in every human activity regards the similarity and distance between two entities. Mathematically, this can be related to quantifying in an objective manner several types of similarity between two or more mathematical structures such as scalars, sets, vectors, matrices, functions, densities, graphs, etc (e.g. [START_REF] Vijaymeena | A survey on similarity measures in text mining[END_REF][START_REF] Mirkin | Mathematical Classification and Clustering[END_REF][START_REF] Jarvisand | Clustering using a similarity measure based on shared near neighbors[END_REF][START_REF] Miranda-Quintana | Extended similarity indices: the benefits of comparing more than two objects simultaneously. part 1: Theory and characteristics[END_REF][START_REF] Wolda | Similarity indices, sample size and diversity[END_REF]). This can be done in several manners, which frequently take into account the respective type of structure. For instance, vectors are often compared in terms of their inner product, and several similarity indices (e.g. [START_REF] Brusco | A comparison of 71 binary similarity coefficients: The effect of base rates[END_REF]) have been suggested for comparing matrices with binary features.

One approach to the similarity between two sets that has attracted particular attention as a consequence of its effectiveness allied to its simple and intuitive conceptual characteristics, being therefore employed extensively, is the Jaccard or Tanimoto index (e.g. [START_REF]Jaccard index[END_REF][START_REF] Jaccard | Distribution de la flore alpine dans le bassin des dranses et dans quelques régions voisines[END_REF][START_REF]Paul jaccard. Fr-Academic[END_REF][START_REF] Tanimoto | An elementary mathematical theory of classification and prediction[END_REF]). Extensions have been proposed to sets (e.g. [START_REF] Schubert | Measuring the similarity between the reference and citation distributions of journals[END_REF][START_REF] Schubert | A note on the jaccardized czekanowski similarity index[END_REF][START_REF] Ružička | Anwendung mathematisch-statistischer methoden in der geobotanik[END_REF]) and measurable spaces (e.g. [START_REF]Jaccard index[END_REF]), as well as relationships with distances (e.g. [START_REF] Rozinek | The duality of similarity and metric spaces[END_REF]).

In addition to being normalized within the interval [0, 1], the Jaccard index requires little computational expenses. Besides its vast range of applications (e.g. [START_REF] Yuan | Automatic skin lesion segmentation using deep fully convolutional networks with jaccard distance[END_REF][START_REF]Jaccard index[END_REF][START_REF] Hamers | Similarity measures in scientometric research: The jaccard index versus salton's cosine formula[END_REF][START_REF] Leydesdorff | On the normalization and visualization of author co-citation data: Salton's cosine versus the jaccard index[END_REF][START_REF] Park | Assessing language discrepancies between travelers and online travel recommendation systems: Application of the jaccard distance score to web data mining[END_REF]), most of them related to binary or categorical data, the Jaccard index has also motivated some extensions and generalizations, including its adaptation to discrete multisets with positive multiplicites (e.g. [START_REF] Samanthula | Secure multiset intersection cardinality and its application to jaccard coefficient[END_REF][START_REF] Bacciu | Generative kernels for tree-structured data[END_REF][START_REF] Da | Multisets[END_REF]).

Given the extensive adoption of the Jaccard index, as well as its appealing characteristics, it would be particularly useful if it could be adapted to as many as possible other mathematical structures. The present work aims at developing further possible generalizations of the Jaccard index. In particular, we show that its extension to real functions and fields paves the way to impressive results in pattern recognition operations such as template matching.

We start by providing a brief historic perspective of the Jaccard index, which was introduced in 1901 by Paul Jaccard under the name of coefficient de communauté.

Subsequently, we focus on the relative limitation of this index to reflect to which level one set is contained into the other, and a respective adaptation of the Jaccard index is then proposed to address this limitation that involves another measurement between two sets, here called interiority index (also known as overlap index e.g. [START_REF] Vijaymeena | A survey on similarity measures in text mining[END_REF]). More specifically, we define the coincidence index between two sets as corresponding to the square root of the product of respective Jaccard and Interiority indices. The specific characteristics and properties of these two indices, as well as some additional alternatives, are illustrated through a graphic construction, and it is shown that the coincidence index impose a more strict and selective characterization of the similarity between two sets. Another variation of the Jaccard index, here called addition-based Jaccard similarity, is then also motivated and presented.

We then approach the adaptation of the Jaccard index to take into account sets corresponding to regions in continuous spaces such as R N . It is shown that this can be immediately accommodated into the standard Jaccard (and also the coincidence) indices by having the regions area in place of the sizes of sets. In addition to allowing useful graphical characterizations of the Jaccard and coincidence indices, this extension to continuous sets also paves the way to dealing with densities and scalar fields. In particular, we develop a related graphical construct to compare the relationship between the Jaccard, interiority and coincidence indices.

Next, we address the particularly interesting question of adapting the Jaccard index to become capable of comparing densities, functions and fields in continuous spaces R N . This is achieved by extending multisets to real function spaces [START_REF] Da | Multisets[END_REF][START_REF] Da | Analogies between boolean algebra, set theory and function spaces[END_REF], allowing a version of the Jaccard and coincidence indices incorporating integrals (functionals) of the minimum (multiset intersection) and maximum (multiset union) operations along the respective space. Because generic fields involve negative values, the approach is presented first for non-negative densities, being subsequently extended to more general fields with negative multiplicities. The potential of the approach, which is conceptually and computationally simple, is then il-lustrated with respect to comparing probability density functions as well as more generic functions corresponding to two sinusoidals as well as two real-world images.

Another issue of special relevance that has been addressed regards the inherent, but not often considered, relationship between the quantification of the similarity between two probability densities with the also ample subject of characterizing joint variation of two random variables. Two particular problems are addressed. We show that the multiset Jaccard adaptation to densities and functions can be effectively applied to quantify the joint relationship between two random variables, be it in terms of discrete observations or while taking into account their probability densities describing standardized versions of the involved variables.

The next generalizing approach described in the present work concerns the possibility of generalizing the Jaccard index to deal with more than 2 sets (see also [START_REF] Miranda-Quintana | Extended similarity indices: the benefits of comparing more than two objects simultaneously. part 1: Theory and characteristics[END_REF]). We argue that there are two main ways in which this problem can be addressed. First, it is possible to have any of the two sets involved in the Jaccard index to correspond to generic combinations of any number of sets, obtained by using set operations. Alternatively, more than two sets can be actually considered as arguments of extended Jaccard indices. The latter possibility has been illustrated through the development of a generalization of the Jaccard index capable of quantifying the degree of chaining between three sets, as intermediated by one of them.

The above developments motivate the possibility to systematically combine several normalized indices, possibly involving several orders of data combinations, so as to logically integrate diverse data characteristics of interest about the analyzed data, therefore leading to a possible algebra of indices, of which the coincidence index constitutes an example.

The article concludes by discussing the particularly important role of indices such as those discussed and suggested here for the ubiquitous activities of model building and pattern recognition. Prospects for future developments are also provided.

A Brief Historic Note on Paul Jaccard

Paul Jaccard (1868-1944) (e.g. [START_REF]Jaccard index[END_REF][START_REF]Paul jaccard. Fr-Academic[END_REF][START_REF] Kurz | Paul jaccard. Dictionnaire Historique de la Suisse -DHS[END_REF]) was a researcher in the area of plant physiology in Zurich, who started his studies in 1889 at the L Université de Lausanne (paleobotanic and phytoembriology), then moving to the L'Universit'e de Zurich, where he concluded his PhD in 1894, followed by an internship in Paris with Gaston Bonnier (1853-1922), a French botanist and ecologist and full professor at Sorbonne.

Jaccard held teaching and research activities at Lausanne, and then Zurich, focusing on subjects related to geobotanic and tree histophysiology, including wood microscopic studies. He also travelled extensively to Egypt, Sweden and Turkistan (Kazakhstan region), being particularly interested on trees interbreeding from the anatomic and physiologic points of view.

The similarity index that bears his name was proposed in 1901 [START_REF] Jaccard | Distribution de la flore alpine dans le bassin des dranses et dans quelques régions voisines[END_REF] as a means to quantify co-localization of alpine flora, with particular interest in the study of species diversity. The index that now bears his name can be expressed in set theory notation as:

J(A, B) = |A ∩ B| |A ∪ B| (1)
where A and B are any two sets and |A| and |B| are their respective cardinality (number of elements).

Jaccard also proposed another relative index [START_REF] Jaccard | Étude comparative de la distribution florale dans une portion des alpes et des jura[END_REF], namely the coefficient générique, aimed at quantifying species-to-genus ratio, which consists of:

G(species, genus) = |genus| |species| (2)
where |genus| and |species| stand respectively to the number of genus and species in a considered region.

The Basic Jaccard Index

The basic Jaccard index can be simply expressed (e.g. [START_REF] Jaccard | Distribution de la flore alpine dans le bassin des dranses et dans quelques régions voisines[END_REF][START_REF]Jaccard index[END_REF][START_REF]Paul jaccard. Fr-Academic[END_REF]) as:

J (A, B) = |A ∩ B| |A ∪ B| = |A ∩ B| |A| + |B| -|A ∩ B| (3)
where A and B are any two sets to be compared. It is henceforth understood that J (A, B) = 0 in the case of |A ∪ B| = 0 or |A ∩ B| = 0.

It is interesting to keep in mind that, though not frequently specified, the universe set of A and B can be conveniently taken as being equal to Ω = A ∪ B.

The Jaccard distance can be immediately derived from the Jaccard index by making:

D J (A, B) = 1 -J (A, B) (4)
This approach can be immediately extended to any other similarity index bound between 0 and 1.

It is also interesting to observe that it is possible to modify the Jaccard index so as to reflect in absolute terms the effective cardinality of the intersection of the two sets. More specifically, as 0 ≤ J (A, B) ≤ 1, its product by

|A ∩ B| 2 yields J 2 (A, B) = |A ∩ B| 2 |A ∪ B| (5)
with 0 ≤ J 2 (A, B) ≤ |A ∩ B|, so that the cardinality of the intersection appears as a respective weight, implying the resulting index to have an absolute meaning.

Actually, it is also possible to consider taking higher powers, therefore implying even larger intersection cardinality weights, such as:

J P (A, B) = |A ∩ B| P |A ∪ B| (6)
with P ∈ R.

The Jaccard index can be immediately generalized to multisets or bags (e.g. [START_REF] Hein | Discrete Mathematics[END_REF][START_REF] Knuth | The Art of Computing[END_REF][START_REF] Samanthula | Secure multiset intersection cardinality and its application to jaccard coefficient[END_REF]), which are basically sets in which repeated elements are allowed.

The multisets A and B sharing the same elements (support) can be simply represented as respective vectors

A = [a 1 , a 2 , . . . , a N ], B = [b 1 , b 2 , . . . , b N ],
where N is the total number of possible distinct elements in the universe defined by the union of the two multiset elements, and a i corresponds to the multiplicity of element i in the multiset A. The Jaccard index for multisets then becomes:

J M (A, B) = N i=1 min (a i , b i ) N i=1 max (a i , b i ) (7) with 0 ≤ J M (A, B) ≤ 1.
As an example, let's consider A = {a, a, a, b, b} and B = {a, a, b, c, c, d}. If we have the set of possible elements organized into the indexing vector p = [a, b, c, d], we will obtain A = [3, 2, 0, 0] and B = [2, 1, 2, 1]. Observe that the order of elements in p is immaterial to our analysis. The, we have:

J (A, B) = 2 + 1 + 0 + 0 3 + 2 + 2 + 1 = 3 8 (8)
As a consequence, this adaptation of the Jaccard index allows it to be applied also to vectors, matrices, and graphs. In the case of matrices, the Jaccard equation can be further modified as:

J M (A, B) = N i=1 N j=1 min (a i,j, b i,j ) N i=1 N j=1 max (a i,j , b i,j ) (9)
Observe that this equation corresponds to a rearrangement of Equation 8. Similarly, many other mathematical structures, such as matroids, tensors, etc., can be compared by further adapting the above equation.

Interiority and Coincidence Indices

As illustrated in the previous sections, and also by the relatively extensive related literature, the Jaccard index provides an intuitive and logical manner to quantify the similarity between two discrete or continuous set. Yet, there is one particular situation, illustrated in Figure 1, which is not accounted for by this index. As it can be easily verified, both the situations depicted in Figure 1 lead to the same Jaccard index J = 3/7. However, the situation in (b) can be deemed to be quite distinct because, in this case, the set B is completely contained in A to the point of becoming a subset, i.e. B ⊂ A. In other words, all elements of B are shared with the set A. This is not the case in the situation (a), for both sets A and B have elements that are not shared.

It therefore follows that it would be interesting to obtain a modification of the Jaccard index that could distinguish between these two situations. A possible approach is described as follows.

We start by considering an index capable of quantifying how much a set is relatively interior to another. Let A and B be any two sets. The henceforth called interiority index (also overlap index e.g. [START_REF] Vijaymeena | A survey on similarity measures in text mining[END_REF]) can be written as:

I(A, B) = |A ∩ B| min {|A| , |B|} (10)
Though this index has been also known by the names of overlap or homogeneity, in this work we will adhere to the interiority term as it seems to convey more directly the concept of how much one of the sets is contained in the other.

It can be verified that 0 ≤ I(A, B) ≤ 1. Its minimum value is observed when A is completely separated from B, i.e. A ∩ B = 0. The maximum value is reached when any of the sets is completely contained into the other. In other words, there is no need to specify which of the two sets is being considered as being internal to the other.

By comparing Equations 34 and 34, it follows that:

0 ≤ I(A, B) ≤ J (A, B) ≤ 1 (11)
and it can also be verified that:

0 ≤ J (A, B) H(A, B) ≤ 1 ( 12
)
The verification of similarity accounted for by the Jaccard index can be conveniently combined with the interiority index simply by considering their respective product, i.e.:

C(A, B) = J (A, B) I(A, B) (13)
which is the same as:

C(A, B) = |A ∩ B| 2 |A ∪ B| min {|A| , |B|} (14)
It may also interesting to take the square root of the coincidence in order to compensate for the smaller values implied when multiplying to measurements in the interval [0, 1]. Therefore, in the present work we will adopted the coincidence indes as:

C(A, B) = J (A, B) I(A, B) (15)
It is also possible, in certain situations, to dispense with the square root operation.

In some specific cases it is also possible to use these two indices separately, defining a corresponding tuple [J (A, B),

I(A, B)].
As with the Jaccard index, the coincidence index can also be generalized to virtually any mathematical structure including, we will discuss in Section 8 functions and fields in R N .

Weighted Discrete Elements

The Jaccard and coincidence indices can be readily adapted (e.g. [START_REF]Jaccard index[END_REF]) to cope with cases in which the elements of sets A and B have been assigned respective weights corresponding to their relative importance in each specific problem.

This situation can be approached by using ordered pairs to represent each of the elements in A ∪ B associated to its respective weigh, i.e. [x i , w(x i )]. The Jaccard index then becomes:

J W (A, B) = xi∈(A∩B) w(x i ) yi∈(A∪B) w(y i ) (16)
with 0 ≤ J w (A, B) ≤ 1.

As an example, let

A = {[a, 2]; [b, 5]; [c, 1]} and B = {[b, 5]; [e, 1], [f, 1]}. It follows that A ∩ B = {[b, 5]}. J W (A, B) = 5 10 = 1 2 (17)
Thus, in spite of in this particular example the intersection being limited to a single of the possible elements, the Jaccard index resulted relatively high as a consequence of the large weigh associated to the element b.

Observe that the weighted version of the Jaccard index is not the same as the Jaccard index adapted to multisets, as the latter case does not involve the sum of weights. However, it is possible to considered weighted multisets, in which case the Jaccard index becomes:

J [W,M ] (A, B) = i w i min {a i , b i } i w i max {a i , b i } (18)
6 Addition-Based Multiset Jaccard Index

The multiset Jaccard index can be further generalized by taking into account the sum of the two sets A and B allowed by multiset theory, instead of their respective union, which leads to:

J S (A, B) = 2 N i=1 min (a i , b i ) N i=1 (a i + b i ) ( 19
)
with 0 ≤ J S (A, B) ≤ 1. Observe that other multiset operations including subtraction, complement, and intersection can also be employed to define other indices. This index has been known as the Sørensen-Dice coefficient (e.g. [START_REF] Sørensen | A method of establishing groups of equal amplitude in plant sociology based on similarity of species and its application to analyses of the vegetation on danish commons[END_REF]), and a signed version has been previously described [START_REF] Akbas | L1 norm based multiplicationfree cosine similiarity measures for big data analysis[END_REF] in analogy to the cosine similarity in L1 spaces.

The interesting feature of this index is that it takes into account the situations where the multiple instances in the multisets need to be taken into account at its fullest when combining the sets.

As an example, let's consider that A = {a, a, a, b, c, c, c} and B = {a, a, c}. Then, we have that:

J S (A, A) = (2)(7) 7 + 7 = 1 (20)
and:

J S (A, B) = (2)(3) 7 + 3 = 3 5 (21)
The additive multised Jaccard index can be immediately combined with the respective interiority index to yield the addition-based multiset coincidence index.

Continuous Sets

The henceforth described approach holds for R N , but we shall consider the plane vector space R 2 . It is possible to associate sets to the points (x, y) of this space in any possible manner, such as R = {(x, y) | x and y are even}, which is a discontinuous in

R 2 , or S = {(x, y) | 0 ≤ x ≤ 2, -1 ≤ y ≤ 1}, which defines a continuous region.
Though the Jaccard index can be immediately applied to any of these sets, it is of particular interest to our developments to consider sets configurations corresponding to simple connected regions of R 2 such as those illustrated in Figure 2.

In this case, the size of the involved sets and subsets can be conveniently represented by the respective areas, indicated as |A|, |B|, |A ∩ B|, and |A ∪ B|, which can be immediately used in Equation 34.

The three cases in Figure 2 correspond to the most representative situations when comparing two sets. In Figure 2(a), we have two separated sets, which results in null intersection, suggesting minimal similarity between the two sets. The situation depicted in (c) can be understood as leading to the maximum similarity that can be achieved with the sets A and B. Figure 2(b) illustrates a frequently found situation in which there is some intersection between the sets. In this case, the similarity value would be expected to increase with the intersection area in a possibly linear manner.

The situation represented in Figure 2 The relative position, and also the similarity, of the two sets can be completely controlled in terms of the relative position parameter x, with a-b 2 ≤ x ≤ a+b 2 . As b increases, the two squares progressively separate, therefore becoming less similar.

There is only one other parameter that needs to be specified in order to completely represent the situation in Figure 3, namely the relative sizes of the two regions r = b/a, with 0 ≤ r ≤ 1.

The area of the intersection A ∩ B and union A ∪ B of the two sets can now be conveniently expressed in terms of x and b as:

|A ∩ B| = (ra) a 2 -x - ra 2 = 1 2 a 2 r(1 + r) -2rax (22)
|A ∪ B| = 1 2 2a 2 1 + r 2 -a 2 r(1 + r) + 2rax (23)
We can now rewrite the Jaccard index as:

J (A, B) = a 2 r(1 + r) -2rax 2a 2 (1 + r 2 ) -a 2 r(1 + r) + 2rax (24)
Figures 4 (a) to (c) present the Jaccard index for two rectangles, as developed above, in terms of several configurations of the parameters x and r. Observe the yellow regions obtained for all indices, corresponing to the situations in which the smaller square is either completely insider or outside the other square.

The first row in Figure 4 concerns the Jaccard (a), interiority (b) and respectively obtained coincidence (c) indices. It can be observed that the Jaccard index values increase diagonally from top right to the lower left corner, achieving the peak a at the bottom left corner in (a). The interiority index, however, varies from 0 to 1 along each vertical slice in (b), being therefore 'degenerate' in the mathematical sense of not implementing a bijective mapping with respect to the peak 1. Indeed, every point at the lower non-null region in (b) will correspond to maximum interiority of 1. The coincidence index values, shown in (c) correspond to the product between the Jaccard and interiority indices, yielding a bijective association with the maximum value of 1 at the bottom right corner. Observe the respective change in the level sets shapes. Similar results hold for the addition-based Jaccard index shown in the lower row in Figure 4(d-f).

The geometrical construct in Figure 3 therefore provides an interesting approach to comparing the varying results obtained in Figure 4. The rationale is as follows: as the square B slides from being completely inside the square A, until it becomes completely outside the latter, it is reasonable to expect the similarity to decrease in a linear manner with x. This suggests that we can compare the several indices in Figure 4 while taking into account their respective slice along vertical slices of the scalar fields. For simplicity's sake, we will consider five slices corresponding to b = 10, 20, 30, 40, 50. The results are shown in Figure 5.

Among the five indices in Figure 4, only the additive multiset Jaccard index accounts for linear similarity quantification as x varies also in linear manner. The interiority, as expected, is unable to consider the relative size of the sets. The coincidence indices penalize the similarity for small values of x (i.e. when the slices are further away), with the basic coincidence index being more strict and selective. Also, the basic Jaccard tends to penalize these cases more intensely than the additive multised Jaccard index.

None of these indices are absolutely better than the others. It is the specific requirements of each application that should lead to a suitable choice while considering the above identified properties of each index. For instance, situations required enhanced selectivity and more strict similarity quantification may consider the adoption of any of the two described coincidence indices.

Continuous Densities and Scalar Fields

The developments discussed in the previous sections pave the way for considering also sets corresponding to densities, such as probability density functions, as well as completely generic functions and scalar fields. One of the main problem to be overcome here is that densities often have infinite support, meaning that they extend over infinite ranges in their respective space. The problem of comparing two distributions is particularly important in many theoretical and applied areas, having motivated great interest and the proposal of several respective approaches (e.g. [START_REF] Cha | Comprehensive survey on distance/similarity measures between probability density functions[END_REF][START_REF] Loudin | A multivariate method for comparing n-dimensional distributions[END_REF]).

One interesting perspective that can be used to adapt the Jaccard and coincidence indices so as to allow comparison of densities is developed as follows.

We start by representing a generic continuous function in terms of a respective discretization, with resolution ∆x, as illustrated in Figure 6.

The density p(x) becomes the vector p = [x i ]∆x. Now, in a vector the order of the elements is all important, but it can indeed be incorporated into the multiset representation as: [START_REF] Rozinek | The duality of similarity and metric spaces[END_REF] where x i are the elements in the respective support and m(x i ) is the multiplicity of the element x i generalized to take real values. In addition, we have also assumed, for simplicity's sake, that the discretization takes place on n points, which are henceforth understood as the support of both the function and the multiset. The functions transformed into their respective multisets are here called multifunctions, or mfunctions. Now, let m A (x i ) and m B (x i ) correspond to the multiplicity of the elements x i in the two sets obtained by discretization of two density functions p A (x) and p B (x) assuming the same support. The respective multiset Jaccard can now be obtained as:

X = {[x 1 , m(x 1 ); . . . ; [x i , m(x i )]; . . . [x n , m(x n )]}
J P (A, B) = i∈Φ min(m A (x i ), m B (x i )) j∈Φ max(m A (x j ), m B (x j )) ( 26
)
where Φ is the combined support of the two multisets A and B.

This index is then capable of expressing the similarity between the two original densities up to the x-resolution ∆x. The above reasoning extends immediately to discrete probability densities.

By making ∆ x → 0, we then obtain:

J P (A, B) = ´Φ min(m A (x), m B (x))dx ´Φ max(m A (x), m B (x))dx (27)
Observe that a bijective map is therefore obtained be-tween the original density values [x, p(x)] and the respective 2-tuples [x i , (x i )].

As such, the Jaccard index can be understood to correspond to a functional derived fro the two functions or, perhaps more specifically, an mfunctional.

In addition to the above described limiting situation, it is also possible [START_REF] Da | Analogies between boolean algebra, set theory and function spaces[END_REF] to consider the Equation 28 directly from the real function space, without the need of taking the limit. Observe that the generalized Jaccard index as defined by equation is completely specified and valid in the space of real functions, provided the integrals exist.

The above result extends immediately to density functions on higher dimensional domains as:

J P (A, B) = ´Φ min(m A ( x), m B ( x))d x ´Φ max(m A ( x), m B ( x))d x (28)
Which provides a means to generalize the multiset Jaccard index to continuous or discrete scalar or vector fields for any number of random variables.

As an example of the generalization of multisets to real values, let's consider the two density functions X A and 4. Only the interiority and additive multiset Jaccard indices account for the expected linear decrease of similarity following x displacements. However, the interiority is unable to take into account the relative size of the squares, which leaves only the additive multiset Jaccard as presenting a complete and linear quantification of the similarity between the two sets. The square root of the coincidence indices both penalizes the similarity when x is small, with the basic coindicence index imposing the most severe test of similarity.

Figure 6: A generic density function p(x) being discretized with resolution ∆x, so that it can be represented as a vector p = [x i ]∆x. The integral of the original and respective discretization are assumed to be 1, so that they are both normalized as densities.

X B depicted in Figure 7(a).

The respective intersection X A ∩X B and union X A ∪X B of these two densities, obtained by using the minimum and maximum operation between the elements of pair of values, are presented in Figures 7(a It is also interesting to observe that the comparison of two densities can be represented as a scatterplot, with the two density functions defining a parametric curve. This is illustrated in Figure 8. The closest the set of points covered by the respectively obtained parametric curve are to the identity line (in salmon), the higher the similarity index between the two densities will be. This construction can be immediately extended to generic functions.

The Jaccard index can be also adapted to quantify the separation of two groups of points, or clusters, which can be understood as a discrete or continuous scalar field. The basic idea here would be to represent each of the clusters in terms of the joint probability density and then apply the Jaccard index over them by considering the densities as the respective multiplicity of every element. This method can be applied to any number of involved features.

Though we have so far considered both X A ( x) and X B ( x) to correspond to non-negative scalar fields with hypervolume 1, it is actually possible to employ the Jaccard and coincidence indices to quantify the similarity between any two scalar mfunctions or mfields φ A ( x) and φ B ( x) sharing the same domain, even in presence of negative multiplicities.

The extension of similarity indices to negative values has been previously approached in [START_REF] Mirkin | Mathematical Classification and Clustering[END_REF][START_REF] Akbas | L1 norm based multiplicationfree cosine similiarity measures for big data analysis[END_REF][START_REF] Akbas | Multiplication-free neural networks[END_REF]. A respective possible manner to adapt the Jaccard index to negative multiplicities in a two-dimensional space is as follows.

In case the pair of points [m(X A ), m(X B )] is in the first quadrant, the minimum and maximum between the two multiplicities are accumulated into the intersection and union integral, respectively. It the point is in the third quadrant, both coordinates have their signal inverted and the respective minimum and maximum are accumulated.

Otherwise, if the point belongs to the II or IV quadrant, the point [m(X A ), m(X B )] is mirrored into the opposite quadrant respectively to the vertical axis, and it is the negative of the minimum between the multiplicities that is then accumulated into the intersection integral (to compensate for the reflection), while the union is taken with positive sign, and the resulting accumulated intersection The two probability densities p(x) and q(x) in Figure 7 shown as a parametric curve in the respective scatterplot. In case of discrete densities, they can be represented in terms of parametric curves related to the joint observations. Continuous densities can be represented in a similar manner. The identity line, shown in salmon, partitions the scatterplot space into the two regions U and D.

and union are then used in Equation 28to obtain the respective Jaccard index. For instance, let's calculate the multisets Jaccard index for the functions f (x) = cos(θ) and g(x) = sin(θ) for a complete period 0 ≤ θ ≤ 2π, as illustrated in Figure 10. This operation, which has been found to correspond to the intersection of real multisets with possibly negative values [START_REF] Da | Multisets[END_REF][START_REF] Da | Generalized multiset operations[END_REF], can be summarized as:

f (x) g(x) = ˆS s f s g min(s f f (x), s g g(x))dx ( 29
)
where S is the combined support of f (x) and g(x).

From which, the multiset convolution [START_REF] Da | Multisets[END_REF] (mconvolution) of two functions can be derived:

f (x) g(x)[y] = ´S f (x) g(x -y)dx ´S f (x) ˜ g(x -y)dx (30)
where f (x) ˜ g(x -y) corresponds to the absolute value union of generalized multisets [START_REF] Da | Generalized multiset operations[END_REF]:

f (x) ˜ g(x) = ˆS s f s g min(s f f (x), s g g(x))dx (31)
Equation 30 presents a direct analogy to the multiset Jaccard index. The other generalizations of the Jaccard index can be readily employed in the above expressions in order to cater for less or more strict similarity quantification.

Preliminary results have shown that the multiset convolution provides, in general, sharper and more selective peaks and smaller sidelobes than the standard correlation [START_REF] Da | Multisets[END_REF][START_REF] Da | Comparing cross correlationbased similarities[END_REF].

A further example of the Jaccard index adapted to multidimensional scalar fields, namely a gray level image, also incorporating the respective scatterplot representation of the paired multiplicities is provided in Figure 11.

Joint Variations

Joint variation are often taken in a normalized manner as when using the Pearson correlation coefficient. More specifically, we have that this coefficient can be understood as corresponding to the variance provided the samples of the two sets have been first standardized. By standardization it is henceforth understood that, given a random variable X, we apply the following random variable transformation:

X = X -µ X σ X (32)
This standardization has the effect of normalizing the dispersions of a random variables, so that the its variance becomes 1 while the average is 0. It can also be verified that a standardized random variable will present most of its observations within the interval [-2, 2].

In the case of a set of N observations of two standardized random variables, the Pearson correlation coefficient becomes:

P(X, Y ) = 1 N N i,j=1 [ Xi ][ Ỹi ] ( 33
)
When two standardized random variables X and Ỹ are taken jointly, they define a scatterplot providing a useful illustration about the interrelationship between the two considered values. This scatterplot can be immediately understood as corresponding to a sampling of the joint probability density of the two random variables, which may be kernel expanded to obtain an estimation of the respective counterpart.

The quantification of joint variation by a L1-based operatoron possibly negative values [START_REF] Akbas | Multiplication-free neural networks[END_REF] has been previously addressed [START_REF] Pan | Robust principal component analysis using a novel kernel related with the l1-norm[END_REF].

It constitutes an interesting issue to consider joint variation quantification based on the Jaccard and coincidence indices. In order to illustrate the possibility to quantify the joint variation of observations in a scallterplot (or, actually, joint densities), we consider the situation in Figure 12, which shows several scatterplots drawn from normal densities with increasing correlation.

Multiple Sets

We have so far considered indices applied to two sets or entities (e.g. [START_REF] Miranda-Quintana | Extended similarity indices: the benefits of comparing more than two objects simultaneously. part 1: Theory and characteristics[END_REF]). There are two basic ways in which

A = f (C, D, E, F ) B = f (C, G)
and then apply the Jaccard or coincidence indices. Observe that there is absolute no restriction on these functions, except that they are not both empty sets.

The Jaccard index for the example above can be expressed as:

J (A(C, D, E, F ), B(C, G)) = |A(C, D, E, F ) ∩ B(C, G)| |A(C, D, E, F ) ∪ B(C, G)|
Therefore, a vast range of possible combinations of diverse sets become possible, but they will ultimately always lead to two resulting sets A and B to be compared by the Jaccard or coincidence indices.

There is another interesting possibility to take into account more than 2 sets, and this corresponds to extending the Jaccard index, for instance in the case involving 3 sets, as:

J 3 (A, B, C) = |A ∩ B ∩ C| |A ∪ B ∪ C|
with 0 ≤ J (A, B, C) ≤ 1. This concept can be immediately extended to any number N S of sets.

The extension of the interiority index becomes:

I [3,1] (A, B, C) = |A ∩ B ∩ C| min {|A| , |B| , |C|}
It can be verified that this extended interiority index now quantifies how much the smallest of the sets is contained in the overall intersection. However, it does not take into account how the intermediate size set relates to the mutual intersection. This can be accomplished by introducing a second interiority index as:

I [3,2] (A, B, C) = |A ∩ B ∩ C| |X|
where X is the set with the second smallest cardinality.

The two obtained interiority indices can then be combined into a single respective index as: We can now define the coincidence index extended to three sets as:

C 3 (A, B, C) = I 3 (A, B, C) J 3 (A, B, C)
A similar development applies to more than 3 sets. The consideration of more than 2 sets in similarity index suggests other possible extensions of the Jaccard and coincidence indices. For instance, it becomes interesting not only to quantify the overall similarity between 3 sets, but also to develop indices capable of reflecting how these three sets are connected one another. Consider the situation depicted in Figure 13. This situation suggests that set B intermediates the connection between the sets C follows and A, therefore establishing a chaining relationship. The Jaccard index with 2 sets cannot cope directly with this situation.

A possible index involving three sets that can quantify the chaining between 3 sets is:

X (A, B, C) = J (B, (A ∩ B) ∪ (B ∩ C)) [1 -J (A, C)]
As an example, let's consider:

A ∩ B = {e, f, g} ; A ∩ C = {} ; B ∩ C = {i, j, k} ; A ∪ C = {a, b, c, d, e, f, g, i, j, k, l, m, n, o} ; (A ∩ B) ∪ (B ∩ C) = {e, f, g, i, j, k} ; B ∩ [(A ∩ B) ∪ (B ∩ C)] = {e, f, g, i, j, k} B ∪ [(A ∩ B) ∪ (B ∩ C)] = {e, f, g, h, i, j, k}
So, we have that:

J (B, (A ∩ B) ∪ (B ∩ C)) = = |B ∩ [(A ∩ B) ∪ (B ∩ C)]| |B ∪ [(A ∩ B) ∪ (B ∩ C)]| = 6 7 (34)
and:

J (B, C) = |A ∩ C| |A ∪ C| = 0 14 = 0 (35)
From which we obtain the chaining index value of:

X (A, B, C) = = J (B, (A ∩ B) ∪ (B ∩ C)) [1 -J (A, C)] = = 6 7 [1 -0] = 6 7
which provides an interesting indication of the chaining between the sets A, B, and C. Observe that the above described approach assumes that set B has been adopted as a reference for implementing the chaining between A and C. More generic situations can be addressed by considering successive pairwise combinations.

It should be observe that it is possible that one of the intersections betwen B and A or C is large enough to bias the above index. In these situations, it is possible to incorporate an additional index specifying a minimum overlap between both A and B as well as B and C.

Several other analogous chaining indices involving 3 or more sets or other structures are possible, leading to complementary properties.

The Jaccard and Coincidence Indices in Modeling

By allowing several types of mathematical structures to have their relationships to be quantified in terms of respective indices, it becomes possible to objective and quantitatively address a wide range of theoretical and practical problems, while also catering for the consideration of stochasticity.

In addition, the several indices discussed and suggested in this work represent a valuable resource while developing models (e.g. [START_REF] Da | Modeling: The human approach to science[END_REF]) through the combination of datasets as described in [START_REF] Da | An ample approach to modeling[END_REF].

Then, we have several additional possibilities of applying these indices. For instance, a new dataset can be compared to those already modeled by using the similarity indices. Also of particular interest is to identify which combinations, through set operations, between the existing datasets associated to models are more likely to account for other datasets of interest, therefore providing insights about how respective models can be identified, related, or developed.

The discussed indices are also interesting from the perspective of characterizing, developing, validating and applying pattern recognition and deep learning approaches [START_REF] Hinton | Training products of experts by minimizing contrastive divergence[END_REF][START_REF] Schmidhuber | Deep learning in neural networks:an overview[END_REF][START_REF] De Arruda | Learning deep learning. Researchgate[END_REF].

Concluding Remarks

Relationships between the several important mathematical structures -including sets, functions, vectors, densities, and graphs -are critically important in virtually all areas where mathematics is employed. Given its interesting features, the Jaccard index has been extensively employed in a large range of scientific and technological situations. Also as a consequence of its potential, the Jaccard index has been generalized in several manners.

The present work aimed at generalizing further the Jaccard index. One of the first discussed possibilities consisted in using the interiority index, capable of quantifying how much a set is contained into another, as means to complement a identified limitation of the Jaccard index in taking into account the interiority of one set into the other . This index was then combined with the Jaccard index to yield the coincidence index, which is believed to provide a more strict and selective quantification of the similarity between sets. The possibility to adopt the sum of multisets instead of the union was also addressed, with promising results for the situations where the multiplicity of the elements have to be fully taken into in account.

The possibility to apply the Jaccard and coincidence indices on continuous sets was then addressed by considering the areas of the involved regions in place of the number of set elements. This adaptation of the Jaccard index allowed the consideration of density fields and functions, which was approached by using the Jaccard index for multisets. The potential of this generalization of the Jaccard index was then briefly illustrated with respect to probability density functions as well as in a comparison between the cosine and sine functions, which are not normalized and can take negative values, as well as a realworld image and a respective noise version.

The intrinsic relationship between similarity indices and statistical quantifications of joint variation between random variables was approached subsequently, and it has been argued that both the Pearson correlation coefficient can be used to compare two density functions, but also that a respective adaptation of the Jaccard and coincidence indices can also be used for that finality. We also discussed the interesting possibility to visualize the action of the Jaccard and coincidence indices with respect to the division of the data into two regions defined by the identity line in the scatterplot distribution.

The also interesting situation of similarity and other indices considering three or more sets was then discussed, identifying the possibility to consider the two sets involved in the basic Jaccard and coincidence index as corresponding to the result of set operation combinations between any number of other sets. Another important extension was considered with respect to taking into account more than 2 sets as arguments for the similarity indices, which was illustrated in terms of a suggested index to quantify the chaining between three sets.

Several are the further possible works motivated by the concepts and methods reported and suggested in this work, a more complete list of which would be particularly extensive. Some of the possibilities include comparing the described indices with other indicators of similarity, the identification of other types of relationships that can be quantified when considering 3 or more sets and analogue generalizations of other interesting indices, as well as extending the described indices to other mathematical structures.

In addition, as observed in Section 11, similarity and other indices such as those addressed here provide valuable means for developing and evaluating models of data as well as for several pattern recognition and deep learning tasks.

Figure 1 :

 1 Figure 1: Two distinct situations involving two sets A and B that yield the same Jaccard index value of 3/7. However, the two sets in (b) are much more compatible because B is a subset of A and therefore shares all its elements.

Figure 2 :

 2 Figure 2: The three most relevant situations to be considered when comparing two sets: (a) no intersection; (b) partial interesection; (c) complete intersection.

  (b) actually incorporates the two other situations as limit cases. Consider the diagram shown in Figure 3, involving two square regions A and B, with respective sides a and b, b ≤ a.

Figure 3 :

 3 Figure 3: A construction representing all possible situations regarding the similarity of two sliding squares A and B with sides a and b, respectively. Without loss of generality, we assume that a ≥ b. Any of these situations can be specified by just two parameters: the relative position x and the relative size r = b/a. This construction allows us to better understand the behavior of the Jaccard and other similarity indices covered in this work.

Figure 4 :

 4 Figure 4: The Jaccard (a), interiority (b), and square root of the coincidence (c) indices obtained for the geometrical construction illustrated in Figure 3. The heat map increases from yellow to brown. The incorporation of the interiority level into the Jaccard index leads to a more comensurated distribution of the level sets. The maximum value the Jaccard and continuity indices are to be found at the lower righthand corner of the respective plots. The values of the interiority index increase linearly from the top to the bottom diagonal in (b). Along (d) to (f), we have analogous results concerning the additive multiset Jaccard index (d), the interiority (e), and square root of the additive coincidence index, the latter corresponding to the p (f). The latter index corresponds to the product of the additive multiset Jaccard and interiority indices.

Figure 5 :

 5 Figure 5: Five vertical slices of the respective indices in Fig.4. Only the interiority and additive multiset Jaccard indices account for the expected linear decrease of similarity following x displacements. However, the interiority is unable to take into account the relative size of the squares, which leaves only the additive multiset Jaccard as presenting a complete and linear quantification of the similarity between the two sets. The square root of the coincidence indices both penalizes the similarity when x is small, with the basic coindicence index imposing the most severe test of similarity.

  ) and (b), respectively. The Jaccard index, obtained by dividing the area of the intersection curve by the area of the union, yielded the value 0.09257.

Figure 7 :

 7 Figure 7: Two probability density functions p(x) and q(x) (a), with respective intersection and union as shown in (b) and (c). This situation yields a Jaccard index equal to 0.41. The maximum value 1 is obtained whenever the two densities are identical.

Figure 8 :

 8 Figure8: The two probability densities p(x) and q(x) in Figure7shown as a parametric curve in the respective scatterplot. In case of discrete densities, they can be represented in terms of parametric curves related to the joint observations. Continuous densities can be represented in a similar manner. The identity line, shown in salmon, partitions the scatterplot space into the two regions U and D.

Figure 9 :

 9 Figure 9: Jaccard for mfunctions with negative multiplicity. Points in the II and IV quadrants are reflected with respect to the vertical axes, and their intersection (minimum values) and union (maximum values) enter with negative values in the accumulated intersection and union.

Figure 10 :

 10 Figure 10: The Jaccard index calculated for a cosine and a sine function. The mfunctions are shown in (a), and the respective interesection and union mfunctions are shown in (b). The obtained Jaccard index was equal to 0. Indices of 1 and -1 will be obtained in case g(x) = cos(t) and g(x) = -cos(t), respectively.

Figure 11 :

 11 Figure 11: A gray level image of flowers img[x, y] (a) was mixed with random noise uniformly distributed between -0.5 and 0.5, resulting in the noisy image img[x, y] + ξ[x, y] shown in (b). The resulting scatterplot is depicted in (c), including the identity line defining the two regions for calculation of the scalar field intersection and union, from which a respective Jaccard index of J (img, img + ξ) = 0.83 was obtained, reflecting a relatively high similarity between the two scalar fields.

I 3 (

 3 A, B, C) = I [3,1] (A, B, C) I [3,2] (A, B, C) with 0 ≤ I 3 (A, B, C) ≤ 1.

Figure 12 :

 12 Figure12: Comparision of the Pearson correlation coefficient and the multiset Jaccard index for negative multiplicities with respect to several distribution of points with increasing correlation. Interestingly, the Jaccard index seems to provide a more gradual quantification of the joint variations that is probably more compatible with our perception. At the same time, the respective Pearson correlation coefficients tend to saturate as the correlation increases.

Figure 13 :

 13 Figure 13: Three sets A, B and C characterized by sequential, or chained intersections. In the suggested approach, B is taken as a candidate reference for intermediating the other two sets through a chaining relationship.

A

  = {a, b, c, d, e, f, g} ; B = {e, f, g, h, i, j, k} ; C = {i, j, k, l, m, n, o} It folows that:

Acknowledgments.

Luciano da F. Costa thanks CNPq (grant no. 307085/2018-0) and FAPESP (grant 15/22308-2).