Title: | Tools to Deal with Fuzzy Numbers |
---|---|
Description: | S4 classes and methods to deal with fuzzy numbers. They allow for computing any arithmetic operations (e.g., by using the Zadeh extension principle), performing approximation of arbitrary fuzzy numbers by trapezoidal and piecewise linear ones, preparing plots for publications, computing possibility and necessity values for comparisons, etc. |
Authors: | Marek Gagolewski [aut, cre] , Jan Caha [ctb] |
Maintainer: | Marek Gagolewski <[email protected]> |
License: | LGPL (>= 3) |
Version: | 0.4-7 |
Built: | 2024-11-01 11:19:12 UTC |
Source: | https://github.com/gagolews/fuzzynumbers |
FuzzyNumbers is an open source (LGPL 3) package for R. It provides S4 classes and methods to deal with fuzzy numbers. The package may be used by researchers in fuzzy numbers theory (e.g., for testing new algorithms, generating numerical examples, preparing figures).
Fuzzy set theory gives one of many ways (in particular, see Bayesian probabilities) to represent imprecise information. Fuzzy numbers form a particular subclass of fuzzy sets of the real line. The main idea behind this concept is motivated by the observation that people tend to describe their knowledge about objects through vague numbers, e.g., "I'm about 180 cm tall" or "The event happened between 2 and 3 p.m.".
For the formal definition of a fuzzy number
please refer to the FuzzyNumber
man page.
Note that this package also deals with particular types
of fuzzy numbers like trapezoidal, piecewise linear, or “parametric” FNs
(see TrapezoidalFuzzyNumber
PiecewiseLinearFuzzyNumber
,
PowerFuzzyNumber
, and *EXPERIMENTAL*
DiscontinuousFuzzyNumber
)
The package aims to provide the following functionality:
Representation of arbitrary fuzzy numbers (including FNs with discontinuous side functions and/or alpha-cuts), as well as their particular types, e.g. trapezoidal and piecewise linear fuzzy numbers,
Defuzzification and approximation by triangular
and piecewise linear FNs (see e.g. expectedValue
,
value
, trapezoidalApproximation
,
piecewiseLinearApproximation
),
Visualization of FNs (see plot
, as.character
),
Basic operations on FNs (see e.g. fapply
and Arithmetic),
etc.
For a complete list of classes and methods
call help(package="FuzzyNumbers")
.
Moreover, you will surely be interested in a step-by-step guide to the
package usage and features which is available at the project's webpage.
Keywords: Fuzzy Numbers, Fuzzy Sets, Shadowed Sets, Trapezoidal Approximation, Piecewise Linear Approximation, Approximate Reasoning, Imprecision, Vagueness, Randomness.
Acknowledgments: Many thanks to Jan Caha, Przemyslaw Grzegorzewski, Lucian Coroianu, and Pablo Villacorta Iglesias for stimulating discussion.
The development of the package in March-June 2013 was partially supported by the European Union from resources of the European Social Fund, Project PO KL “Information technologies: Research and their interdisciplinary applications”, agreement UDA-POKL.04.01.01-00-051/10-00.
Marek Gagolewski, with contributions from Jan Caha
Ban A.I. (2008), Approximation of fuzzy numbers by trapezoidal fuzzy numbers preserving the expected interval, Fuzzy Sets and Systems 159, pp. 1327-1344.
Ban A.I. (2009), On the nearest parametric approximation of a fuzzy number - Revisited, Fuzzy Sets and Systems 160, pp. 3027-3047.
Bodjanova S. (2005), Median value and median interval of a fuzzy number, Information Sciences 172, pp. 73-89.
Chanas S. (2001), On the interval approximation of a fuzzy number, Fuzzy Sets and Systems 122, pp. 353-356.
Coroianu L., Gagolewski M., Grzegorzewski P. (2013), Nearest Piecewise Linear Approximation of Fuzzy Numbers, Fuzzy Sets and Systems 233, pp. 26-51.
Coroianu L., Gagolewski M., Grzegorzewski P., Adabitabar Firozja M., Houlari T. (2014), Piecewise linear approximation of fuzzy numbers preserving the support and core, In: Laurent A. et al. (Eds.), Information Processing and Management of Uncertainty in Knowledge-Based Systems, Part II (CCIS 443), Springer, pp. 244-254.
Delgado M., Vila M.A., Voxman W. (1998), On a canonical representation of a fuzzy number, Fuzzy Sets and Systems 93, pp. 125-135.
Dubois D., Prade H. (1978), Operations on fuzzy numbers, Int. J. Syst. Sci. 9, pp. 613-626.
Dubois D., Prade H. (1987a), The mean value of a fuzzy number, Fuzzy Sets and Systems 24, pp. 279-300.
Dubois D., Prade H. (1987b), Fuzzy numbers: An overview, In: Analysis of Fuzzy Information. Mathematical Logic, vol. I, CRC Press, pp. 3-39.
Grzegorzewski P. (2010), Algorithms for trapezoidal approximations of fuzzy numbers preserving the expected interval, In: Bouchon-Meunier B. et al. (Eds.), Foundations of Reasoning Under Uncertainty, Springer, pp. 85-98.
Grzegorzewski P. (1998), Metrics and orders in space of fuzzy numbers, Fuzzy Sets and Systems 97, pp. 83-94.
Grzegorzewski P,. Pasternak-Winiarska K. (2011), Trapezoidal approximations of fuzzy numbers with restrictions on the support and core, Proc. EUSFLAT/LFA 2011, Atlantis Press, pp. 749-756.
Klir G.J., Yuan B. (1995), Fuzzy sets and fuzzy logic. Theory and applications, Prentice Hall, New Jersey.
Stefanini L., Sorini L. (2009), Fuzzy arithmetic with parametric LR fuzzy numbers, In: Proc. IFSA/EUSFLAT 2009, pp. 600-605.
Yeh C.-T. (2008), Trapezoidal and triangular approximations preserving the expected interval, Fuzzy Sets and Systems 159, pp. 1345-1353.
For fuzzy numbers the equality of X*X == X^2
does not hold.
## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 ^ e2
## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 ^ e2
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
numeric (if it is not integer it will be converted by function as.integer()) |
This function calculates integer power of a PiecewiseLinearFuzzyNumber according to the reference below.
Returns a fuzzy number of the class PiecewiseLinearFuzzyNumber
indicating e1^e2
.
KAUFMANN, A., GUPTA, M. M. (1985) Introduction to Fuzzy Arithmetic. New York : Van Nostrand Reinhold Company. ISBN 044230079.
Other extension_principle:
Arithmetic
,
fapply()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-2, 1, 9), knot.n = 2) x^2 x^3
x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-2, 1, 9), knot.n = 2) x^2 x^3
If is a fuzzy number, then its
-cuts are
always in form of intervals.
Moreover, the
-cuts form a nonincreasing
chain w.r.t.
.
## S4 method for signature 'FuzzyNumber,numeric' alphacut(object, alpha)
## S4 method for signature 'FuzzyNumber,numeric' alphacut(object, alpha)
object |
a fuzzy number |
alpha |
numeric vector with elements in [0,1] |
Returns a matrix with two columns (left and right alha cut bounds).
if some elements in alpha
are not in [0,1], then NA
is set.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other alpha_cuts:
core()
,
supp()
A <- TrapezoidalFuzzyNumber(1, 2, 3, 4) alphacut(A, c(-1, 0.4, 0.2))
A <- TrapezoidalFuzzyNumber(1, 2, 3, 4) alphacut(A, c(-1, 0.4, 0.2))
We have .
## S4 method for signature 'FuzzyNumber' alphaInterval(object, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber' alphaInterval(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' alphaInterval(object) ## S4 method for signature 'PowerFuzzyNumber' alphaInterval(object)
## S4 method for signature 'FuzzyNumber' alphaInterval(object, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber' alphaInterval(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' alphaInterval(object) ## S4 method for signature 'PowerFuzzyNumber' alphaInterval(object)
object |
a fuzzy number |
... |
for |
Note that if an instance of the FuzzyNumber
or
DiscontinuousFuzzyNumber
class
is given, the calculation is performed via numerical integration.
Otherwise, the computation is exact.
Returns numeric vector of length 2.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
The ambiguity (Delgado et al, 1998) is a measure of nonspecificity of a fuzzy number.
## S4 method for signature 'FuzzyNumber' ambiguity(object, ...)
## S4 method for signature 'FuzzyNumber' ambiguity(object, ...)
object |
a fuzzy number |
... |
additional arguments passed to |
The ambiguity is defined as
.
Returns a single numeric value.
Delgado M., Vila M.A., Voxman W. (1998), On a canonical representation of a fuzzy number, Fuzzy Sets and Systems 93, pp. 125-135.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other characteristics:
expectedValue()
,
value()
,
weightedExpectedValue()
,
width()
The function may be used to create side generating functions from alpha-cut generators and inversely.
approxInvert(f, method = c("monoH.FC", "linear", "hyman"), n = 500)
approxInvert(f, method = c("monoH.FC", "linear", "hyman"), n = 500)
f |
a monotonic, continuous function f: [0,1]->[0,1] |
method |
interpolation method: “ |
n |
number of interpolation points |
The function is a wrapper to splinefun and approxfun. Thus, interpolation is used.
Returns a new function, the approximate inverse of the input.
Other auxiliary:
convertAlpha()
,
convertSide()
The arc-tangent of two arguments arctan2(y, x) returns the angle between the x-axis and the vector from the origin to (x, y) for PiecewiseLinearFuzzyNumbers.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' arctan2(y, x)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' arctan2(y, x)
y |
a PiecewiseLinearFuzzyNumber |
x |
a PiecewiseLinearFuzzyNumber |
Note that resulting values are no longer from interval [-pi,pi] but [-1.5pi,pi], in order to provide valid fuzzy numbers as result.
Returns a fuzzy number of the class PiecewiseLinearFuzzyNumber indicating the angle specified by the input fuzzy numbers. The range of results is [-1.5pi,pi].
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-2, 3, 5), knot.n = 9) x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -4, 1.5), knot.n = 9) arctan2(y,x)
y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-2, 3, 5), knot.n = 9) x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -4, 1.5), knot.n = 9) arctan2(y,x)
Applies arithmetic operations using the extension principle and interval-based calculations.
## S4 method for signature 'numeric,FuzzyNumber' e1 + e2 # e2 + e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,TrapezoidalFuzzyNumber' e1 + e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 + e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 + e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 + e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'numeric,FuzzyNumber' e1 - e2 # e2*(-1) + e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,TrapezoidalFuzzyNumber' e1 - e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 - e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 - e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 - e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'FuzzyNumber,ANY' e1 - e2 # -e1 ## S4 method for signature 'numeric,FuzzyNumber' e1 * e2 # e2 * e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,numeric' e1 * e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 * e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 * e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 * e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 / e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 / e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 / e2 # calls as.PiecewiseLinearFuzzyNumber()
## S4 method for signature 'numeric,FuzzyNumber' e1 + e2 # e2 + e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,TrapezoidalFuzzyNumber' e1 + e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 + e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 + e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 + e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'numeric,FuzzyNumber' e1 - e2 # e2*(-1) + e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,TrapezoidalFuzzyNumber' e1 - e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 - e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 - e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 - e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'FuzzyNumber,ANY' e1 - e2 # -e1 ## S4 method for signature 'numeric,FuzzyNumber' e1 * e2 # e2 * e1 ## S4 method for signature 'TrapezoidalFuzzyNumber,numeric' e1 * e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 * e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 * e2 # calls as.PiecewiseLinearFuzzyNumber() ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 * e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,numeric' e1 / e2 ## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' e1 / e2 ## S4 method for signature 'PiecewiseLinearFuzzyNumber,FuzzyNumber' e1 / e2 # calls as.PiecewiseLinearFuzzyNumber()
e1 |
a fuzzy number or single numeric value |
e2 |
a fuzzy number or single numeric value |
Implemented operators: +
, -
, *
, /
for piecewise linear fuzzy numbers.
Also some versions may be applied on numeric values and
trapezoidal fuzzy numbers.
Note that according to the theory the class of PLFNs is not closed under the operations * and /. However, if you operate on a large number of knots, the results should be satisfactory.
Thanks to Jan Caha for suggestions on PLFN operations.
Returns a fuzzy number of the class PiecewiseLinearFuzzyNumber or TrapezoidalFuzzyNumber.
Other FuzzyNumber-method:
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other PiecewiseLinearFuzzyNumber-method:
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other TrapezoidalFuzzyNumber-method:
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
Other extension_principle:
^,PiecewiseLinearFuzzyNumber,numeric-method
,
fapply()
This method is especially useful if you would like to generate LaTeX equations defining a fuzzy numbers.
## S4 method for signature 'FuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'TrapezoidalFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'PowerFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A")
## S4 method for signature 'FuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'TrapezoidalFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A") ## S4 method for signature 'PowerFuzzyNumber' as.character(x, toLaTeX=FALSE, varnameLaTeX="A")
x |
a fuzzy number |
toLaTeX |
logical; should LaTeX code be output? |
varnameLaTeX |
character; variable name to be included in equations |
Consider calling the cat
function on the resulting
string.
Thanks to Jan Caha for suggesting the toLaTeX
arg.
Returns a character vector.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
Other conversion:
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
Please note that applying this function on a FuzzyNumber
child class causes information loss, as it drops all additional slots
defined in the child classes.
FuzzyNumber
is the base class for all FNs.
Note that some functions for TFNs or PLFNs
work much faster and are more precise. This function shouldn't be
used in normal computations.
## S4 method for signature 'numeric' as.FuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.FuzzyNumber(object)
## S4 method for signature 'numeric' as.FuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.FuzzyNumber(object)
object |
a fuzzy number or a single numeric value (crisp number) or vector of length two (interval) |
Returns an bject of class FuzzyNumber
.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other conversion:
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
This method is only for exact conversion.
For other cases (e.g. general FNs), use
piecewiseLinearApproximation
.
## S4 method for signature 'TrapezoidalFuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'numeric' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'FuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)])
## S4 method for signature 'TrapezoidalFuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'numeric' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'FuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)]) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.PiecewiseLinearFuzzyNumber(object, knot.n=0, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)])
object |
a fuzzy number or a single numeric value (crisp number) or vector of length two (interval) |
knot.n |
the number of knots |
knot.alpha |
|
Returns an object of class PiecewiseLinearFuzzyNumber
.
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other conversion:
as.FuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
This method is only for exact conversion.
## S4 method for signature 'numeric' as.PowerFuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'PowerFuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'TrapezoidalFuzzyNumber' as.PowerFuzzyNumber(object)
## S4 method for signature 'numeric' as.PowerFuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'PowerFuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.PowerFuzzyNumber(object) ## S4 method for signature 'TrapezoidalFuzzyNumber' as.PowerFuzzyNumber(object)
object |
a fuzzy number or a single numeric value (crisp number) or vector of length two (interval) |
Returns an object of class PowerFuzzyNumber
.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
alphaInterval()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other conversion:
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
This method is only for exact conversion.
For other cases (e.g. general FNs), use
trapezoidalApproximation
.
## S4 method for signature 'numeric' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'PowerFuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'TrapezoidalFuzzyNumber' as.TrapezoidalFuzzyNumber(object)
## S4 method for signature 'numeric' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'FuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'PowerFuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' as.TrapezoidalFuzzyNumber(object) ## S4 method for signature 'TrapezoidalFuzzyNumber' as.TrapezoidalFuzzyNumber(object)
object |
a fuzzy number or a single numeric value (crisp number) or vector of length two (interval) |
Returns an bject of class TrapezoidalFuzzyNumber
.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
expectedInterval()
,
plot()
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.character()
,
expectedInterval()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other conversion:
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.character()
The resulting function calls the original function and then linearly scales its output.
convertAlpha(f, y1, y2)
convertAlpha(f, y1, y2)
f |
a function into [y1,y2] |
y1 |
numeric vector of length 1 |
y2 |
numeric vector of length 1 |
Returns a new function defined on [0,1] (scaled input).
Other auxiliary:
approxInvert()
,
convertSide()
The resulting function linearly scales the input and passes it to the original function.
convertSide(f, x1, x2)
convertSide(f, x1, x2)
f |
a function defined on [x1,x2] |
x1 |
numeric vector of length 1; if longer, only the first element is used |
x2 |
numeric vector of length 1; if longer, only the first element is used |
The function works for x1<x2 and x1>x2.
Returns a new function defined on [0,1] (scaled input).
Other auxiliary:
approxInvert()
,
convertAlpha()
We have .
This gives the values that a fuzzy number necessarily represents.
## S4 method for signature 'FuzzyNumber' core(object)
## S4 method for signature 'FuzzyNumber' core(object)
object |
a fuzzy number |
Returns a numeric vector of length 2.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other alpha_cuts:
alphacut()
,
supp()
For convenience, objects of class DiscontinuousFuzzyNumber
may be created with this function.
DiscontinuousFuzzyNumber( a1, a2, a3, a4, lower = function(a) rep(NA_real_, length(a)), upper = function(a) rep(NA_real_, length(a)), left = function(x) rep(NA_real_, length(x)), right = function(x) rep(NA_real_, length(x)), discontinuities.left = numeric(0), discontinuities.right = numeric(0), discontinuities.lower = numeric(0), discontinuities.upper = numeric(0) )
DiscontinuousFuzzyNumber( a1, a2, a3, a4, lower = function(a) rep(NA_real_, length(a)), upper = function(a) rep(NA_real_, length(a)), left = function(x) rep(NA_real_, length(x)), right = function(x) rep(NA_real_, length(x)), discontinuities.left = numeric(0), discontinuities.right = numeric(0), discontinuities.lower = numeric(0), discontinuities.upper = numeric(0) )
a1 |
a number specyfing left bound of the support |
a2 |
a number specyfing left bound of the core |
a3 |
a number specyfing right bound of the core |
a4 |
a number specyfing right bound of the support |
lower |
lower alpha-cut bound generator; a nondecreasing function [0,1]->[0,1] or returning NA_real_ |
upper |
upper alpha-cut bound generator; a nonincreasing function [0,1]->[1,0] or returning NA_real_ |
left |
lower side function generator; a nondecreasing function [0,1]->[0,1] or returning NA_real_ |
right |
upper side function generator; a nonincreasing function [0,1]->[1,0] or returning NA_real_ |
discontinuities.left |
nondecreasingly sorted numeric vector with elements in (0,1), possibly of length 0 |
discontinuities.right |
nondecreasingly sorted numeric vector with elements in (0,1), possibly of length 0 |
discontinuities.lower |
nondecreasingly sorted numeric vector with elements in (0,1), possibly of length 0 |
discontinuities.upper |
nondecreasingly sorted numeric vector with elements in (0,1), possibly of length 0 |
Object of class DiscontinuousFuzzyNumber
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber-class
,
Extract
,
distance()
,
integrateAlpha()
,
plot()
Discontinuity information increase the precision of some numerical
integration-based algorithms, e.g. of piecewiseLinearApproximation
.
It also allows for making more valid fuzzy number plots.
a1
, a2
, a3
, a4
,
lower
, upper
, left
, right
:Inherited from the FuzzyNumber
class.
discontinuities.left
:nondecreasingly sorted numeric vector with elements in (0,1); discontinuity points for the left side generating function
discontinuities.right
:nondecreasingly sorted numeric vector with elements in (0,1); discontinuity points for the right side generating function
discontinuities.lower
:nondecreasingly sorted numeric vector with elements in (0,1); discontinuity points for the lower alpha-cut bound generator
discontinuities.upper
:nondecreasingly sorted numeric vector with elements in (0,1); discontinuity points for the upper alpha-cut bound generator
Class FuzzyNumber
, directly.
DiscontinuousFuzzyNumber
for a convenient constructor
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber
,
Extract
,
distance()
,
integrateAlpha()
,
plot()
showClass("DiscontinuousFuzzyNumber") showMethods(classes="DiscontinuousFuzzyNumber")
showClass("DiscontinuousFuzzyNumber") showMethods(classes="DiscontinuousFuzzyNumber")
Currently, only Euclidean distance may be calculated.
We have ,
see (Grzegorzewski, 1988).
## S4 method for signature 'FuzzyNumber,FuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'FuzzyNumber,DiscontinuousFuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,FuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,DiscontinuousFuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...)
## S4 method for signature 'FuzzyNumber,FuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'FuzzyNumber,DiscontinuousFuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,FuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,DiscontinuousFuzzyNumber' distance(e1, e2, type=c("Euclidean", "EuclideanSquared"), ...)
e1 |
a fuzzy number |
e2 |
a fuzzy number |
... |
additional arguments passed to |
type |
one of |
The calculation are done using numerical integration,
Returns the calculated distance, i.e. a single numeric value.
Grzegorzewski P., Metrics and orders in space of fuzzy numbers, Fuzzy Sets and Systems 97, 1998, pp. 83-94.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber-class
,
DiscontinuousFuzzyNumber
,
Extract
,
integrateAlpha()
,
plot()
This function returns the value(s) of the membership function of a fuzzy number at given point(s).
## S4 method for signature 'FuzzyNumber,numeric' evaluate(object, x)
## S4 method for signature 'FuzzyNumber,numeric' evaluate(object, x)
object |
a fuzzy numbers |
x |
numeric vector |
Returns a numeric vector.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
T <- TrapezoidalFuzzyNumber(1,2,3,4) evaluate(T, seq(0, 5, by=0.5))
T <- TrapezoidalFuzzyNumber(1,2,3,4) evaluate(T, seq(0, 5, by=0.5))
We have ,
see (Duboid, Prade, 1987).
## S4 method for signature 'FuzzyNumber' expectedInterval(object, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber' expectedInterval(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' expectedInterval(object) ## S4 method for signature 'PowerFuzzyNumber' expectedInterval(object)
## S4 method for signature 'FuzzyNumber' expectedInterval(object, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber' expectedInterval(object) ## S4 method for signature 'PiecewiseLinearFuzzyNumber' expectedInterval(object) ## S4 method for signature 'PowerFuzzyNumber' expectedInterval(object)
object |
a fuzzy number |
... |
for |
Note that if an instance of the FuzzyNumber
or DiscontinuousFuzzyNumber
class
is given, the calculation is performed via numerical integration.
Otherwise, the computation is exact.
Returns a numeric vector of length 2.
Dubois D., Prade H. (1987), The mean value of a fuzzy number, Fuzzy Sets and Systems 24, pp. 279-300.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
plot()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
The calculation of the so-called expected value is one of possible methods to deffuzify a fuzzy number.
## S4 method for signature 'FuzzyNumber' expectedValue(object, ...)
## S4 method for signature 'FuzzyNumber' expectedValue(object, ...)
object |
a fuzzy number |
... |
additional arguments passed to |
The expected value of is defined as
,
where
is the
expectedInterval.
Returns a single numeric value.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other deffuzification:
value()
,
weightedExpectedValue()
Other characteristics:
ambiguity()
,
value()
,
weightedExpectedValue()
,
width()
For possible slot names see man pages for the FuzzyNumber class and its derivatives
## S4 method for signature 'FuzzyNumber,character' x[i] ## S4 method for signature 'PiecewiseLinearFuzzyNumber,character' x[i] ## S4 method for signature 'PowerFuzzyNumber,character' x[i] ## S4 method for signature 'DiscontinuousFuzzyNumber,character' x[i]
## S4 method for signature 'FuzzyNumber,character' x[i] ## S4 method for signature 'PiecewiseLinearFuzzyNumber,character' x[i] ## S4 method for signature 'PowerFuzzyNumber,character' x[i] ## S4 method for signature 'DiscontinuousFuzzyNumber,character' x[i]
x |
a fuzzy number |
i |
character; slot name |
All slot accessors are read-only.
Returns the slot value.
Other FuzzyNumber-method:
Arithmetic
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PowerFuzzyNumber-method:
PowerFuzzyNumber-class
,
PowerFuzzyNumber
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber-class
,
DiscontinuousFuzzyNumber
,
distance()
,
integrateAlpha()
,
plot()
A <- FuzzyNumber(1,2,3,4) A["a1"] A["right"]
A <- FuzzyNumber(1,2,3,4) A["a1"] A["right"]
Applies a given monotonic function using the extension principle (i.e. the function is applied on alpha-cuts).
## S4 method for signature 'PiecewiseLinearFuzzyNumber,function' fapply(object, fun, ...)
## S4 method for signature 'PiecewiseLinearFuzzyNumber,function' fapply(object, fun, ...)
object |
a fuzzy number |
fun |
a monotonic, vectorized R function |
... |
additional arguments passed to |
Currently only a method for the PiecewiseLinearFuzzyNumber class has been defined. The computations are exact (up to a numeric error) at knots. So, make sure you have a sufficient number of knots if you want good approximation.
For other types of fuzzy numbers, consider using
piecewiseLinearApproximation
.
Returns a PiecewiseLinearFuzzyNumber.
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other extension_principle:
Arithmetic
,
^,PiecewiseLinearFuzzyNumber,numeric-method
For convenience, objects of class FuzzyNumber
may be created with this function.
FuzzyNumber( a1, a2, a3, a4, lower = function(a) rep(NA_real_, length(a)), upper = function(a) rep(NA_real_, length(a)), left = function(x) rep(NA_real_, length(x)), right = function(x) rep(NA_real_, length(x)) )
FuzzyNumber( a1, a2, a3, a4, lower = function(a) rep(NA_real_, length(a)), upper = function(a) rep(NA_real_, length(a)), left = function(x) rep(NA_real_, length(x)), right = function(x) rep(NA_real_, length(x)) )
a1 |
a number specyfing left bound of the support |
a2 |
a number specyfing left bound of the core |
a3 |
a number specyfing right bound of the core |
a4 |
a number specyfing right bound of the support |
lower |
lower alpha-cut bound generator; a nondecreasing function [0,1]->[0,1] or returning NA_real_ |
upper |
upper alpha-cut bound generator; a nonincreasing function [0,1]->[1,0] or returning NA_real_ |
left |
lower side function generator; a nondecreasing function [0,1]->[0,1] or returning NA_real_ |
right |
upper side function generator; a nonincreasing function [0,1]->[1,0] or returning NA_real_ |
Object of class FuzzyNumber
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Formally, a fuzzy number (Dubois, Prade, 1987) is a fuzzy subset of the
real line
with membership function
given by:
| |
if , |
|
| |
if , |
|
= |
| |
if , |
| |
if , |
|
| |
if , |
|
where ,
,
is a nondecreasing function
called the left side generator of
,
and
is a nonincreasing function
called the right side generator of
.
Note that this is a so-called L-R representation of a fuzzy number.
Alternatively, it may be shown that each fuzzy number may be uniquely determined
by specifying its
-cuts,
. We have
and
for , where
and
are, respectively, strictly increasing and decreasing functions
satisfying
and
.
Please note that many algorithms that deal with fuzzy numbers often use
-cuts rather than side functions.
Note that the FuzzyNumbers package also deals with particular types of fuzzy numbers like trapezoidal, piecewise linear, or “parametric” FNs.
a1
:Single numeric value specifying the left bound for the support.
a2
:Single numeric value specifying the left bound for the core.
a3
:Single numeric value specifying the right bound for the core.
a4
:Single numeric value specifying the right bound for the support.
lower
:A nondecreasing function [0,1]->[0,1] that gives the lower alpha-cut bound.
upper
:A nonincreasing function [0,1]->[1,0] that gives the upper alpha-cut bound.
left
:A nondecreasing function [0,1]->[0,1] that gives the left side function.
right
:A nonincreasing function [0,1]->[1,0] that gives the right side function.
TrapezoidalFuzzyNumber
,
PiecewiseLinearFuzzyNumber
,
PowerFuzzyNumber
, and
DiscontinuousFuzzyNumber
Dubois D., Prade H. (1987), Fuzzy numbers: An overview, In: Analysis of Fuzzy Information. Mathematical Logic, vol. I, CRC Press, pp. 3-39.
FuzzyNumber
for a convenient constructor, and
as.FuzzyNumber
for conversion of objects to this class.
Also, see convertSide
for creating side functions generators,
convertAlpha
for creating alpha-cut bounds generators,
approxInvert
for inverting side functions/alpha-cuts numerically.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
showClass("FuzzyNumber") showMethods(classes="FuzzyNumber")
showClass("FuzzyNumber") showMethods(classes="FuzzyNumber")
The function uses multiple calls to integrate
.
integrate_discont_val(f, from, to, discontinuities = numeric(0), ...)
integrate_discont_val(f, from, to, discontinuities = numeric(0), ...)
f |
an R function taking a numeric vector of length 1 as its first argument and returning a numeric vector of length 1 |
from |
the lower limit of integration |
to |
the upper limit of integration |
discontinuities |
nondecreasingly sorted numeric vector which indicates
the points at which |
... |
further arguments to be passed to the |
Returns the estimate of the integral.
Integrates numerically a transformed or weighted lower or upper alpha-cut bound of a fuzzy number.
## S4 method for signature 'FuzzyNumber,character,numeric,numeric' integrateAlpha(object, which=c("lower", "upper"), from=0, to=1, weight=NULL, transform=NULL, ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,character,numeric,numeric' integrateAlpha(object, which=c("lower", "upper"), from=0, to=1, weight=NULL, transform=NULL, ...)
## S4 method for signature 'FuzzyNumber,character,numeric,numeric' integrateAlpha(object, which=c("lower", "upper"), from=0, to=1, weight=NULL, transform=NULL, ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,character,numeric,numeric' integrateAlpha(object, which=c("lower", "upper"), from=0, to=1, weight=NULL, transform=NULL, ...)
object |
a fuzzy number |
which |
one of |
from |
numeric |
to |
numeric |
... |
additional arguments passed to |
weight |
a function or NULL |
transform |
a function or NULL |
Returns a single numeric value.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber-class
,
DiscontinuousFuzzyNumber
,
Extract
,
distance()
,
plot()
Determines maximum fuzzy number based on two inputs.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' maximum(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' maximum(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
The resulting PiecewiseLinearFuzzyNumber is only an approximation of the result it might not be very precise for small number of knots (see examples).
Returns a PiecewiseLinearFuzzyNumber representing maximal value of the inputs.
KAUFMANN, A., GUPTA, M. M. (1985) Introduction to Fuzzy Arithmetic. New York : Van Nostrand Reinhold Company. ISBN 044230079.
Other min_max-operators:
minimum()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
# example with low number of knots, showing the approximate nature # of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5)) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1)) maxFN = maximum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(maxFN, col="green", add=TRUE) # example with high number of knots, that does not suffer # from the approximate nature of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5), knot.n = 9) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1), knot.n = 9) maxFN = maximum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(maxFN, col="green", add=TRUE)
# example with low number of knots, showing the approximate nature # of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5)) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1)) maxFN = maximum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(maxFN, col="green", add=TRUE) # example with high number of knots, that does not suffer # from the approximate nature of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5), knot.n = 9) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1), knot.n = 9) maxFN = maximum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(maxFN, col="green", add=TRUE)
Determines minimum fuzzy number based on two inputs.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' minimum(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' minimum(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
The resulting PiecewiseLinearFuzzyNumber is only an approximation of the result it might not be very precise for small number of knots (see examples).
Returns a PiecewiseLinearFuzzyNumber representing maximal value of the inputs.
KAUFMANN, A., GUPTA, M. M. (1985) Introduction to Fuzzy Arithmetic. New York : Van Nostrand Reinhold Company. ISBN 044230079.
Other min_max-operators:
maximum()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
# example with low number of knots, showing the approximate nature # of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5)) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1)) minFN = minimum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(minFN, col="green", add=TRUE) # example with high number of knots, that does not suffer # from the approximate nature of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5), knot.n = 9) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1), knot.n = 9) minFN = minimum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(minFN, col="green", add=TRUE)
# example with low number of knots, showing the approximate nature # of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5)) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1)) minFN = minimum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(minFN, col="green", add=TRUE) # example with high number of knots, that does not suffer # from the approximate nature of the result x = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-4.8, -3 , -1.5), knot.n = 9) y = as.PiecewiseLinearFuzzyNumber(TriangularFuzzyNumber(-5.5, -2.5, -1.1), knot.n = 9) minFN = minimum(x,y) min = min(alphacut(x,0)[1],alphacut(y,0)[1]) max = max(alphacut(x,0)[2],alphacut(y,0)[2]) plot(x, col="red", xlim=c(min,max)) plot(y, col="blue", add=TRUE) plot(minFN, col="green", add=TRUE)
Determines value of necessity of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityExceedance(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityExceedance(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the necessity of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityExceedance(a,b)
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityExceedance(a,b)
Determines value of necessity of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityStrictExceedance(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityStrictExceedance(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the strict necessity of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityStrictExceedance(a,b)
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityStrictExceedance(a,b)
Determines value of necessity of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityStrictUndervaluation(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityStrictUndervaluation(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the necessity of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityStrictUndervaluation(a,b)
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityStrictUndervaluation(a,b)
Determines value of necessity of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityUndervaluation(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' necessityUndervaluation(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the necessity of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityUndervaluation(a,b)
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) necessityUndervaluation(a,b)
This method finds a piecewise linear approximation
of a given fuzzy number
by using the algorithm specified by the
method
parameter.
## S4 method for signature 'FuzzyNumber' piecewiseLinearApproximation(object, method=c("NearestEuclidean", "SupportCorePreserving", "Naive"), knot.n=1, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)], ..., verbose=FALSE)
## S4 method for signature 'FuzzyNumber' piecewiseLinearApproximation(object, method=c("NearestEuclidean", "SupportCorePreserving", "Naive"), knot.n=1, knot.alpha=seq(0, 1, length.out=knot.n+2)[-c(1,knot.n+2)], ..., verbose=FALSE)
object |
a fuzzy number |
... |
further arguments passed to |
method |
character; one of: |
knot.n |
desired number of knots (if missing, then calculated from given
|
knot.alpha |
alpha-cuts at which knots will be positioned (defaults to equally distributed knots) |
verbose |
logical; should some technical details on the computations being performed be printed?
[only |
'method
' may be one of:
NearestEuclidean
: see (Coroianu, Gagolewski, Grzegorzewski, 2013 and 2014a);
uses numerical integration, see integrateAlpha
.
Slow for large knot.n
.
SupportCorePreserving
:
This method was proposed in (Coroianu et al., 2014b)
and is currently only available for knot.n==1
.
It is the L2-nearest piecewise linear approximation with constraints
core(A)==core(P(A)) and supp(A)==supp(P(A));
uses numerical integration.
Naive
:
We have core(A)==core(P(A)) and supp(A)==supp(P(A)) and the knots are
taken directly from the specified alpha cuts (linear interpolation).
Returns a PiecewiseLinearFuzzyNumber
object.
Coroianu L., Gagolewski M., Grzegorzewski P. (2013), Nearest Piecewise Linear Approximation of Fuzzy Numbers, Fuzzy Sets and Systems 233, pp. 26-51.
Coroianu L., Gagolewski M., Grzegorzewski P., Adabitabar Firozja M., Houlari T. (2014a), Piecewise linear approximation of fuzzy numbers preserving the support and core, In: Laurent A. et al. (Eds.), Information Processing and Management of Uncertainty in Knowledge-Based Systems, Part II (CCIS 443), Springer, pp. 244-254.
Coroianu L., Gagolewski M., Grzegorzewski P. (2014b), Nearest Piecewise Linear Approximation of Fuzzy Numbers - General Case, submitted for publication.
Other approximation:
trapezoidalApproximation()
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
(A <- FuzzyNumber(-1, 0, 1, 3, lower=function(x) sqrt(x),upper=function(x) 1-sqrt(x))) (PA <- piecewiseLinearApproximation(A, "NearestEuclidean", knot.n=1, knot.alpha=0.2))
(A <- FuzzyNumber(-1, 0, 1, 3, lower=function(x) sqrt(x),upper=function(x) 1-sqrt(x))) (PA <- piecewiseLinearApproximation(A, "NearestEuclidean", knot.n=1, knot.alpha=0.2))
For convenience, objects of class PiecewiseLinearFuzzyNumber
may be created with this function.
PiecewiseLinearFuzzyNumber( a1, a2, a3, a4, knot.n = 0, knot.alpha = numeric(0), knot.left = numeric(0), knot.right = numeric(0) )
PiecewiseLinearFuzzyNumber( a1, a2, a3, a4, knot.n = 0, knot.alpha = numeric(0), knot.left = numeric(0), knot.right = numeric(0) )
a1 |
a number specyfing left bound of the support |
a2 |
a number specyfing left bound of the core |
a3 |
a number specyfing right bound of the core |
a4 |
a number specyfing right bound of the support |
knot.n |
the number of knots |
knot.alpha |
|
knot.left |
|
knot.right |
|
If a1
, a2
, a3
, and a4
are missing,
then knot.left
and knot.right
may be of length knot.n+2
.
If knot.n
is not given, then it guessed from length(knot.left)
.
If knot.alpha
is missing, then the knots will be equally distributed
on the interval [0,1].
An object of class PiecewiseLinearFuzzyNumber
.
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
A piecewise linear fuzzy number (PLFN) has side functions and alpha-cut bounds that linearly interpolate a given set of points (at fixed alpha-cuts).
If knot.n
is equal to 0 or all left and right knots lie on common lines,
then a Piecewise Linear Fuzzy Number reduces to a
TrapezoidalFuzzyNumber.
Note that, however, the
TrapezoidalFuzzyNumber
does not inherit from
PiecewiseLinearFuzzyNumber
for efficiency reasons.
To convert the former to the latter, call as.PiecewiseLinearFuzzyNumber
.
a1
, a2
, a3
, a4
,
lower
, upper
, left
, right
:Inherited from the FuzzyNumber
class.
knot.n
:number of knots, a single integer value, 0 for a trapezoidal fuzzy number
knot.alpha
:alpha-cuts, increasingly sorted vector of length knot.n
with elements in [0,1]
knot.left
:nondecreasingly sorted vector of length knot.n
;
defines left alpha-cut bounds at knots
knot.right
:nondecreasingly sorted vector of length knot.n
;
defines right alpha-cut bounds at knots
Class FuzzyNumber
, directly.
PiecewiseLinearFuzzyNumber
for a convenient constructor,
as.PiecewiseLinearFuzzyNumber
for conversion of objects to this class,
and piecewiseLinearApproximation
for approximation routines.
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
showClass("PiecewiseLinearFuzzyNumber") showMethods(classes="PiecewiseLinearFuzzyNumber")
showClass("PiecewiseLinearFuzzyNumber") showMethods(classes="PiecewiseLinearFuzzyNumber")
The function aims to provide a similar look-and-feel to the
built-in plot.default
and curve
function.
## S4 method for signature 'FuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, n=101, at.alpha=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, shadowdensity=15, shadowangle=45, shadowcol=col, shadowborder=NULL, add=FALSE, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...) ## S4 method for signature 'PiecewiseLinearFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, n=101, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...)
## S4 method for signature 'FuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, n=101, at.alpha=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, shadowdensity=15, shadowangle=45, shadowcol=col, shadowborder=NULL, add=FALSE, ...) ## S4 method for signature 'TrapezoidalFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...) ## S4 method for signature 'PiecewiseLinearFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...) ## S4 method for signature 'DiscontinuousFuzzyNumber,missing' plot(x, y, from=NULL, to=NULL, n=101, draw.membership.function=TRUE, draw.alphacuts=!draw.membership.function, xlab=NULL, ylab=NULL, xlim=NULL, ylim=NULL, type="l", col=1, lty=1, pch=1, lwd=1, add=FALSE, ...)
x |
a fuzzy number |
y |
not used |
from |
numeric; |
to |
numeric; |
n |
numeric; number of points to probe |
at.alpha |
numeric vector; give exact alpha-cuts at which linear interpolation should be done |
draw.membership.function |
logical; you want membership function ( |
draw.alphacuts |
logical; defaults |
xlab |
character; x-axis label |
ylab |
character; y-axis label |
xlim |
numeric; |
ylim |
numeric; |
type |
character; defaults |
col |
see |
lty |
see |
pch |
see |
lwd |
see |
shadowdensity |
numeric; for shadowed sets; |
shadowangle |
numeric; for shadowed sets; |
shadowcol |
color specification, see |
shadowborder |
numeric; for shadowed sets; |
add |
logical; add another FuzzyNumber to existing plot? |
... |
further arguments passed to |
Note that if from > a1
then it is set to a1
.
Returns nothing really interesting.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
Other DiscontinuousFuzzyNumber-method:
DiscontinuousFuzzyNumber-class
,
DiscontinuousFuzzyNumber
,
Extract
,
distance()
,
integrateAlpha()
plot(FuzzyNumber(0,1,2,3), col="gray") plot(FuzzyNumber(0,1,2,3, left=function(x) x^2, right=function(x) 1-x^3), add=TRUE) plot(FuzzyNumber(0,1,2,3, lower=function(x) x, upper=function(x) 1-x), add=TRUE, col=2)
plot(FuzzyNumber(0,1,2,3), col="gray") plot(FuzzyNumber(0,1,2,3, left=function(x) x^2, right=function(x) 1-x^3), add=TRUE) plot(FuzzyNumber(0,1,2,3, lower=function(x) x, upper=function(x) 1-x), add=TRUE, col=2)
Determines value of possibility of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityExceedance(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityExceedance(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the possibility of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityExceedance(a,b)
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityExceedance(a,b)
Determines value of possibility of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityStrictExceedance(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityStrictExceedance(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the strict possibility of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictUndervaluation()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityStrictExceedance(a,b)
a <- TriangularFuzzyNumber(2, 3, 5) b <- TriangularFuzzyNumber(1.5, 4, 4.8) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityStrictExceedance(a,b)
Determines value of possibility of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityStrictUndervaluation(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityStrictUndervaluation(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the necessity of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityUndervaluation()
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityStrictUndervaluation(a,b)
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityStrictUndervaluation(a,b)
Determines value of possibility of , the result is from
range [0,1]. Value 0 indicates no fulfilment of the operator
and 1 indicates complete fulfilment.
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityUndervaluation(e1, e2)
## S4 method for signature ## 'PiecewiseLinearFuzzyNumber,PiecewiseLinearFuzzyNumber' possibilityUndervaluation(e1, e2)
e1 |
a PiecewiseLinearFuzzyNumber |
e2 |
a PiecewiseLinearFuzzyNumber |
Returns a value from range [0,1] indicating the possibility of exceedance of e2 by e1.
DUBOIS, Didier and PRADE, Henri, 1983, Ranking Fuzzy Numbers in the Setting of Possibility Theory. Information Sciences. 1983. Vol. 30, no. 3, p. 183–224.
Other comparison-operators:
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
Other PiecewiseLinearFuzzyNumber-method:
Arithmetic
,
Extract
,
PiecewiseLinearFuzzyNumber-class
,
PiecewiseLinearFuzzyNumber
,
^,PiecewiseLinearFuzzyNumber,numeric-method
,
alphaInterval()
,
arctan2()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
,
fapply()
,
maximum()
,
minimum()
,
necessityExceedance()
,
necessityStrictExceedance()
,
necessityStrictUndervaluation()
,
necessityUndervaluation()
,
plot()
,
possibilityExceedance()
,
possibilityStrictExceedance()
,
possibilityStrictUndervaluation()
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityUndervaluation(a,b)
a <- TriangularFuzzyNumber(0.2, 1.0, 2.8) b <- TriangularFuzzyNumber(0, 1.8, 2.2) a <- as.PiecewiseLinearFuzzyNumber(a, knot.n = 9) b <- as.PiecewiseLinearFuzzyNumber(b, knot.n = 9) possibilityUndervaluation(a,b)
For convenience, objects of class PowerFuzzyNumber
may be created with this function.
PowerFuzzyNumber(a1, a2, a3, a4, p.left = 1, p.right = 1)
PowerFuzzyNumber(a1, a2, a3, a4, p.left = 1, p.right = 1)
a1 |
a number specyfing left bound of the support |
a2 |
a number specyfing left bound of the core |
a3 |
a number specyfing right bound of the core |
a4 |
a number specyfing right bound of the support |
p.left |
a positive number specyfing the exponent for the left side |
p.right |
a positive number specyfing the exponent for the right side |
Object of class PowerFuzzyNumber
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber-class
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
Bodjanova-type fuzzy numbers which sides are given by power functions
are defined using four coefficients
a1
<= a2
<= a3
<= a4
,
and parameters p.left
, p.right
>0, which determine
exponents for the side functions.
We have ,
and
.
This class is a natural generalization of trapezoidal FNs. For other see PiecewiseLinearFuzzyNumber.
a1
, a2
, a3
, a4
,
lower
, upper
, left
, right
:Inherited from the FuzzyNumber
class.
p.left
:single numeric value; 1.0 for a trapezoidal FN.
p.right
:single numeric value; 1.0 for a trapezoidal FN.
Class FuzzyNumber
, directly.
Bodjanova S. (2005), Median value and median interval of a fuzzy number, Information Sciences 172, pp. 73-89.
PowerFuzzyNumber
for a convenient constructor,
as.PowerFuzzyNumber
for conversion of objects to this class.
PowerFuzzyNumber
for a convenient constructor
Other PowerFuzzyNumber-method:
Extract
,
PowerFuzzyNumber
,
alphaInterval()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
expectedInterval()
showClass("PowerFuzzyNumber") showMethods(classes="PowerFuzzyNumber")
showClass("PowerFuzzyNumber") showMethods(classes="PowerFuzzyNumber")
See as.character
for more details.
## S4 method for signature 'FuzzyNumber' show(object)
## S4 method for signature 'FuzzyNumber' show(object)
object |
a fuzzy number |
The method as.character
is called on given fuzzy number
object with default arguments.
The results are printed on stdout
.
Does not return anything interesting.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
We have .
This gives the values that a fuzzy number possibly may represent.
## S4 method for signature 'FuzzyNumber' supp(object)
## S4 method for signature 'FuzzyNumber' supp(object)
object |
a fuzzy number |
Returns a numeric vector of length 2.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
,
width()
Other alpha_cuts:
alphacut()
,
core()
This method finds a trapezoidal approximation
of a given fuzzy number
by using the algorithm specified by the
method
parameter.
## S4 method for signature 'FuzzyNumber' trapezoidalApproximation(object, method=c("NearestEuclidean", "ExpectedIntervalPreserving", "SupportCoreRestricted", "Naive"), ..., verbose=FALSE)
## S4 method for signature 'FuzzyNumber' trapezoidalApproximation(object, method=c("NearestEuclidean", "ExpectedIntervalPreserving", "SupportCoreRestricted", "Naive"), ..., verbose=FALSE)
object |
a fuzzy number |
... |
further arguments passed to |
method |
character; one of: |
verbose |
logical; should some technical details on the computations being performed be printed? |
method
may be one of:
NearestEuclidean
: see (Ban, 2009);
uses numerical integration, see integrateAlpha
Naive
:
We have core(A)==core(T(A)) and supp(A)==supp(T(A))
ExpectedIntervalPreserving
:
L2-nearest trapezoidal approximation preserving the expected interval given in
(Grzegorzewski, 2010; Ban, 2008; Yeh, 2008)
Unfortunately, for highly skewed membership functions
this approximation operator may have
quite unfavourable behavior.
For example, if Val(A) < EV_1/3(A) or Val(A) > EV_2/3(A),
then it may happen that the core of the output
and the core of the original fuzzy number A are disjoint
(cf. Grzegorzewski, Pasternak-Winiarska, 2011)
SupportCoreRestricted
:
This method was proposed in (Grzegorzewski, Pasternak-Winiarska, 2011).
L2-nearest trapezoidal approximation with constraints
core(A) core(T(A))
and supp(T(A))
supp(A), i.e.
for which each point that surely belongs to A also belongs to T(A),
and each point that surely does not belong to A also does not belong to T(A).
Returns a TrapezoidalFuzzyNumber
object.
Ban A.I. (2008), Approximation of fuzzy numbers by trapezoidal fuzzy numbers preserving the expected interval, Fuzzy Sets and Systems 159, pp. 1327-1344.
Ban A.I. (2009), On the nearest parametric approximation of a fuzzy number - Revisited, Fuzzy Sets and Systems 160, pp. 3027-3047.
Grzegorzewski P. (2010), Algorithms for trapezoidal approximations of fuzzy numbers preserving the expected interval, In: Bouchon-Meunier B. et al (Eds.), Foundations of Reasoning Under Uncertainty, Springer, pp. 85-98.
Grzegorzewski P, Pasternak-Winiarska K. (2011), Trapezoidal approximations of fuzzy numbers with restrictions on the support and core, Proc. EUSFLAT/LFA 2011, Atlantis Press, pp. 749-756.
Yeh C.-T. (2008), Trapezoidal and triangular approximations preserving the expected interval, Fuzzy Sets and Systems 159, pp. 1345-1353.
Other approximation:
piecewiseLinearApproximation()
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
value()
,
weightedExpectedValue()
,
width()
(A <- FuzzyNumber(-1, 0, 1, 40, lower=function(x) sqrt(x), upper=function(x) 1-sqrt(x))) (TA <- trapezoidalApproximation(A, "ExpectedIntervalPreserving")) # Note that the cores are disjoint! expectedInterval(A) expectedInterval(TA)
(A <- FuzzyNumber(-1, 0, 1, 40, lower=function(x) sqrt(x), upper=function(x) 1-sqrt(x))) (TA <- trapezoidalApproximation(A, "ExpectedIntervalPreserving")) # Note that the cores are disjoint! expectedInterval(A) expectedInterval(TA)
For convenience, objects of class TrapezoidalFuzzyNumber
may be created with this function.
TrapezoidalFuzzyNumber(a1, a2, a3, a4)
TrapezoidalFuzzyNumber(a1, a2, a3, a4)
a1 |
a number specyfing left bound of the support |
a2 |
a number specyfing left bound of the core |
a3 |
a number specyfing right bound of the core |
a4 |
a number specyfing right bound of the support |
Object of class TrapezoidalFuzzyNumber
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
Trapezoidal Fuzzy Numbers have linear side functions and alpha-cut bounds.
Trapezoidal fuzzy numbers are among the simplest FNs. Despite their simplicity, however, they include triangular FNs, “crisp” real intervals, and “crisp” reals. Please note that currently no separate classes for these particular TFNs types are implemented in the package.
a1
, a2
, a3
, a4
,
lower
, upper
, left
, right
:Inherited from the FuzzyNumber
class.
Class FuzzyNumber
, directly.
TrapezoidalFuzzyNumber
for a convenient constructor,
as.TrapezoidalFuzzyNumber
for conversion of objects to this class,
and trapezoidalApproximation
for approximation routines.
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber
,
TriangularFuzzyNumber()
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
showClass("TrapezoidalFuzzyNumber") showMethods(classes="TrapezoidalFuzzyNumber")
showClass("TrapezoidalFuzzyNumber") showMethods(classes="TrapezoidalFuzzyNumber")
For convenience, objects of class TrapezoidalFuzzyNumber
may be created with this function.
TriangularFuzzyNumber(a1, amid, a4)
TriangularFuzzyNumber(a1, amid, a4)
a1 |
a number specyfing left bound of the support |
amid |
a number specyfing the core |
a4 |
a number specyfing right bound of the support |
Currently there is no separate class of a Triangular Fuzzy Number.
Object of class TrapezoidalFuzzyNumber
Other TrapezoidalFuzzyNumber-method:
Arithmetic
,
TrapezoidalFuzzyNumber-class
,
TrapezoidalFuzzyNumber
,
alphaInterval()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
expectedInterval()
,
plot()
The calculation of the so-called value is one of possible methods to deffuzify a fuzzy number.
## S4 method for signature 'FuzzyNumber' value(object, ...)
## S4 method for signature 'FuzzyNumber' value(object, ...)
object |
a fuzzy number |
... |
additional arguments passed to |
The value of (Delgrado et al, 1998) is defined as
.
Returns a single numeric value.
Delgado M., Vila M.A., Voxman W. (1998), On a canonical representation of a fuzzy number, Fuzzy Sets and Systems 93, pp. 125-135.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
weightedExpectedValue()
,
width()
Other deffuzification:
expectedValue()
,
weightedExpectedValue()
Other characteristics:
ambiguity()
,
expectedValue()
,
weightedExpectedValue()
,
width()
The calculation of the so-called weighted expected value is one of possible methods to deffuzify a fuzzy number.
For we get the ordinary
expectedValue
.
## S4 method for signature 'FuzzyNumber' weightedExpectedValue(object, w=0.5, ...)
## S4 method for signature 'FuzzyNumber' weightedExpectedValue(object, w=0.5, ...)
object |
a fuzzy number |
... |
additional arguments passed to |
w |
a single numeric value in [0,1] |
The weighted expected value of is defined as
,
where
is the
expectedInterval.
Returns a single numeric value.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
width()
Other deffuzification:
expectedValue()
,
value()
Other characteristics:
ambiguity()
,
expectedValue()
,
value()
,
width()
The width (Chanas, 2001) is a measure of nonspecificity of a fuzzy number.
## S4 method for signature 'FuzzyNumber' width(object, ...)
## S4 method for signature 'FuzzyNumber' width(object, ...)
object |
a fuzzy number |
... |
additional arguments passed to |
The width of is defined as
,
where
is the
expectedInterval
.
Returns a single numeric value.
Chanas S. (2001), On the interval approximation of a fuzzy number, Fuzzy Sets and Systems 122, pp. 353-356.
Other FuzzyNumber-method:
Arithmetic
,
Extract
,
FuzzyNumber-class
,
FuzzyNumber
,
alphaInterval()
,
alphacut()
,
ambiguity()
,
as.FuzzyNumber()
,
as.PiecewiseLinearFuzzyNumber()
,
as.PowerFuzzyNumber()
,
as.TrapezoidalFuzzyNumber()
,
as.character()
,
core()
,
distance()
,
evaluate()
,
expectedInterval()
,
expectedValue()
,
integrateAlpha()
,
piecewiseLinearApproximation()
,
plot()
,
show()
,
supp()
,
trapezoidalApproximation()
,
value()
,
weightedExpectedValue()
Other characteristics:
ambiguity()
,
expectedValue()
,
value()
,
weightedExpectedValue()