\section{Subjective Logic}
\label{sec:sl}


\textbf{Subjective logic extends traditional probabilistic logic by including uncertainty with opinions}

\ac{sl}~\cite{josang2016subjective} is a mathematical framework for logical reasoning that accommodates uncertainty through subjective opinions. \ac{sl} integrates probabilistic logic with \ac{dst} of evidence~\cite{shafer1992dempster}, enabling the representation of uncertainty in real-world scenarios and trust modeling in distributed systems. It facilitates trustworthiness evaluations via a probabilistic epistemic logic.

\ac{sl} finds utility in modeling situations fraught with uncertainty and unreliable sources, where subjective opinions can convey trust or belief in events and propositions. In essence, \ac{sl} serves as a versatile calculus for reasoning under uncertainty, offering a nuanced approach to probabilistic reasoning by incorporating subjective perspectives on belief and uncertainty.

\subsection{Subjective Opinion}

Within \ac{sl}, subjective opinions serve as expressions of probabilities influenced by varying degrees of uncertainty. This enriched probabilistic logic framework allows for the explicit inclusion of uncertainty and subjective belief ownership, enabling the expression of confidence or doubt in beliefs. Opinions in \ac{sl} can be likened to Dirichlet and Beta probability density functions under specific mapping.

In \ac{sl} a domain represents the set of all possible outcomes or states that a variable can have. The cardinality \( k \) refers to the number of possible outcomes or states within a domain.


\begin{definition}\label{def:bin_op}
(Binomial Opinion~\cite{josang2016subjective}).
A binary domain has exactly two values, and for example can be denoted by \(\mathbb{X} = \{x, \overline{x} \}\). And let \( X \in \mathbb{X}\) be a random variable.

A binary domain is used when modelling a situation that can have only two possible outcomes. It has cardinality  \( k = 2 \). An example of such a situation can be the outcome of flipping a coin, where the outcome can either be heads or tails. In this scenario, if \( x \) represents heads is TRUE, then \( \overline{x} \) represents tails being TRUE (alternatively heads being FALSE). Also, if \( X = x \), this means that \( X \) has the value \( x \), so heads is TRUE.

The binomial opinion regarding the truth of \( x \) is represented as a tuple of four values \( \omega_{x} = (b_{x}, d_{x}, u_{x}, a_{x}) \), \( \forall b_{x}, d_{x}, u_{x}, a_{x} \in [0, 1]\) where:

\( b_{x} \): represents belief mass distribution - degree of belief that the outcome is heads (i.e \( X = x \))

\( d_{x} \): represents disbelief mass distribution - degree of belief that the outcome is tails (i.e \( X = \overline{x} \))

\( u_{x} \): represents uncertainty mass - uncertainty about the outcome of the coin toss.

\( a_{x} \):  represents base rate - it signifies the prior probability on the outcome of the coin flip resulting in heads or tails without any evidence. For a fair coin, \( a_{x} \) can be assigned a value of 0.5, with equal probability of each outcome occurring.

With the additivity requirement:

\begin{equation}
b_{x} + d_{x} + u_{x} = 1
\label{eq:add_req}
\end{equation}

The projected probability of a binomial opinion concerning value \( x \) is defined by

\begin{equation}
P(x) = b_{x} + a_{x} u_{x}
\label{eq:bin_prob}
\end{equation}

\end{definition}

Continuing with the example of the coin flip, the value \( P(X = heads) \) represents the projected probability of getting heads.



\begin{definition}\label{def:mln_op}
(Multinomial Opinion~\cite{josang2016subjective}).

\textbf{dealing with opinions about three mutually exclusive and exhaustive options.}

In a multinomial domain there are more than two possible outcomes or states that a variable can have i.e. \( k = \lvert  \mathbb{Y} \lvert  > 2 \). Each state has its own projected probability of occurrence. For example, let \(\mathbb{Y} = \{y_{1}, y_{2}, y_{3} \}\) be a ternary domain. And \( Y \in \mathbb{Y}\) a random variable. The cardinality of a ternary domain is \( k = 3 \). An example of a ternary domain can be \( movie\_rating = \{ good, neutral, bad \} \). Here \( Y \) can only be singleton values from the domain \( \mathbb{Y} \), meaning that \( Y \) can either be good, or neutral or bad. Composite sets such as \( Y = \{ good, bad \} \) fall under hyperdomains.

