Title: | Belief Function Implementation |
---|---|
Description: | Some basic functions to implement belief functions including: transformation between belief functions using the method introduced by Philippe Smets <arXiv:1304.1122>, evidence combination, evidence discounting, decision-making, and constructing masses. Currently, thirteen combination rules and six decision rules are supported. It can also be used to generate different types of random masses when working on belief combination and conflict management. |
Authors: | Kuang Zhou <[email protected]>; Arnaud Martin <[email protected]> |
Maintainer: | Kuang Zhou <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3.1 |
Built: | 2024-12-13 06:36:38 UTC |
Source: | CRAN |
Computing the table of conflict for masses and
classes.
This function gives the conflict focal set combinations for the
masses. The focal sets are labeled in natural order, e.g,
number 2 denotes
, and number 4 donoets
if the discernment frame is
. Note that only one case of
conflict is given. For example, if expert 1 says 3, and expert 2 says 2 the function returns
matrix(c(2,3),,1)
and if expert 1 says 2, and expert 2 says 3 the function also returns matrix(c(2,3),,1)
.
ConflictTable(lm, nbexperts)
ConflictTable(lm, nbexperts)
lm |
The length of the power set of the discernment frame, i.e., |
nbexperts |
The number of experts (masses) |
Matrix with rows and number of conflict focal set combinations columns.
## The conflict table for two experts in a discernment frame with three elements ConflictTable(2^3,2) ##The conflict table for three experts in a discernment frame with four elements ConflictTable(2^4,3)
## The conflict table for two experts in a discernment frame with three elements ConflictTable(2^3,2) ##The conflict table for three experts in a discernment frame with four elements ConflictTable(2^4,3)
Different rules for making decisions in the framework of belief functions
decisionDST(mass, criterion, r = 0.5, sDec = 1:nrow(mass), D = Dcalculus(nrow(mass)))
decisionDST(mass, criterion, r = 0.5, sDec = 1:nrow(mass), D = Dcalculus(nrow(mass)))
mass |
The matrix containing the masses. Each column represents a piece of mass. |
criterion |
The decision baseline: criterion=1 maximum of the plausibility criterion=2 maximum of the credibility criterion=3 maximum of the credibility with rejection criterion=4 maximum of the pignistic probability criterion=5 Appriou criterion (decision onto criterion=6 Distance criterion (decision onto a given subset (sDec) of |
r |
The parameter in BayesianMass function. If criterion 5 is used, it should be given. Otherwise it will be set to the default value 0.5. |
sDec |
The parameter for the set on which we want to decide. It should be a subset of {1,2,3,..., |
D |
The parameter for the used matrix in Jousselme distance. If criterion 6 is used, it should be given. Otherwise it will be set as default Otherwise it will be calculated. |
The decision vector. E.g., in classification problem, class labels.
m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); m3=c(0.1,0.2, 0, 0.1, 0.1, 0.1, 0, 0.3); m3d=discounting(m3,0.95); M_comb_Smets=DST(cbind(m1,m2,m3d),1); M_comb_PCR6=DST(cbind(m1,m2),8); class_fusion=decisionDST(M_comb_Smets,1) class_fusion=decisionDST(M_comb_PCR6,1) class_fusion=decisionDST(M_comb_Smets,5,0.5) class_fusion=decisionDST(cbind(M_comb_Smets,M_comb_PCR6),1) sDec<-c(2,3,4) class_fusion=decisionDST(M_comb_Smets,6, sDec = sDec)
m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); m3=c(0.1,0.2, 0, 0.1, 0.1, 0.1, 0, 0.3); m3d=discounting(m3,0.95); M_comb_Smets=DST(cbind(m1,m2,m3d),1); M_comb_PCR6=DST(cbind(m1,m2),8); class_fusion=decisionDST(M_comb_Smets,1) class_fusion=decisionDST(M_comb_PCR6,1) class_fusion=decisionDST(M_comb_Smets,5,0.5) class_fusion=decisionDST(cbind(M_comb_Smets,M_comb_PCR6),1) sDec<-c(2,3,4) class_fusion=decisionDST(M_comb_Smets,6, sDec = sDec)
Discount masses using given factors
discounting(MassIn, alpha)
discounting(MassIn, alpha)
MassIn |
Matrix with |
alpha |
Discounting factor. A number or a vector with length of |
Mass matrix with the same dimension as MassIn. The discounted masses, each column is a piece of mass. If the input is a vector, the output is also a vector.
## The conflict table for two experts in a discernment frame with three elements m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); discounting(m1,0.95) # if only one factor is given, all the masses are discounted using the same factor discounting(cbind(m1,m2),0.95) # if the factor vector is given, the masses are discounted using the corresponding factor discounting(cbind(m1,m2),c(0.95,0.9))
## The conflict table for two experts in a discernment frame with three elements m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); discounting(m1,0.95) # if only one factor is given, all the masses are discounted using the same factor discounting(cbind(m1,m2),0.95) # if the factor vector is given, the masses are discounted using the corresponding factor discounting(cbind(m1,m2),c(0.95,0.9))
Different rules to combine masses
DST(MassIn, criterion, TypeSSF = 0)
DST(MassIn, criterion, TypeSSF = 0)
MassIn |
The matrix containing the masses. Each column represents a piece of mass. |
criterion |
The combination criterion: criterion=1 Smets criterion (conjunctive combination rule) criterion=2 Dempster-Shafer criterion (normalized) criterion=3 Yager criterion criterion=4 Disjunctive combination criterion criterion=5 Dubois criterion (normalized and disjunctive combination) criterion=6 Dubois and Prade criterion (mixt combination), only for Bayesian masses whose focal elements are singletons criterion=7 Florea criterion criterion=8 PCR6 criterion=9 Cautious Denoeux Min for functions non-dogmatics criterion=10 Cautious Denoeux Max for separable masses criterion=11 Hard Denoeux for functions sub-normal criterion=12 Mean of the bbas criterion=13 LNS rule, for separable masses criterion=131 LNSa rule, for separable masses |
TypeSSF |
The parameter of LNS rule (criterion = 13) and LNSa rule (criterion = 131). If TypeSSF = 0, it is not a SSF, the general case. If TypeSSF = 1, a SSF with a singleton as a focal element. If TypeSSF = 2, a SSF with any subset of |
The combined mass vector. One column.
m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); m3=c(0.1,0.2, 0, 0.1, 0.1, 0.1, 0, 0.3); m3d=discounting(m3,0.95); M_comb_Smets=DST(cbind(m1,m2,m3d),1); M_comb_Smets M_comb_PCR6=DST(cbind(m1,m2),8); M_comb_PCR6 M_comb_LNS = DST(cbind(m1,m2),13); M_comb_LNS M_comb_LNSa = DST(cbind(m1,m2),131); M_comb_LNSa n1 = 5 ThetaSize = 3 mass_mat = matrix(0, 2^ThetaSize, n1 + 1); mass_mat[2, 1 : n1] = c(0.12, 0.16, 0.15, 0.11, 0.14) mass_mat[3, n1 + 1] = 0.95; mass_mat[8, ] = 1 - colSums(mass_mat) mass_ssf_mat = mass_mat[c(2^(1:ThetaSize-1)+1, 8), ] # the following three functions could produce the same results DST(mass_mat, 13) DST(mass_mat, 13, TypeSSF = 2) DST(mass_ssf_mat, 13, TypeSSF = 1)
m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); m3=c(0.1,0.2, 0, 0.1, 0.1, 0.1, 0, 0.3); m3d=discounting(m3,0.95); M_comb_Smets=DST(cbind(m1,m2,m3d),1); M_comb_Smets M_comb_PCR6=DST(cbind(m1,m2),8); M_comb_PCR6 M_comb_LNS = DST(cbind(m1,m2),13); M_comb_LNS M_comb_LNSa = DST(cbind(m1,m2),131); M_comb_LNSa n1 = 5 ThetaSize = 3 mass_mat = matrix(0, 2^ThetaSize, n1 + 1); mass_mat[2, 1 : n1] = c(0.12, 0.16, 0.15, 0.11, 0.14) mass_mat[3, n1 + 1] = 0.95; mass_mat[8, ] = 1 - colSums(mass_mat) mass_ssf_mat = mass_mat[c(2^(1:ThetaSize-1)+1, 8), ] # the following three functions could produce the same results DST(mass_mat, 13) DST(mass_mat, 13, TypeSSF = 2) DST(mass_ssf_mat, 13, TypeSSF = 1)
Use the Fast Mobius Transformation to convert one measure to another one
beltob(InputVec) beltom(InputVec) beltopl(InputVec) beltoq(InputVec) btobel (InputVec) btom(InputVec) btopl (InputVec) btoq (InputVec) btov(InputVec) mtob (InputVec) mtobel(InputVec) mtobetp(InputVec) mtonm(InputVec) mtopl(InputVec) mtoq (InputVec) mtov (InputVec) mtow (InputVec) pltob(InputVec) pltobel(InputVec) pltom(InputVec) pltoq (InputVec) qtom (InputVec) qtow(InputVec) vtob(InputVec) vtom (InputVec) wtom (InputVec) wtoq(InputVec)
beltob(InputVec) beltom(InputVec) beltopl(InputVec) beltoq(InputVec) btobel (InputVec) btom(InputVec) btopl (InputVec) btoq (InputVec) btov(InputVec) mtob (InputVec) mtobel(InputVec) mtobetp(InputVec) mtonm(InputVec) mtopl(InputVec) mtoq (InputVec) mtov (InputVec) mtow (InputVec) pltob(InputVec) pltobel(InputVec) pltom(InputVec) pltoq (InputVec) qtom (InputVec) qtow(InputVec) vtob(InputVec) vtom (InputVec) wtom (InputVec) wtoq(InputVec)
InputVec |
the measure to transform, e.g., mass, bel function, plausibility function, etc. |
The associated converted new measure
Mass=RandomMass(nbFocalElement=3, ThetaSize=3, nbMass=4, Type=1) mass=mtobel(Mass) qvec=mtoq(mass) mass=qtom(qvec)
Mass=RandomMass(nbFocalElement=3, ThetaSize=3, nbMass=4, Type=1) mass=mtobel(Mass) qvec=mtoq(mass) mass=qtom(qvec)
Least-Committed Principle for creating bbas
LCPrincple(Mat)
LCPrincple(Mat)
Mat |
matrix, |
mass_bba matrix, , each column is a bba. If there is only one source, the output is a bba vector.
pro1 = c(0.25, 0.25, 0.25, 0.25); pro2 = c(0.3, 0.2, 0.2, 0.1); pro3 = rbind(pro1, pro2); LCPrincple(pro1) LCPrincple(pro2) LCPrincple(pro3)
pro1 = c(0.25, 0.25, 0.25, 0.25); pro2 = c(0.3, 0.2, 0.2, 0.1); pro3 = rbind(pro1, pro2); LCPrincple(pro1) LCPrincple(pro2) LCPrincple(pro3)
PCR6 combination rule
PCR6(MassIn, TabConflict)
PCR6(MassIn, TabConflict)
MassIn |
Matrix with |
TabConflict |
The conflict table, which can be got using the function |
Two parts:
Mass |
matrix with |
conf |
a number, total conflict |
## The conflict table for two experts in a discernment frame with three elements TabConflict=ConflictTable(2^3,2) m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); PCR6(cbind(m1,m2),TabConflict)
## The conflict table for two experts in a discernment frame with three elements TabConflict=ConflictTable(2^3,2) m1=c(0,0.4, 0.1, 0.2, 0.2, 0, 0, 0.1); m2=c(0,0.2, 0.3, 0.1, 0.1, 0, 0.2, 0.1); PCR6(cbind(m1,m2),TabConflict)
Different ways to generate masses
RandomMass(nbFocalElement, ThetaSize, nbMass, Type, singleton, Include)
RandomMass(nbFocalElement, ThetaSize, nbMass, Type, singleton, Include)
nbFocalElement |
The number of focal elements |
ThetaSize |
The length of the discernment frame |
nbMass |
The number of masses to generate |
Type |
Which kind of mass to generate: Type=1 for focal elements can be everywhere Type=2 for focal elements can not be on the emptyset Type=3 for no dogmatic mass : one focal element is on Type=4 for no dogmatic mass : one focal element is on Type=5 for all the focal elements are the singletons Type=6 for all the focal elements are the singletons and on Type=7 for all the focal elements are the singletons and on Type=8 On only one defined singleton, on Type=9 On one defined singleton, on other singletons and on Type=10 On one focal element contain a defined singleton, on other focal elements and on Type=11 On one focal element contain a defined singleton, on other focal elements (not emptyset) and on
Type=12 For consonant bba with nested focal elements, all of them contain a defined singleton. If parameter singleton is set to 0, the defined singleton can be any one of the element in the discernment framework. Note that the defined singleton may not be one of the focal elements. Type=13 For non-dogmatic consonant bba with nested focal elements, all of them contain a defined singleton. Different from Type 12, the mass given to Type=14 For non-dogmatic consonant bba with nested focal elements, all of them contain a defined singleton. The focal elements must contain the defined sigleton and Type=15 Random SSFs with Include and |
singleton |
The singleton element (with only one element) in the focal sets. It should be given a number from 1 to |
Include |
The natrual id of the focal element (not |
The generated mass matrix. Each column represents a piece of mass
RandomMass(nbFocalElement=3, ThetaSize=3, nbMass=4, Type=1) RandomMass(nbFocalElement=3, ThetaSize=4, nbMass=4, Type=3) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=5,singleton=2) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=10,singleton=2) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=13,singleton=2) RandomMass(nbFocalElement=2, ThetaSize=4, nbMass=4, Type=14,singleton=2) RandomMass(ThetaSize=4, nbMass=4, Type=15, Include=2)
RandomMass(nbFocalElement=3, ThetaSize=3, nbMass=4, Type=1) RandomMass(nbFocalElement=3, ThetaSize=4, nbMass=4, Type=3) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=5,singleton=2) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=10,singleton=2) RandomMass(nbFocalElement=4, ThetaSize=4, nbMass=4, Type=13,singleton=2) RandomMass(nbFocalElement=2, ThetaSize=4, nbMass=4, Type=14,singleton=2) RandomMass(ThetaSize=4, nbMass=4, Type=15, Include=2)