Learn R Programming

SAFD (version 0.3)

DShistogram: 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

DShistogram(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

Value

  • If the input data is in the correct form the function returns a list with the following elements:
  • gridxx-grid for plotting the histogram
  • gridyy-grid for plotting the histogram
  • Mvalues of the histogram as function on the grid
  • breaksbreaks of the histogram

Details

See examples

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 DSfrequency

Examples

Run this code
#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<-vector("list",length=300)
for (j in 1:300){
 SS[[j]]<-generator(V2,)
 }
A<-DShistogram(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<-vector("list",length=300)
for (j in 1:300){
 SS[[j]]<-generator(V2,pertV,)
 }
A<-DShistogram(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<-vector("list",length=1000)
#for (j in 1:1000){
# SS[[j]]<-generator(V2,pertV,pertL,)
# }
#A<-DShistogram(SS,,npart=15,nl=51)

Run the code above in your browser using DataLab