To generate the corresponding membership function f(x), also called fuzzy set, according to type and parameters
genmf(mf.type, mf.params)
The membership function type
The parameters for a membership function
The desired type of membership function f(x), where x is a generic element of U, which is the universe of discourse for a fuzzy set
Built-in membership function types are: 'gbellmf', 'it2gbellmf', 'singletonmf', 'linearmf', 'gaussmf', 'trapmf', 'trimf'. mf.params for
'gbellmf' is c(a, b, c
), where a
denotes the width, b
is usually positive and c locates the center of the curve.
'it2gbellmf' is c(a.lower, a.upper, b, c
), where a.upper > a.lower
when b > 0
and a.upper < a.lower
when b < 0
'singletonmf' is c(c
), where c
is the location where the membership grade is 1.
'linearmf' is c(...
), which are the coefficients of the linear membership function.
'gaussmf' is c(sig, c
), which are the parameters for exp(-(x - c)^2/(2 * sig^2)).
'trapmf' is c(a, b, c, d
), where a
and d
locate the "feet" of the trapezoid and b
and c
locate the "shoulders".
'trimf' is c(a, b, c
), where a
and c
locate the "feet" of the triangle and b
locates the peak.
Note that users are able to define their own membership functions.
# NOT RUN {
mf <- genmf('gbellmf', c(1,2,3))
evalmf(1:10, mf)
# }
Run the code above in your browser using DataLab