# combine: Combining Basic Probability Assignments In MuViCP: MultiClass Visualizable Classification using Combination of Projections

## 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

 ``` 1 2 3 4 5 6 7 8 9 10``` ```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.

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

 ``` 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``` ```##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 ```

### Example output

``` 9.806945e-01 2.025944e-04 3.592420e-11 1.910287e-02
1          2          3        Inf
0.65668753 0.01941450 0.01737956 0.30651841
 9.401782e-01 2.197409e-06 1.459460e-07 5.981945e-02
1           2           3         Inf
0.257010957 0.009741922 0.070416840 0.662830281
 6.856710e-01 2.655690e-01 1.123313e-12 4.875991e-02
1            2            3          Inf
2.401687e-01 1.348855e-01 3.239186e-05 6.249135e-01
 0.96308857 0.01079173 0.00651074 0.01960897
1          2          3        Inf
0.63276650 0.03219780 0.01500649 0.32002921
```

MuViCP documentation built on May 1, 2019, 7:56 p.m.