Package 'ibelief'

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

Help Index


Computing the conflict table

Description

Computing the table of conflict for nbexpertsnbexperts masses and natoms=round(log2(lm))natoms = round(\log2(lm)) classes. This function gives the conflict focal set combinations for the nbexpertsnbexperts masses. The focal sets are labeled in natural order, e.g, number 2 denotes ω1\omega_1, and number 4 donoets {ω1,ω2}\{\omega_1,\omega_2\} if the discernment frame is {ω1,ω2,,ωn}\{\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., 2natoms2^{natoms}

nbexperts

The number of experts (masses)

Value

Matrix with nbexpertsnbexperts rows and number of conflict focal set combinations columns.

See Also

PCR6, decisionDST

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)

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 2Θ2^\Theta)

criterion=6 Distance criterion (decision onto a given subset (sDec) of 2Θ2^\Theta)

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,...,2n2^n}, where nn is the number of elements in Θ\Theta. If criterion 6 is used, it should be given; Otherwise it will be set as the default value 2Θ2^\Theta.

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 nbnb columns and 2n2^n rows. Parameter nn is the number of elements in the discernment frame and nbnb is the number of experts. Each column is a bba. If there is only one bba, the input could be a vector with length 2n2^n.

alpha

Discounting factor. A number or a vector with length of ncol(MassIn). If it is a number, all the bbas will be discounted using the same factor. If it is a vector with length ncol{MassIn}, the bbas will be discounted using the corresponding factor.

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

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 Θ\Theta as a focal element.

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, m×km \times k, mm is the number of sources, kk is the length of probability vectors. If the number of sources is 1, the input probability could be a vector.

Value

mass_bba matrix, m×2km \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 2n2^n rows and nbnb columns. Parameter nn is the number of classes (or the length of discernment frame) and nbnb is the number of experts.

TabConflict

The conflict table, which can be got using the function ConflictTableConflictTable

Value

Two parts:

Mass

matrix with 2n2^n rows and one column, the combined mass

conf

a number, total conflict

See Also

ConflictTable, decisionDST

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 Θ\Theta

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 Θ\Theta (ignorance)

Type=4 for no dogmatic mass : one focal element is on Θ\Theta (ignorance) and no focal elements are on the emptyset

Type=5 for all the focal elements are the singletons

Type=6 for all the focal elements are the singletons and on Θ\Theta (ignorance)

Type=7 for all the focal elements are the singletons and on Θ\Theta (ignorance), but not on all the singletons

Type=8 On only one defined singleton, on Θ\Theta (ignorance), and others

Type=9 On one defined singleton, on other singletons and on Θ\Theta (ignorance)

Type=10 On one focal element contain a defined singleton, on other focal elements and on Θ\Theta (ignorance)

Type=11 On one focal element contain a defined singleton, on other focal elements (not emptyset) and on Θ\Theta (ignorance)

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 Θ\Theta must be positive (non-dogmatic). If parameter singleton is set to 0, the defined sigleton can be any one of the element in the discernment framework. Note that the defined singleton is one of the focal elements.

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 Θ\Theta. If parameter singleton is set to 0, the defined sigleton can be any one of the element in the discernment framework. Note that the difined singleton may not be the focal elements.

Type=15 Random SSFs with Include and Θ\Theta as focal elements. Generally, parameter Include shoud have the same length as nbMass. If the lenght of parameter Include is 1, all the random masses have the same focal elements. If Include is missing, then the focal element (except Θ\Theta) could be randomly set to be any subset of Θ\Theta except the empty set and the total ignorance.

singleton

The singleton element (with only one element) in the focal sets. It should be given a number from 1 to ThetaSizeThetaSize if Type is from 5 to 11.

Include

The natrual id of the focal element (not Θ\Theta) of SSFs

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)