Description Usage Arguments Value Author(s) Examples
To determining the support of a LR fuzzy number one can use from this function.
In other words, the support
function is able to compute the smallest and biggest values x for which μ(x)>0.
1 |
M |
A LR, RL or L fuzzy number |
Left.fun |
The left-shape function which usually defined before using LRFN.plot (see examples in bellow) |
Right.fun |
The right-shape function which usually defined before using LRFN.plot (see examples in bellow) |
The "support" function return a interval-valued vector in which the membership function value of LR fuzzy number is bigger than zero.
Abbas Parchami
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | Left.fun = function(x) { (1-x)*(x>=0)}
Right.fun = function(x) { (exp(-x))*(x>=0)}
T = LR(1, 0.6, 0.2)
support(T)
LRFN.plot( T, xlim=c(-5,20), lwd=2, lty=3, col=4)
N = RL(3, 0.5, 2)
support(N)
Left.fun = function(x) { (1-x)*(x>=0)}
M = L(2,4,3)
support(M)
Left.fun = function(x) { (1-x^2)*(x>=0)}
Right.fun = function(x) { (exp(-x))*(x>=0)}
support( LR(17,5,3))
## The function is currently defined as
function (M, Left.fun = NULL, Right.fun = NULL)
{
range1 = M[1] - M[2] - M[3] - 100
range2 = M[1] + M[2] + M[3] + 100
x = seq(range1, range2, len = 2e+05)
if (M[4] == 0) {
y = Left.fun((M[1] - x)/M[2]) * (x <= M[1]) + Right.fun((x -
M[1])/M[3]) * (M[1] < x)
}
else if (M[4] == 1) {
y = Right.fun((M[1] - x)/M[2]) * (x <= M[1]) + Left.fun((x -
M[1])/M[3]) * (M[1] < x)
}
else if (M[4] == 0.5) {
y = Left.fun((M[1] - x)/M[2]) * (x <= M[1]) + Left.fun((x -
M[1])/M[3]) * (M[1] < x)
}
supp = c()
supp[1] = min(x[0 < y & y < 1])
supp[2] = max(x[0 < y & y < 1])
if (supp[1] == min(x)) {
supp[1] = -Inf
}
if (supp[2] == max(x)) {
supp[2] = +Inf
}
return(supp)
}
|
Attaching package: 'Calculator.LR.FNs'
The following object is masked from 'package:base':
sign
[1] 0.400741 Inf
[1] -Inf 4.999272
[1] -1.999145 4.999760
[1] 12.00012 Inf
function (M, Left.fun = NULL, Right.fun = NULL)
{
range1 = M[1] - M[2] - M[3] - 100
range2 = M[1] + M[2] + M[3] + 100
x = seq(range1, range2, len = 2e+05)
if (M[4] == 0) {
y = Left.fun((M[1] - x)/M[2]) * (x <= M[1]) + Right.fun((x -
M[1])/M[3]) * (M[1] < x)
}
else if (M[4] == 1) {
y = Right.fun((M[1] - x)/M[2]) * (x <= M[1]) + Left.fun((x -
M[1])/M[3]) * (M[1] < x)
}
else if (M[4] == 0.5) {
y = Left.fun((M[1] - x)/M[2]) * (x <= M[1]) + Left.fun((x -
M[1])/M[3]) * (M[1] < x)
}
supp = c()
supp[1] = min(x[0 < y & y < 1])
supp[2] = max(x[0 < y & y < 1])
if (supp[1] == min(x)) {
supp[1] = -Inf
}
if (supp[2] == max(x)) {
supp[2] = +Inf
}
return(supp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.