Function File: y = psigmf (x, params)
Function File: y = psigmf ([x1 x2 ... xn], [a1 c1 a2 c2])

For a given domain x and parameters params (or [a1 c1 a2 c2]), return the corresponding y values for the product of two sigmoidal membership functions.

The argument x must be a real number or a non-empty vector of strictly increasing real numbers, and a1, c1, a2, and c2 must be real numbers. This membership function satisfies the equation:

f(x) = (1/(1 + exp(-a1*(x - c1)))) * (1/(1 + exp(-a2*(x - c2))))

The function is bounded above by 1 and below by 0.

If a1 is positive, a2 is negative, and c1 and c2 are far enough apart with c1 < c2, then:

  • (a1)/4 ~ the rising slope at c1
  • c1 ~ the left inflection point
  • (a2)/4 ~ the falling slope at c2
  • c2 ~ the right inflection point

and at each inflection point, the value of the function is about 0.5:

  • f(c1) ~ f(c2) ~ 0.5.

(Here, the symbol ~ means "approximately equal".)

To run the demonstration code, type demo('psigmf') at the Octave prompt.

See also: dsigmf, gauss2mf, gaussmf, gbellmf, pimf, sigmf, smf, trapmf, trimf, zmf.

Demonstration 1

The following code

 x = 0:100;
 params = [0.5 20 -0.3 60];
 y1 = psigmf(x, params);
 params = [0.3 20 -0.2 60];
 y2 = psigmf(x, params);
 params = [0.2 20 -0.1 60];
 y3 = psigmf(x, params);
 figure('NumberTitle', 'off', 'Name', 'psigmf demo');
 plot(x, y1, 'r;params = [0.5 20 -0.3 60];', 'LineWidth', 2)
 hold on;
 plot(x, y2, 'b;params = [0.3 20 -0.2 60];', 'LineWidth', 2)
 hold on;
 plot(x, y3, 'g;params = [0.2 20 -0.1 60];', 'LineWidth', 2)
 ylim([-0.1 1.1]);
 xlabel('Crisp Input Value', 'FontWeight', 'bold');
 ylabel('Degree of Membership', 'FontWeight', 'bold');
 grid;

Produces the following figure

Figure 1

Package: fuzzy-logic-toolkit