Legacy Documentation

Fuzzy Logic (2004)

This is documentation for an obsolete product.
Current products and services

 Documentation /  Fuzzy Logic /  Manual /

Fuzzy OperationsFuzzy Set Visualization

1.4 Aggregation Operations

1.4.1 Introduction

Fuzzy Logic provides a number of functions for aggregating two or more fuzzy sets or fuzzy relations. In this chapter, we will introduce these functions and demonstrate how to use them.

This loads the package.

In[1]:=

To use the various aggregation operations, we need a few fuzzy sets or fuzzy relations. For convenience, we demonstrate the aggregation operations in this chapter using a pair of fuzzy sets. Keep in mind, however, that the aggregation operations will also work with two or more fuzzy sets or fuzzy relations.

When using the aggregation operations, the fuzzy sets or fuzzy relations being combined must be defined on the same universal space. It does not make sense to combine items defined on different universal spaces.

We create two fuzzy sets to use in our demonstrations with the FuzzyTrapezoid and FuzzyGaussian functions that were described earlier in Chapter 1.1 Creating Fuzzy Sets.

In[2]:=

In[3]:=

In[4]:=

To look at these two fuzzy sets, we use the FuzzyPlot command. On the graph, FS1 is represented by the trapezoidal fuzzy set with a height of 1. FS2 is the Gaussian fuzzy set.

In[5]:=

1.4.2 Intersection (t-norm) and Union (s-norm) Operations

Basic aggregation operations.

Intersection[A1, A2, ... , An] returns the intersection of A1, A2, ... , An, where the A's are either fuzzy sets or fuzzy relations. This function has a Type option for specifying what kind of intersection should be taken. The default setting is the Standard or Min intersection. Other valid types of intersections are shown in the following table.

Values of the Type option for Intersection.

For our first example, we use the default intersection to combine the two fuzzy sets that we created earlier. This produces the Standard or Min intersection of the two fuzzy sets.

In[6]:=

For the standard case, the intersection takes the minimum of FS1 and FS2. We can plot the original fuzzy sets, FS1 and FS2, along with their intersection using the FuzzyPlot function. The PlotJoined option is set to True to produce a continuous representation of the discrete fuzzy sets. We use Mathematica's Epilog function to show the plot of the original fuzzy sets with the plot of the intersection. We also could have used the FuzzyPlot command to plot all of these fuzzy sets on one graph, and we use that technique below.

In[7]:=

We now experiment with some of the nonstandard intersections by changing the Type option. Here we take the Hamacher intersection of the two fuzzy sets where the parameter w is set to 2.

In[8]:=

Out[8]=

We compare this intersection with the Standard intersection by plotting the two results on the same graph. When we do this, we see that our Hamacher intersection returns values slightly less than the standard Min intersection. In general, this is true for all nonstandard intersections.

In[9]:=

There is a group of t-norm operators that are collectively called products. Each of these operations is simply a specific case of one of the intersections listed before, so we have not included explicit functions for these operations. If you desire to use one of these operators, however, you may use the appropriate value for the option Type of union from the following table.

Relation between types of products and the Type option for Intersection.

As an example, if you wanted to find the bounded product of FS1 and FS2, you could use a Yager intersection like this.

In[10]:=

Out[10]=

In[11]:=

Union[A1, A2, ..., An, opts] returns the union of A1, A2, ... , An, where the A's can be fuzzy sets or fuzzy relations. This function has a Type option for specifying what type of union should be taken. The default is the Standard or Max union. Other valid union types are shown in the following table.

Values of the Type option for Union.

For our first Union example, we use the default Standard union to combine our two fuzzy sets.

In[12]:=

Out[12]=

We look at the results by plotting the original fuzzy sets along with the union. On the graph, since the union is graphed last, it covers the original fuzzy sets in certain areas. If you remember what our original fuzzy sets looked like, however, you can see that the standard union takes the maximum membership grade of the two fuzzy sets for each element.

