Function File: y = dsigmf (x, params)
Function File: y = dsigmf ([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 difference between two sigmoidal membership functions.

The argument x must be a real number or a non-empty list 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)))

and in addition, is bounded above and below by 1 and 0 (regardless of the value given by the formula above).

If the parameters a1 and a2 are positive 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('dsigmf') at the Octave prompt.

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

Demonstration 1

The following code

 x = 0:100;
 params = [0.5 20 0.3 60];
 y1 = dsigmf(x, params);
 params = [0.3 20 0.2 60];
 y2 = dsigmf(x, params);
 params = [0.2 20 0.1 60];
 y3 = dsigmf(x, params);
 figure('NumberTitle', 'off', 'Name', 'dsigmf 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