View source: R/ApplyZFunction.R
ApplyZFunction | R Documentation |
ApplyZFunction
applies the selected function to a fuzzy number using the Zadeh's principle.
ApplyZFunction(
value,
FUN,
knots = 10,
approximation = FALSE,
method = "NearestEuclidean",
...
)
value |
Input fuzzy number. |
FUN |
Function used for the input fuzzy number with the help of the Zadeh's principle. |
knots |
Number of the alpha-cuts used during calculation of the output. |
approximation |
If |
method |
The selected approximation method. |
... |
Additional parameters passed to other functions. |
The function takes the input fuzzy number value
(which should be described by one of the
classes from FuzzyNumbers
package) and applies the function FUN
using
the Zadeh's principle. The output is given by a fuzzy number or its approximation (when
approximation
is set to TRUE
and the respective method
is selected).
To properly find the output, value of FUN
is calculated for many alpha-cuts of value
.
The number of these alpha-cuts is equal to knots
(plus 2 for the support and the core).
The input fuzzy number value
should be given by fuzzy number described by classes from FuzzyNumbers
package.
The output is a fuzzy number described by
classes from FuzzyNumbers
package (piecewise linear fuzzy number without approximation,
various types with the approximation applied).
library(FuzzyNumbers)
# prepare complex fuzzy number
A <- FuzzyNumber(-5, 3, 6, 20, left=function(x)
pbeta(x,0.4,3),
right=function(x) 1-x^(1/4),
lower=function(alpha) qbeta(alpha,0.4,3),
upper=function(alpha) (1-alpha)^4)
# find the output via the Zadeh's principle
ApplyZFunction(A,FUN=function(x)x^3+2*x^2-1)
# find the approximated output via the Zadeh's principle
ApplyZFunction(A,FUN=function(x)x^3+2*x^2-1,approximation=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.