combine.ds {MuViCP}R Documentation

Combining Basic Probability Assignments

Description

These functions can be used to combine one or several basic probability assignments (bpa). In the limited context that we support here, a bpa is nothing but a discrete distribution, that may have an additional mass for ignorance.

The suffix tells how the combination will be done : ds denotes that the Dempster-Shafer rules will be used, bs denotes that Bayes' rule will be used. Thus the function combine.ds combines two numeric vectors by Dempster-Shafer rules.

The first middle denotes what kind of object a function operates on. Thus combine.bpa.ds combines two bpa objects by Dempster-Shafer rules, while combine.bpamat.ds does the same for two bpamat objects.

Finally, the second middle may be used - if set to list, it combines lists of objects. Thus, the function combine.bpa.list.ds combines lists of bpa objects by Dempster-Shafer rules.

Usage

combine.bs(x, y)
combine.ds(x, y)
combine.bpa.bs(b1, b2)
combine.bpa.ds(b1, b2)
combine.bpa.list.bs(blist)
combine.bpa.list.ds(blist)
combine.bpamat.bs(bmat1, bmat2)
combine.bpamat.ds(bmat1, bmat2)
combine.bpamat.list.bs(bmatlist)
combine.bpamat.list.ds(bmatlist)

Arguments

x

A numeric vector representing a bpa.

y

A numeric vector representing a bpa.

b1

The first bpa object that needs to be combined.

b2

The second bpa object that needs to be combined.

blist

A list of bpa's to be be combined.

bmat1

The first bpa matrix that needs to be combined.

bmat2

The second bpa matrix that needs to be combined.

bmatlist

A list of bpa matrices to be be combined.

Value

The combine.ds functions returns a numeric vector representing the new bpa.

The combine.bpamat.bs, combine.bpamat.ds, combine.bpamat.list.bs and combine.bpamat.list.bs functions themselves returns a bpamat object.

The combine.bpa.bs, combine.bpa.ds, combine.bpa.list.bs and the combine.bpa.list.ds functions themselves returns a bpa object.

Author(s)

Mohit Dayal

References

Gordon, J. and Shortliffe, E. H. (1984). The dempster-shafer theory of evidence. Rule-Based Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project, 3:832-838. Shafer, G. (1986). The combination of evidence. International Journal of Intelligent Systems, 1(3):155-179.

Examples

##Very Strong, Consistent Testimony
vstrong <- c(0.85, 0.07, 0.08)
##Strong, Consistent Testimony
strong <- c(0.7, 0.15, 0.15)
##Somewhat Ambiguous Testimony
amb <- c(0.55, 0.40, 0.05)
##More Diffuse Testimony
amb2 <- c(0.55, 0.20, 0.25)

fn_gen <- function(par)
{
    x <- gtools::rdirichlet(2, par)
    y <- x
    y <- t(apply(y, MARGIN = 1, FUN = function(x) x * 0.9))
    y <- cbind(y, 0.1)
    return(y)
}

a1 <- fn_gen(vstrong)
combine.bs(a1[1,], a1[2,])
combine.ds(a1[1,], a1[2,])

a2 <- fn_gen(strong)
combine.bs(a2[1,], a2[2,])
combine.ds(a2[1,], a2[2,])

a3 <- fn_gen(amb)
combine.bs(a3[1,], a3[2,])
combine.ds(a3[1,], a3[2,])

a4 <- fn_gen(amb2)
combine.bs(a4[1,], a4[2,])
combine.ds(a4[1,], a4[2,])

##For bpa or bpamat examples, see the relevant help files

[Package MuViCP version 1.3.2 Index]