Given truth degrees of predicates, compute the truth value of given list of rules.
1 2 3 4 5 6 7
Truth degrees of predicates.
Either an object of S3 class
A character string representing a triangular norm to be used
Deprecated parameter. Computation is done sequentially.
The aim of this function is to compute the truth value of each rule in a
rules list by assigning truth values to rule's predicates given by data
x is a numeric vector or numeric matrix of truth values of predicates. If
x is vector then
names(x) must correspond to the predicate names
x is a matrix then each column should represent a predicate
colnames(x) must correspond to predicate names in
x are interpreted as truth values, i.e., they must be from the
interval [0, 1]. If matrix is given, the resulting truth values are
rules may be a list of character vectors or an instance of the S3 class
farules(). The character vectors in the
rules list represent formulae
in conjunctive form. If
fire() treats the rule as
a conjunction of all predicates, i.e., a conjunction of all predicates is
onlyAnte=TRUE, the first element of each rule is removed
prior evaluation, i.e., a conjunction of all predicates except the first
are computed: this is useful if
rules is a
farules() object, since
farules() objects save a rule's consequent as the first element (see also
The type of conjunction to be computed can be specified with the
x is a matrix then the result of this function is a list
of numeric vectors with truth values of each rule, i.e., each element of the
resulting list corresponds to a rule and each value of the vector in the resulting
list corresponds to a row of the original data matrix
x as a vector is treated as a single-row matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# fire whole rules on a vector x <- 1:10 / 10 names(x) <- letters[1:10] rules <- list(c('a', 'c', 'e'), c('b'), c('d', 'a'), c('c', 'a', 'b')) fire(x, rules, tnorm='goguen', onlyAnte=FALSE) # fire antecedents of the rules on a matrix x <- matrix(1:20 / 20, nrow=2) colnames(x) <- letters[1:10] rules <- list(c('a', 'c', 'e'), c('b'), c('d', 'a'), c('c', 'a', 'b')) fire(x, rules, tnorm='goedel', onlyAnte=TRUE) # the former command should be equal to fire(x, antecedents(rules), tnorm='goedel', onlyAnte=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.