\textbf{Multinomial opinions are a generalisation of binomial opinions, in the same way as Dirichlet PDFs are a generalisation of Beta PDFs. Since the domain has been reduced to binary, the Dirichlet PDF is reduced to a Beta PDF which is simple to visualise. The interpretation of Beta and Dirichlet PDFs is well established in the statistics literature, so the mapping of Definition 3.6 creates a direct mathematical and interpretation equivalence between Dirichlet PDFs and opinions, when both are expressed over the same domain X. The cumulative fusion operator is equivalent to updating prior Dirichlet PDFs by adding new evidence to produce posterior Dirichlet PDFs. Deriving the cumulative belief fusion operator is based on the bijective mapping between belief opinions and evidence opinions. The mapping is expressed in Definition 3.9.}

The multinomial opinion is represented as a tuple of three values \( \omega_{Y} = (\textbf{b}_{Y}, u_{Y}, \textbf{a}_{Y}) \) where:

\( \textbf{b}_{Y} \): The belief mass distribution - a belief mass assignment to all possible values of \( Y \in \mathbb{Y}\).

\( u_{Y} \): The uncertainty mass.

\( \textbf{a}_{Y} \): The base rate distribution -  the prior probability of the outcomes over \( \mathbb{Y}\).

The satisfies the following

\begin{equation}
\begin{aligned}
& \textbf{b}_{Y} : \mathbb{Y} \rightarrow [0, 1], \\
& u_{Y} + \sum_{y \in \mathbb{Y}} \textbf{b}_{Y}(y) = 1
\end{aligned}
\label{eq:mn_bmd}
\end{equation}

The base rate distribution \( a_{Y} \) is the base rate probability assignment to all possible values of \( Y \in \mathbb{Y}\):

\begin{equation}
\begin{aligned}
& \textbf{a}_{Y} : \mathbb{Y} \rightarrow [0, 1], \\
& \sum_{y \in \mathbb{Y}} \textbf{a}_{Y}(y) = 1
\end{aligned}
\label{eq:mn_brd}
\end{equation}

In multinomial opinions the belief mass distribution \( \textbf{b}_{Y} \) and the base rate distribution \( \textbf{a}_{Y} \) both have \( k \) parameters. While the uncertainty mass \( u_{Y} \) is a scalar value.

The projected probability of a multinomial opinion is defined by:

\begin{equation}
P_{Y}(y) = \textbf{b}_{Y}(y) + \textbf{a}_{Y}(y) u_{Y}, \quad \forall y \in \mathbb{Y}
\label{eq:mn_prob}
\end{equation}

\end{definition}

\begin{definition}\label{def:evidence_op}
(Evidence Based Opinion~\cite{josang2016subjective}).
Opinions within \ac{sl} may be derived through the analysis of observations collected from the system under scrutiny. The evidence vector \( \textbf{r}_{Y} \) is generated through system observations, where \( \textbf{r}_{Y}(y) \) shows how much evidence there is for each possible outcome in \( y \in \mathbb{Y}\). 

Continuing with the example of movie ratings of a certain director, who has produced 6 good movies, 1 neutral movie and 1 bad movie in the past. The resulting evidence vector then becomes \( \textbf{r}(good) = 6, \textbf{r}(neutral) = 2, \textbf{r}(bad) = 2 \). The default base rate distribution is set to \( \textbf{a}_{Y}(y) = \frac{1}{k} = \frac{1}{3}\). Base rates can be set to any arbitrary value as long as Eq.~\eqref{eq:mn_brd} is satisfied.

The belief mass distribution and uncertainty mass values are derived as follows:

\begin{equation}
\begin{aligned}
& \forall y \in \mathbb{Y} \\
& \textbf{b}_{Y}(y) = \frac{\textbf{r}_{Y}(y)}{ W + \sum_{y_{i} \in \mathbb{Y}} \textbf{r}_{Y}(y_{i})}, \\
& {u}_{Y} = \frac{W}{ W + \sum_{y_{i} \in \mathbb{Y}} \textbf{r}_{Y}(y_{i})}
\end{aligned}
\label{eq:evd_op}
\end{equation}

where \( W \) denotes the default non-informative prior weight, set to \( W = 2 \).

\end{definition}

