# What is fuzzy membership function – A complete guide

Fuzzy membership function is used to convert the crisp input provided to the fuzzy inference system. Fuzzy logic it self is not fuzzy, rather it deals with the fuzziness in the data. And this fuzziness in the data is best described by the fuzzy membership function.

Fuzzy inference system is the core part of any fuzzy logic system. Fuzzification is the first step in Fuzzy Inference System.

Formally, a membership function for a fuzzy set A on the universe of discourse X is defined as µA: X → [0, 1], where each element of X is mapped to a value between 0 and 1. This value, called membership value or degree of membership, quantifies the grade of membership of the element in X to the fuzzy set A. Here, X is the universal set and A is the fuzzy set derived from X.

Fuzzy membership function is the graphical way of visualizing degree of membership of any value in given fuzzy set. In the graph, X axis represents the universe of discourse and Y axis represents the degree of membership in the range [0, 1]

In following discussion, we will see various fuzzy membership functions. These functions are mathematically very simple. Fuzzy logic is meant to deal with the fuzziness, so use of complex membership function would not add much precision in final output.

## Fuzzy Membership Function:

### Singleton membership function:

Singleton membership function assigns membership value 1 to particular value of x, and assigns value 0 to rest of all. It is represented by impulse function as shown.

Mathematically it is formulated as,

### Triangular membership function:

This is one of the most widely accepted and used membership function (MF) in fuzzy controller design. The triangle which fuzzifies the input can be defined by three parameters a, b and c, where and c defines the base and b defines the height of the triangle.

Trivial case:

Here, in the diagram, X axis represents the input from the process (such as air conditioner, washing machine, etc.) and Y axis represents corresponding fuzzy value.

If input x = b, then it is having full membership in the given set. So,

μ(x) = 1, if x = b

And if input is less than a or greater then b, then it does belongs to fuzzy set at all, and its membership value will be 0

μ(x)=0,     x<a or x>c

x is between a and b:

If x is between a and b, as shown in the figure, its membership value varies from 0 to 1. If it is near a, its membership value is close to 0, and if x is near to b, its membership value gets close to 1.

We can compute the fuzzy value of x using similar triangle rule,

μ(x)=  (x – a) / (b – a),      a ≤ x ≤ b

x is between b and c:

If x is between b and c, as shown in the figure, its membership value varies from 0 to 1. If it is near b, its membership value is close to 1, and if x is near to c, its membership value gets close to 0.

We can compute the fuzzy value of x using similar triangle rule,

μ(x) = (c – x) / (c – b),            b ≤ x ≤ c

Combine all together:

We can combine all above scenario in single equation as,

Example: Triangular membership function

Determine ?, corresponding to x = 8.0

For given value of a, b and c, we have to compute the fuzzy value corresponding to x = 8. Using equation of triangular membership function ,

Thus, x = 8 will be mapped to fuzzy value 0.5 using given triangle fuzzy membership function

### Trapezoidal membership function:

Trapezoidal membership function is defined by four parameters: a, b, c and d. Span b to c represents the highest membership value that element can take. And if x is between (a, b) or (c, d), then it will have membership value between 0 and 1.

We can apply the triangle MF if elements is in between a to b or c to d.

It is quite obvious to combine all together as,

There are two special forms of trapezoidal function based on open-ness of function. They are known as R-function (Open right) and L-function (Left open). Shape and parameters of both the functions are depicted here:

R-function: it has a = b = -∞

L-function: It has c = d = +∞

Example: Trapezoidal membership function

Determine ?, corresponding to x = 3.5

### Gaussian membership function:

A Gaussian MF is specified by two parameters {m, σ} and can be defined as follows.

In this function, m represents the mean / center of the gaussian curve and σ represents the spread of the curve. This is more natural way of representing the data distribution, but due to mathematical complexity it is not much used for fuzzification.

Example: Gaussian membership function

Determine ? corresponding to x = 9, m = 10 and σ = 3.0

### Generalized bell shaped function:

It is also called Cauchy MF. A generalized bell MF is specified by three parameters {a, b, c} and can be defined as follows.

Example: Generalized bell shape membership function

Determine ? corresponding to x = 8

Using the above discussed equation of generalized bell shape membership function,

it is called generalized MF, because by changing the parameters a, b and c, we can produce a family of different membership functions.

The function μ(X)=1 / (1 + x2 ) can be modelled by setting a = b = 1 and c = 0. Similarly, we can produce other shapes/functions by setting appropriate a, b and c

### Sigmoid Membership function:

Sigmoid functions are widely used in classification task in machine learning. Specifically it is used in logistic regression and neural network, where it suppresses the input and maps it between 0 and 1.

It is controlled by parameters a and c. Where a controls the slope at the crossover point x = c

Mathematically, it is defined as

Graphically, we can represent it as,

Example: Sigmoid function

Determine ? corresponding to x = 8

By using equation of sigmoid membership function

## Test Your Knowledge !

1. What is the use of fuzzy membership functions?
2. Which membership function is used in Machine Learning?
3. State the pros and cons of complex fuzzy membership function

1. simran says:
• codecrucks says: