Type: | Package |
Title: | Belief Function Implementation |
Version: | 1.3.1 |
Author: | Kuang Zhou <kzhoumath@163.com>; Arnaud Martin <arnaud.martin@univ-rennes1.fr> |
Maintainer: | Kuang Zhou <kzhoumath@163.com> |
Description: | Some basic functions to implement belief functions including: transformation between belief functions using the method introduced by Philippe Smets <doi:10.48550/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. |
LazyData: | FALSE |
Depends: | R (≥ 3.2.1) |
Imports: | stats |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Packaged: | 2021-01-06 02:25:35 UTC; zhoukuang |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2021-01-07 01:30:02 UTC |
RoxygenNote: | 6.1.1 |
Computing the conflict table
Description
Computing the table of conflict for nbexperts
masses and natoms = round(\log2(lm))
classes.
This function gives the conflict focal set combinations for the nbexperts
masses. The focal sets are labeled in natural order, e.g,
number 2 denotes \omega_1
, and number 4 donoets \{\omega_1,\omega_2\}
if the discernment frame is \{\omega_1,\omega_2,\ldots,\omega_n\}
. 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)
.
Usage
ConflictTable(lm, nbexperts)
Arguments
lm |
The length of the power set of the discernment frame, i.e., |
nbexperts |
The number of experts (masses) |
Value
Matrix with nbexperts
rows and number of conflict focal set combinations columns.
See Also
Examples
## 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)
Combination rules
Description
Different rules to combine masses
Usage
DST(MassIn, criterion, TypeSSF = 0)
Arguments
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 |
Value
The combined mass vector. One column.
Examples
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)
Fast Mobius Transform
Description
Use the Fast Mobius Transformation to convert one measure to another one
Usage
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)
Arguments
InputVec |
the measure to transform, e.g., mass, bel function, plausibility function, etc. |
Value
The associated converted new measure
Examples
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
Description
Least-Committed Principle for creating bbas
Usage
LCPrincple(Mat)
Arguments
Mat |
matrix, |
Value
mass_bba matrix, m \times 2^k
, each column is a bba. If there is only one source, the output is a bba vector.
Examples
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 rule
Description
PCR6 combination rule
Usage
PCR6(MassIn, TabConflict)
Arguments
MassIn |
Matrix with |
TabConflict |
The conflict table, which can be got using the function |
Value
Two parts:
Mass |
matrix with |
conf |
a number, total conflict |
See Also
Examples
## 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)
Generating masses
Description
Different ways to generate masses
Usage
RandomMass(nbFocalElement, ThetaSize, nbMass, Type, singleton, Include)
Arguments
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 |
Value
The generated mass matrix. Each column represents a piece of mass
Examples
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)
Decision Rules
Description
Different rules for making decisions in the framework of belief functions
Usage
decisionDST(mass, criterion, r = 0.5, sDec = 1:nrow(mass),
D = Dcalculus(nrow(mass)))
Arguments
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. |
Value
The decision vector. E.g., in classification problem, class labels.
Examples
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)
Discounting masses
Description
Discount masses using given factors
Usage
discounting(MassIn, alpha)
Arguments
MassIn |
Matrix with |
alpha |
Discounting factor. A number or a vector with length of |
Value
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.
Examples
## 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))