Learn R Programming

lfl (version 1.4.2)

aggregateConsequents: Implicational aggregation of rules' consequents into a fuzzy set

Description

Take a character vector of consequent names, a numeric vector of membership degrees and a matrix that models fuzzy sets corresponding to the consequent names and perform an aggregation of the consequents into a fuzzy set in an implicational way.

This function is typically used within an inference mechanism after a set of firing rules is determined and the membership degrees of their antecedents is computed to combine the consequents of the firing rules into a fuzzy set. The result of this function is then typically defuzzified to obtain crisp result of the inference.

Usage

aggregateConsequents(conseq,
          degrees,
          partition)

Arguments

conseq

A character vector of consequents. Each value in the vector must correspond to a name of some column of the partition matrix. The length of this vector must be the same as of the degrees argument.

degrees

A numeric vector of membership degrees at which the corresponding consequents (see argument conseq) are fired.

partition

A matrix of membership degrees that describes the meaning of the consequents in vector conseq: each column of the matrix corresponds to a fuzzy set that models a single consequent (of a name given by column names of the matrix), each row corresponds to a single crisp value (which is not important for this function), hence each cell corresponds to a membership degree in which the crisp value is a member of a fuzzy set modelling the consequent. Each consequent in conseq must correspond to some column of this matrix. Such matrix may be created e.g. by using the fcut or lcut functions.

Value

A vector of membership degrees of fuzzy set elements that correspond to rows in the partition matrix. If empty vector of consequents is provided, a vector of 1's is returned. The length of the resulting vector equals to the number of rows of the partition matrix.

Details

Function assumes a set of implicative rules with antecedents firing at degrees given in degrees and with consequents in conseq. The meaning of the consequents is modeled with fuzzy sets whose membership degree values are captured in the partition matrix.

The function computes a fuzzy set that results from a conjunction of all provided implicative rules. For implication and conjunction, the Lukasiewics implication and the minimum t-norm is used, respectively.

See Also

fire, perceive, defuzz, fcut, lcut

Examples

Run this code
# NOT RUN {
    # create a partition matrix
    partition <- matrix(c(0:10/10, 10:0/10, rep(0, 5),
                          rep(0, 5), 0:10/10, 10:0/10,
                          0:12/12, 1, 12:0/12),
                        byrow=FALSE,
                        ncol=3)
    colnames(partition) <- c('a', 'b', 'c')

    # the result of aggregation is equal to:
    # pmin(1, partition[, 1] + (1 - 0.5), partition[, 2] + (1 - 0.8))
    aggregateConsequents(c('a', 'b'), c(0.5, 0.8), partition)
# }

Run the code above in your browser using DataLab