rulebase(type.model, rule, func.tsk = NULL)
For example: r1 <- c("a1","and","b1","->", "c1")
Here, ("a1", "and", "b1") is the antecedent, with "a1" and "b1" being fuzzy terms, and ("c1") is the consequent part.
A fuzzy IF-THEN rule base with several rules is defined in the following way:
r1 <- c("not a1","and","b1", "->", "c1")
r2 <- c("a2","or","b2", "->", "c2")
r3 <- c("a3","or","b2", "->", "c3")
rule <- list(r1,r2,r3)
For rules of the Takagi Sugeno Kang model, the rules are at first defined without the consequent part, e.g.:
r1 <- c("a1",1,"b1","->")
r2 <- c("a2",2,"b2", "->")
r3 <- c("a3","2","b2", "->")
rule <- list(r1,r2,r3)
The consequences are defined then as a matrix
fun_tsk
, which contains the linear equations of
the consequences of the rules. The dimension of this
matrix is [
So, for example, if we have 3 rules and 2 fuzzy variables
(A, B), the matrix fun_tsk
has dim(3,3), as in:
func.tsk <- matrix(c(1, 1, 5, 2, 1, 3, 1, 2, 2),
nrow=3, ncol=3, byrow = TRUE)
Furthermore, we can represent linguistic hedge within the rules. The kinds of hedges used are
An example of fuzzy IF-THEN rules using linguistic hedge is:
r1 <- c("very a1","and","b1","->","c1")
r2 <- c("a2",2,"b2", "->", "c2")
r3 <- c("a3","2","slightly b2", "->", "c3")
rule <- list(r1,r2,r3)
Furthermore, the following is an example in order to give names to the fuzzy terms in the input and output variables.
varinput.1 <- c("a1", "a2", "a3")
varinput.2 <- c("b1", "b2")
names.varinput <- c(varinput.1, varinput.2)
names.varoutput <- c("c1", "c2", "c3")
Note that the names of the fuzzy terms must be unique and
if we are using the learning methods, the fuzzy IF-THEN
rules will be generated automatically as the outputs of
frbs.learn
.
defuzzifier
, inference
, and
fuzzifier