R: Fuzzy logic

fuzzy {sets} | R Documentation

## Fuzzy logic

### Description

Fuzzy Logic

### Usage

    fuzzy_logic(new, ...)
    .N.(x)
    .T.(x, y)
    .S.(x, y)
    .I.(x, y)

### Arguments

`x, y` | Numeric vectors.
`new` | A character string specifying one of the available fuzzy logic “families” (see details).
`...` | optional parameters for the selected family.

### Details

A call to `fuzzy_logic()` without arguments returns the currently set fuzzy logic, i.e., a named list with four components `N`, `T`, `S`, and `I` containing the corresponding functions for negation, conjunction (“t-norm”), disjunction (“t-conorm”), and residual implication (which may not be available).

The package provides several fuzzy logic families. A concrete fuzzy logic is selected by calling `fuzzy_logic` with a character string specifying the family name, and optional parameters. Let us refer to N(x) = 1 - x as the standard negation, and, for a t-norm T, let S(x, y) = 1 - T(1 - x, 1 - y) be the dual (or complementary) t-conorm. Available specifications and corresponding families are as follows, with the standard negation used unless stated otherwise.

`"Zadeh"`

  Zadeh's logic with T = \min and S = \max. Note that the minimum t-norm, also known as the Gödel t-norm, is the pointwise largest t-norm, and that the maximum t-conorm is the smallest t-conorm.

`"drastic"`

  the drastic logic with t-norm T(x, y) = y if x = 1, x if y = 1, and 0 otherwise, and complementary t-conorm S(x, y) = y if x = 0, x if y = 0, and 1 otherwise. Note that the drastic t-norm and t-conorm are the smallest t-norm and largest t-conorm, respectively.

`"product"`

  the family with the product t-norm T(x, y) = xy and dual t-conorm S(x, y) = x + y - xy.

`"Lukasiewicz"`

  the Lukasiewicz logic with t-norm T(x, y) = \max(0, x + y - 1) and dual t-conorm S(x, y) = \min(x + y, 1).

`"Fodor"`

  the family with Fodor's nilpotent minimum t-norm given by T(x, y) = \min(x, y) if x + y > 1, and 0 otherwise, and the dual t-conorm given by S(x, y) = \max(x, y) if x + y < 1, and 1 otherwise.

`"Frank"`

  the family of Frank t-norms T_p, p ≥ 0, which gives the Zadeh, product and Lukasiewicz t-norms for p = 0, 1, and Inf, respectively, and otherwise is given by T(x, y) = \log_p (1 + (p^x - 1) (p^y - 1) / (p - 1)).

`"Hamacher"`

  the three-parameter family of Hamacher, with negation N_γ(x) = (1 - x) / (1 + γ x), t-norm T_α(x, y) = xy / (α + (1 - α)(x + y - xy)), and t-conorm S_β(x, y) = (x + y + (β - 1) xy) / (1 + β xy), where α ≥ 0 and β, γ ≥ -1. This gives a deMorgan triple (for which N(S(x, y)) = T(N(x), N(y)) iff α = (1 + β) / (1 + γ). The parameters can be specified as `alpha`, `beta` and `gamma`, respectively. If α is not given, it is taken as α = (1 + β) / (1 + γ). The default values for β and γ are 0, so that by default, the product family is obtained.

The following parametric families are obtained by combining the corresponding families of t-norms with the standard negation.

`"Schweizer-Sklar"`

  the Schweizer-Sklar family T_p, -Inf <= p <= Inf, which gives the Zadeh (minimum), product and drastic t-norms for p = -Inf, 0, and Inf, respectively, and otherwise is given by T_p(x, y) = \max(0, (x^p + y^p - 1)^{1/p}).

`"Yager"`

  the Yager family T_p, p ≥ 0, which gives the drastic and minimum t-norms for p = 0 and Inf, respectively, and otherwise is given by T_p(x, y) = \max(0, 1 - ((1-x)^p + (1-y)^p)^{1/p}).

`"Dombi"`

  the Dombi family T_p, p ≥ 0, which gives the drastic and minimum t-norms for p = 0 and Inf, respectively, and otherwise is given by T_p(x, y) = 0 if x = 0 or y = 0, and T_p(x, y) = 1 / (1 + ((1/x - 1)^p + (1/y - 1)^p)^{1/p}) if both x > 0 and y > 0.

`"Aczel-Alsina"`

  the family of t-norms T_p, p ≥ 0, introduced by Aczél and Alsina, which gives the drastic and minimum t-norms for p = 0 and Inf, respectively, and otherwise is given by T_p(x, y) = \exp(-(|\log(x)|^p + |\log(y)|^p)^{1/p}).

`"Sugeno-Weber"`

  the family of t-norms T_p, -1 <= p <= Inf, introduced by Weber with dual t-conorms introduced by Sugeno, which gives the drastic and product t-norms for p = -1 and Inf, respectively, and otherwise is given by T_p(x, y) = \max(0, (x + y - 1 + pxy) / (1 + p)).

`"Dubois-Prade"`

  the family of t-norms T_p, 0 ≤ p ≤ 1, introduced by Dubois and Prade, which gives the minimum and product t-norms for p = 0 and 1, respectively, and otherwise is given by T_p(x, y) = xy / \max(x, y, p).

`"Yu"`

  the family of t-norms T_p, p ≥ -1, introduced by Yu, which gives the product and drastic t-norms for p = -1 and Inf, respectively, and otherwise is given by T(x, y) = \max(0, (1 + p) (x + y - 1) - p x y).

By default, the Zadeh logic is used.

`.N.`, `.T.`, `.S.`, and `.I.` are dynamic functions, i.e., wrappers that call the corresponding function of the current fuzzy logic. Thus, the behavior of code using these functions will change according to the chosen logic.

### References

C. Alsina, M. J. Frank and B. Schweizer (2006), Associative Functions: Triangular Norms and Copulas. World Scientific. ISBN 981-256-671-6.

J. Dombi (1982), A general class of fuzzy operators, the De Morgan class of fuzzy operators and fuzziness measures induced by fuzzy operators, Fuzzy Sets and Systems 8, 149–163.

J. Fodor and M. Roubens (1994), Fuzzy Preference Modelling and Multicriteria Decision Support. Kluwer Academic Publishers, Dordrecht.

D. Meyer and K. Hornik (2009), Generalized and customizable sets in R, Journal of Statistical Software 31(2), 1–27. http://www.jstatsoft.org/v31/i02/

B. Schweizer and A. Sklar (1983), Probabilistic Metric Spaces. North-Holland, New York. ISBN 0-444-00666-4.

### Examples

    x <- c(0.7, 0.8)
    y <- c(0.2, 0.3)

    ## Use default family ("Zadeh")
    .N.(x)
    .T.(x, y)
    .S.(x, y)
    .I.(x, y)

    ## Switch family and try again
    fuzzy_logic("Fodor")
    .N.(x)
    .T.(x, y)
    .S.(x, y)
    .I.(x, y)

[Package sets version 1.0-18 Index]