Product of Sigmoidal¶
The Product of Sigmoidal Membership Function creates a smooth, asymmetrical, bell-shaped curve by multiplying two distinct sigmoidal functions. It's used to model fuzzy sets that require a gradual but non-uniform transition, offering more flexibility than symmetric functions.
The function is defined as the product of two sigmoidal functions:
$$\mu(x) = f_1(x) \cdot f_2(x)$$ $$f_1(x) = \frac{1}{1 + e^{-a_1(x-c_1)}}$$ $$f_2(x) = \frac{1}{1 + e^{-a_2(x-c_2)}}$$
The function is controlled by four parameters, two for each component sigmoid:
$a_1$: Slope of the first sigmoid function.
$c_1$: Center (inflection point) of the first sigmoid function.
$a_2$: Slope of the second sigmoid function.
$c_2$: Center (inflection point) of the second sigmoid function.
To form a proper bell-shaped curve, the slopes $a_1$ and $a_2$ must have opposite signs (e.g., if $a_1 > 0$, then $a_2 < 0$).
The centers $c_1$ and $c_2$ determine the width and position of the curve's peak.
Partial Derivatives¶
The partial derivatives with respect to the parameters $a_1, c_1, a_2,$ and $c_2$ are:
With respect to $a_1$: $$\frac{\partial \mu}{\partial a_1} = (x-c_1) \cdot (1 - f_1(x)) \cdot \mu(x)$$
With respect to $c_1$: $$\frac{\partial \mu}{\partial c_1} = -a_1 \cdot (1 - f_1(x)) \cdot \mu(x)$$
With respect to $a_2$: $$\frac{\partial \mu}{\partial a_2} = (x-c_2) \cdot (1 - f_2(x)) \cdot \mu(x)$$
With respect to $c_2$: $$\frac{\partial \mu}{\partial c_2} = -a_2 \cdot (1 - f_2(x)) \cdot \mu(x)$$
Python Example¶
import numpy as np
import matplotlib.pyplot as plt
from anfis_toolbox.membership import ProdSigmoidalMF
mf = ProdSigmoidalMF(a1=2, c1=3, a2=-2, c2=4)
x = np.linspace(0, 10, 400)
y = mf(x)
plt.plot(x, y)
plt.show()
Visualization¶
Below is a comprehensive visualization showing how the ProdSigmoidalMF shape changes with different parameter combinations.