Answers.Body: <p>First I need to note that there is no prescribed/best way to choose the shape of membership function in fuzzy systems, that's the fuzziness in it. One could argue that the best way is to ask an expert in the field where you are going to apply your fuzzy solution but those are not always available.</p>
  
  <p>With that said, fuzzy membership functions are used to describe the distribution of probabilities in real world for the variable you are trying to use in your fuzzy controller. That means you go out in the real world, you look at the system you are trying to control, you try your best to understand how it works and reacts to different outside changes and based on your findings you choose the shape that best fits. Or if you want you may call this process heuristic choice (something like that, I do not like theory very much).</p>
  
  <p>On top of that you need to realize one important thing, the shape of membership function does not have big impact on the resulting controller behavior. The most influencing parts are the Fuzzy Rules and their inference methods you use in your controller, but that is a different topic. So no matter what you choose it will not make a big difference. </p>
  
  <p>Gaussian functions are most commonly used because of the character of the world we are living in. Many people argue that everything in the world has Gaussian distribution (everyone is entitled to their opinion). And the triangular functions are used because they are the simplest alternative that is somewhat similar to Gaussian function.</p>
  
  <p>But if you absolutely need to chose the best one for your particular problem. There always are Simulation tools that exists precisely for this purpose. One of them is Matlab Simulink as you mentioned, but there are others if you don't like the price of the Matlab.</p>
  
  <p>My suggestion is, go with your gut, test it in safe environment and if it works then deploy it to the real world.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-02T12:36:04.833Z
Answers.LastActivityDate: 2018-04-02T12:36:04.833Z
Answers.UserDisplayName: Dominik
Body: <p>In classical set theory, there are two options for an element. It is either a member of a set or not. But in fuzzy set theory, there are <strong>membership functions</strong> to define the &quot;rate&quot; of an element being a member of a set. In other words, classical logic says it is all black or white, but fuzzy logic offers that there is also grey which has shades between white and black.</p>
  <p>Matlab Simulink Library is very easy to design and helpful in practice. And it has good examples on its own, like deciding about tips for a dinner looking at service and food quality. In the figure below, some various membership functions from Matlab's library are shown:</p>
  <p><a href="https://i.sstatic.net/aWG0C.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aWG0C.jpg" alt="enter image description here" /></a></p>
  <p><strong>My question:</strong> How do we decide which membership function to use while designing a fuzzy controller system?</p>
  <p>I mean, in general, not only in Matlab Simulink. I have seen <em>Triangular</em> and <em>Gaussian</em> functions are used mostly in practice, but how can we decide which function will give a better result for decision making? Do we need to train a neural network to decide which function is better depending on the problem and its rules? What are other solutions?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-09T14:22:35.247Z
Comments.Text: Do you have data to start with? I would select the member functions to approximately match the data you try to model. The function will depend on the problem you are trying to solve. The simplest way would be to plot your data and select the best match. However, this won't work with complex data space. How complex is your problem? What is the dimensionality of your problem space?
Comments.UserDisplayName: zlobi.wan.kenobi
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-14T17:07:04.283Z
Comments.Text: @zlobi.wan.kenobi Thank you for kind comment, and sorry for being late to reply. I dont have a data set to start with. My question was a general one. I was confused about how to choose membership functions according to different problems. For example, it can be "disease decision" from blood examination, building self resulting system looking at different values. There is pure fuzzyness in this problem, since examination values have a wide scale. I understood about rule making, I just wondered if there is another way while choosing most suitable membership funtion, beside using neural networks?
Comments.UserDisplayName: buzzer
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-07T07:00:30.217Z
Comments.Text: You can do some research on [Adaptive Neuro-Fuzzy Inference System](https://in.mathworks.com/help/fuzzy/neuro-adaptive-learning-and-anfis.html?requestedDomain=www.mathworks.com)!
Comments.UserDisplayName: kiner_shah
Tags: <neural-networks><hyperparameter-optimization><fuzzy-logic>
Title: How do we decide which membership function to use?
UserDisplayName: buzzer
ThreadText: # How do we decide which membership function to use?
  
  (Asked by: username_0 on 2017-01-31)
  
  In classical set theory, there are two options for an element. It is either a member of a set or not. But in fuzzy set theory, there are **membership functions** to define the "rate" of an element being a member of a set. In other words, classical logic says it is all black or white, but fuzzy logic offers that there is also grey which has shades between white and black.
  
  Matlab Simulink Library is very easy to design and helpful in practice. And it has good examples on its own, like deciding about tips for a dinner looking at service and food quality. In the figure below, some various membership functions from Matlab's library are shown:
  
  [![enter image description here](https://i.sstatic.net/aWG0C.jpg)](https://i.sstatic.net/aWG0C.jpg)
  
  **My question:** How do we decide which membership function to use while designing a fuzzy controller system?
  
  I mean, in general, not only in Matlab Simulink. I have seen *Triangular* and *Gaussian* functions are used mostly in practice, but how can we decide which function will give a better result for decision making? Do we need to train a neural network to decide which function is better depending on the problem and its rules? What are other solutions?
  
  **Tags:** neural-networks, hyperparameter-optimization, fuzzy-logic
  > **Comments:**
  > **username_1**: Do you have data to start with? I would select the member functions to approximately match the data you try to model. The function will depend on the problem you are trying to solve. The simplest way would be to plot your data and select the best match. However, this won't work with complex data space. How complex is your problem? What is the dimensionality of your problem space?  
  > **username_0**: @zlobi.wan.kenobi Thank you for kind comment, and sorry for being late to reply. I dont have a data set to start with. My question was a general one. I was confused about how to choose membership functions according to different problems. For example, it can be "disease decision" from blood examination, building self resulting system looking at different values. There is pure fuzzyness in this problem, since examination values have a wide scale. I understood about rule making, I just wondered if there is another way while choosing most suitable membership funtion, beside using neural networks?  
  > **username_2**: You can do some research on [Adaptive Neuro-Fuzzy Inference System](https://in.mathworks.com/help/fuzzy/neuro-adaptive-learning-and-anfis.html?requestedDomain=www.mathworks.com)!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-04-02. Score: 3
  
  First I need to note that there is no prescribed/best way to choose the shape of membership function in fuzzy systems, that's the fuzziness in it. One could argue that the best way is to ask an expert in the field where you are going to apply your fuzzy solution but those are not always available.
  
  With that said, fuzzy membership functions are used to describe the distribution of probabilities in real world for the variable you are trying to use in your fuzzy controller. That means you go out in the real world, you look at the system you are trying to control, you try your best to understand how it works and reacts to different outside changes and based on your findings you choose the shape that best fits. Or if you want you may call this process heuristic choice (something like that, I do not like theory very much).
  
  On top of that you need to realize one important thing, the shape of membership function does not have big impact on the resulting controller behavior. The most influencing parts are the Fuzzy Rules and their inference methods you use in your controller, but that is a different topic. So no matter what you choose it will not make a big difference.
  
  Gaussian functions are most commonly used because of the character of the world we are living in. Many people argue that everything in the world has Gaussian distribution (everyone is entitled to their opinion). And the triangular functions are used because they are the simplest alternative that is somewhat similar to Gaussian function.
  
  But if you absolutely need to chose the best one for your particular problem. There always are Simulation tools that exists precisely for this purpose. One of them is Matlab Simulink as you mentioned, but there are others if you don't like the price of the Matlab.
  
  My suggestion is, go with your gut, test it in safe environment and if it works then deploy it to the real world.
  
  
  ---
  
  