hukuhara: Hukuhara Difference

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Given two polygonal fuzzy numbers the functions calculates the Hukuhara difference Y-X if it exists. First the input data is tested for having the correct format using the function checking. If the Hukuhara difference exists and pic=1 then the input and the Hukuhara difference is plotted, otherwise no plot is produced.

Usage

1
hukuhara(X, Y, pic = 0)

Arguments

X

...polygonal fuzzy number (tested by checking)

Y

...polygonal fuzzy number (tested by checking)

pic

...numeric, if pic=1 then X, Y and Y-X (if existing) is plotted

Details

See examples

Value

In case the input data is in the correct form and the Hukuhara difference exists, the Hukuhara difference is returned, in case not, NULL is returned.

Note

In case you find (almost surely existing) bugs or have recommendations for improving the functions comments are welcome to the above mentioned mail addresses.

Author(s)

Wolfgang Trutschnig <wolfgang@trutschnig.net>, Asun Lubiano <lubiano@uniovi.es>

See Also

See Also as checking, Msum

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Example 1:
Y<-data.frame(x=c(0,0,0,1,2,2),alpha=c(0,0.5,1,1,0.5,0))
X<-data.frame(x=c(0,0,0,0,1.5,2),alpha=c(0,0.5,1,1,0.5,0))
Z<-data.frame(x=c(0,0,0,0.75,1.5,1.5),alpha=c(0,0.5,1,1,0.5,0))
h1<-hukuhara(X,Y,1)
h1
h2<-hukuhara(Z,Y,1)
h2

#Example 2: in this case the hukuhara diff has to exist by construction
data(XX)
X<-translator(XX[[1]],50)
shift<-seq(-1,1,length=100)
Y<-X
Y$x<-X$x+shift
h<-hukuhara(X,Y,1)

Example output

[1] "Hukuhara difference Y-X does not exist"
NULL
     x alpha
1 0.00   0.0
2 0.00   0.5
3 0.00   1.0
4 0.25   1.0
5 0.50   0.5
6 0.50   0.0

SAFD documentation built on July 3, 2019, 5:02 p.m.