addrule {FuzzyR} | R Documentation |
Inserts a rule
Description
Adds a rule to a fis object.
Usage
addrule(fis, ruleList)
Arguments
fis |
A fis structure is to be provided. |
ruleList |
A vector of length m + n + 2, where m is the number of input variables of a fis. |
Details
For example, if one has a fis with 2 input variables, and 1 output variable, each of which have 3 membership functions (the amount of membership functions need not be the same). The following rule: 1 3 2 1 2 will mean m = 2 (for 2 input variables), n = 1 (for 1 output variable), and the last 2 columns represent weight and fuzzy operator for the rule's antecedent respectively.
The first column refers to the first input variable's membership function at index 1.
The second column refers to the second input variable's membership function at index 3.
The third column refers to the first output variable's membership function at index 2.
The fourth column refers to the weight to be applied to the rule.
The fifth column refers to the fuzzy operator for the rule's antecedent (in this case it represents 'OR').
Value
A fis structure with the new rule added.
Examples
fis <- tipper()
ruleList <- rbind(c(1,1,1,1,2), c(2,0,2,1,1), c(3,2,3,1,2))
fis <- addrule(fis, ruleList)