histogram {SAFD}R Documentation

Levelwise Dempster-Shafer Histogram

Description

Based on a sample XX of polygonal fuzzy numbers (tested by checking), a chosen interval limx, a chosen number npart of partitions elements and a chosen number nl of equidistant alpha-levels the levelwise Dempster-Shafer frequency for each partition element is calculated. If pic=TRUE then a 3d plot as well as an image-plot of the histogram is produced. In case of pdf=TRUE a pdf containing these plots is produced automatically.

Usage

histogram(XX, limx = NA, npart = 10, nl = 101, pic = TRUE, pdf = FALSE)

Arguments

XX ...list of polygonal fuzzy numbers (the function implicitly checks the conditions)
limx ...numeric vector of length two, by default limx=c(0,1), that determines the x-range for which the histogram is plotted
npart ...integer, number of partitions elements
nl ...number of equidistant alpha-level, by default nl=101
pic ...if pic=1, a 3d- and an image-plot of the histogram is produced
pdf ...if pdf=1, a 3d- and an image-plot of the histogram is automatically exported as pdf, by default pdf=FALSE

Details

See examples

Value

If the input data is in the correct form the function returns a list with the following elements:

gridx x-grid for plotting the histogram
gridy y-grid for plotting the histogram
M values of the histogram as function on the grid
breaks breaks of the histogram

Note

Speed to be improved in future versions of the package,
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@softcomputing.es>, Asun Lubiano <lubiano@uniovi.es>

References

[1] Trutschnig, W., A strong consistency result for fuzzy relative frequencies interpreted as estimator for the fuzzy-valued probability, Fuzzy Sets and Systems, Vol. 159, nr 3, pp. 259-269 (2008)
[2] Viertl, R., Hareter, D.: Beschreibung und Analyse unscharfer Information: Statistische Methoden fuer unscharfe Daten, Springer Wien New York, 2006

See Also

See Also as frequency

Examples

#an example with a random variable with small spread of the expectation
#run for bigger sample size and finer partition
data(XX)
V<-translator(XX[[3]],30)
V2<-V
V2$x<-V$x/5
SS<-list(length=300)
for (j in 1:300){
 SS[[j]]<-generator(V2,)
 }
A<-histogram(SS,c(-3,3),npart=6,nl=51)

#run for bigger sample size and finer partition
data(XX)
V<-translator(XX[[3]],30)
V2<-V
V2$x<-V$x/10
pertV<-list(dist="unif",par=c(-2,2))
SS<-list(length=300)
for (j in 1:300){
 SS[[j]]<-generator(V2,pertV,)
 }
A<-histogram(SS,,npart=5,nl=51)

#takes some time but produces nice result
#data(XX)
#V<-translator(XX[[3]],30)
#V2<-V
#V2$x<-V$x/10
#pertV<-list(dist="unif",par=c(-2,2))
#pertL<-list(dist="lnorm",par=c(-2,2))
#SS<-list(length=1000)
#for (j in 1:1000){
# SS[[j]]<-generator(V2,pertV,pertL,)
# }
#A<-histogram(SS,,npart=15,nl=51)

[Package SAFD version 0.02 Index]