Inputting the evidence values into Eq.~\eqref{eq:evd_op} yields the following multinomial opinion \( \omega_{Y} = (\textbf{b}_{Y} = [0.5, 0.167, 0.167], u_{Y} = 0.167, \textbf{a}_{Y} = [0.333, 0.333, 0.333]) \). The projected probability of the next movie can be calculated using Eq.~\eqref{eq:mn_prob} to get: \( P_{Y}(good) = 0.556, P_{Y}(neutral) = 0.222, P_{Y}(bad) = 0.222 \).

A multinomial opinion can be mapped to  \( k \) binomial opinions \( Y \in \mathbb{Y}\). Consider the case where \( Y = good\), then a binary partition can be made for \( \overline{Y} = \{neutral, bad\} \). This binomial opinion would be for the case if the review is either good or not good. The sum of the belief mass of neutral and bad would equate to the disbelief mass \( d_{x} \). The base rate of the binomial opinion would be \( \textbf{a}_{Y}(good) \), and the uncertainty mass would be \( u_{Y} \) as is to yield \( \omega_{x} = (b_{Y}(good), (b_{Y}(neutral) + b_{Y}(bad)), u_{Y}, \textbf{a}_{Y}(good)) \).


\subsection{Operators}

\ac{sl} has several operators that facilitate in synthesizing and integrating evidence or opinions from multiple sources into a final 

\begin{definition}\label{def:cum_fus}
(Cumulative Fusion Operator (\( \oplus \))~\cite{josang2016subjective}).
The cumulative fusion operator (\( \oplus \)) in \ac{sl} is used to combine opinions based on non-overlapping observations. If \( \omega_{D}^{1-5} \) and \( \omega_{D}^{6-10} \) is the multinomial opinion of the first 5 and last 5 movies respectively. Using cumulative fusion the overall opinion of all movies can be calculated via  \( \omega_{D}^{1-10} = \omega_{D}^{1-5} \oplus \omega_{D}^{6-10} \).

\textbf{Cumulative fusion of evidence opinions simply consists of evidence parameter addition.}

\textbf{The cumulative fusion operator in subjective logic is used to fuse multiple opinions about the same proposition into a single, combined opinion, taking into account the uncertainty inherent in each opinion. For binomial opinions, the equations for cumulative fusion are well-defined.}

Given two binomial opinions \( \omega_{X}^{A} = (b_{X}^{A}, d_{X}^{A}, u_{X}^{A}, a_{X}^{A}) \) and \( \omega_{X}^{B} = (b_{X}^{B}, d_{X}^{B}, u_{X}^{B}, a_{X}^{B}) \), the cumulative fusion operation outputs the combined opinion \( \omega_{X}^{(A \lozenge B)} = \omega_{X}^{A} \oplus \omega_{X}^{B} \) as follows for \( u_{X}^{A} \neq 0 \vee u_{X}^{B} \neq 0 \):


\begin{equation}
\begin{aligned}
& b_{X}^{(A \lozenge B)}(x) = \frac{b_{X}^{A}(x) u_{X}^{B} + b_{X}^{B}(x) u_{X}^{A}}{u_{X}^{A} + u_{X}^{B} - u_{X}^{A}u_{X}^{B}}, \\
& d_{X}^{(A \lozenge B)}(x) = \frac{d_{X}^{A}(x) u_{X}^{B} + d_{X}^{B}(x) u_{X}^{A}}{u_{X}^{A} + u_{X}^{B} - u_{X}^{A}u_{X}^{B}}, \\
& u_{X}^{(A \lozenge B)} = \frac{u_{X}^{A} u_{X}^{B}}{u_{X}^{A} + u_{X}^{B} - u_{X}^{A}u_{X}^{B}}, \\
& a_{X}^{(A \lozenge B)}(x) = \frac{ a_{X}^{A}(x) u_{X}^{B} + a_{X}^{B}(x) u_{X}^{A} - (a_{X}^{A}(x) + a_{X}^{B}(x))u_{X}^{A}u_{X}^{B} }{u_{X}^{A} + u_{X}^{B} - 2u_{X}^{A}u_{X}^{B}}, \\  
& if u_{X}^{A} \neq 1 \vee u_{X}^{B} \neq 1
\end{aligned}
\label{eq:cum_fus}
\end{equation}

\end{definition}