In[13]:=

Now let's look at a nonstandard union. This time we use the Frank union with parameter s set to 3. The formulas for all the aggregation operations can be found in the appendix.

In[14]:=

Out[14]=

We compare this latest union with the Standard union from the first example by plotting the two results together.

In[15]:=

From the graph, you see that the Frank union returns membership grades greater than or equal to the membership grades returned by the Standard union. This condition is true for all of the nonstandard unions.

There is a group of s-norm operators, which are collectively called sums. Each of these operations is simply a specific case of one of the unions listed before, so we do not include explicit functions for these operations. If you desire to use one of these operators, however, you may use the appropriate value for the option Type of union from the following table.

Relation between types of sums and the Type option for Union.

As an example, to find the drastic sum of FS1 and FS2, you would enter the following.

In[16]:=

Out[16]=

1.4.3 Averaging Operations

Averaging operators are aggregation operators that fall in the region between intersections and unions. In this section, we examine some of the common averaging operations.

Averaging aggregate operations.

FuzzyArithmeticMean[A1, A2, ... , An] returns the arithmetic mean of A1, A2, ... , An, where the A's are fuzzy sets or fuzzy relations.

In[17]:=

Out[17]=

We look at how this averaging operation behaves by plotting the original fuzzy sets with their average. The membership grades for the average fuzzy set falls between the membership grades of the two original fuzzy sets.

In[18]:=

FuzzyGeometricMean[A1, A2, ... , An] returns the geometric mean of A1, A2, ... , An, where the A's are fuzzy sets or fuzzy relations.

In[19]:=

Out[19]=

In[20]:=

FuzzyHarmonicMean[A1, A2, ... , An] returns the harmonic mean of A1, A2, ... , An, where the A's are fuzzy sets or fuzzy relations.

In[21]:=

Out[21]=

In[22]:=

Now we compare the various averaging operations by plotting all the results of the averaging operations on the same graph.

In[23]:=

GeneralizedMean[A1, A2, ... , An, alpha] returns the generalized mean of A1, A2, ... , An, where the A's are fuzzy sets or fuzzy relations. This function takes a parameter alpha.

This function is a general averaging function which encompasses the full range of averaging operations. The averaging operations shown earlier are specific cases of the generalized mean. This function provides you with a great deal of flexibility when choosing how to average fuzzy sets. Here is an example where the parameter alpha is 2.

In[24]:=

Out[24]=

In[25]:=

1.4.4 Difference Operations

Difference aggregate operations.

Difference[A, B] returns the general difference between A and B, where A and B are fuzzy sets or fuzzy relations.

In[26]:=

Out[26]=

To get a feel of what kind of result the differences produce, we plot the original fuzzy sets along with the difference on the same plot.

In[27]:=

AbsoluteDifference[A, B] returns the absolute difference between A and B, where A and B are fuzzy sets or fuzzy relations.

In[28]:=

Out[28]=

We again look at the results with the FuzzyPlot function.

In[29]:=

SymmetricDifference[A, B] returns the symmetric difference between A and B, where A and B are fuzzy sets or fuzzy relations.

In[30]:=

Out[30]=

In[31]:=

1.4.5 User-Defined Aggregators

General aggregation operation.

GeneralAggregator[fun, A1, A2, ... , An] uses the function fun to combine the membership grades of A1, A2, ... , An, where the A's are either fuzzy sets or fuzzy relations. This is the most general aggregate operation and virtually every other aggregation operation can be expressed in its terms. Here we demonstrate this function by first creating a function for combining the membership grades of the elements and then calling GeneralAggregator with this function and our two fuzzy sets.

In[32]:=

In[33]:=

Out[33]=

To see how our new aggregator behaves, we look at a plot of the results from the previous calculation.

In[34]:=

You can use a built-in function SetOptions to restore the default setting for the FuzzySet object.

In[35]:=

Out[35]=

Fuzzy OperationsFuzzy Set Visualization