# Blahut–Arimoto algorithm

The term Blahut–Arimoto algorithm is often used to refer to a class of algorithms for computing numerically either the information theoretic capacity of a channel, the rate-distortion function of a source or a source encoding (i.e. compression to remove the redundancy). They are iterative algorithms that eventually converge to one of the maxima of the optimization problem that is associated with these information theoretic concepts.

## History and application

For the case of channel capacity, the algorithm was independently invented by Suguru Arimoto and Richard Blahut. In addition, Blahut's treatment gives algorithms for computing rate distortion and generalized capacity with input contraints (i.e. the capacity-cost function, analogous to rate-distortion). These algorithms are most applicable to the case of arbitrary finite alphabet sources. Much work has been done to extend it to more general problem instances. Recently, a version of the algorithm that accounts for continuous and multivariate outputs was proposed with applications in cellular signaling. There exists also a version of Blahut–Arimoto algorithm for directed information.

## Algorithm for Channel Capacity

A discrete memoryless channel (DMC) can be specified using two random variables $X,Y$ with alphabet ${\mathcal {X}},{\mathcal {Y}}$, and a channel law as a conditional probability distribution $p(y|x)$. The channel capacity, defined as $C:=\sup _{p\sim X}I(X;Y)$, indicates the maximum efficiency that a channel can communicate, in the unit of bit per use. Now if we denote the cardinality $|{\mathcal {X}}|=n,|{\mathcal {Y}}|=m$, then $p_{Y|X}$ is a $n\times m$ matrix, which we denote the $i^{th}$ row, $j^{th}$ column entry by $w_{ij}$. For the case of channel capacity, the algorithm was independently invented by Suguru Arimoto and Richard Blahut. They both found the following expression for the capacity of a DMC with channel law:
$C=\max _{\mathbf {p} }\max _{Q}\sum _{i=1}^{n}\sum _{j=1}^{m}p_{i}w_{ij}\log \left({\dfrac {Q_{ji}}{p_{i}}}\right)$
where $\mathbf {p}$ and $Q$ are maximized over the following requirements:
* $\mathbf {p}$ is a probability distribution on $X$, That is, if we write $\mathbf {p}$ as $(p_{1},p_{2}...,p_{n}),\sum _{i=1}^{n}p_{i}=1$
* $Q=(q_{ji})$ is a $m\times n$ matrix that behaves like a transition matrix from $Y$ to $X$ with respect to the channel law. That is, For all $1\leq i\leq n,1\leq j\leq m$:
** $q_{ji}\geq 0,q_{ji}=0\Leftrightarrow w_{ij}=0$
** Every row sums up to 1, i.e. $\sum _{i=1}^{n}q_{ji}=1$.
Then upon picking a random probability distribution $\mathbf {p} ^{0}:=(p_{1}^{0},p_{2}^{0},...p_{n}^{0})$ on $X$, we can generate a sequence $(\mathbf {p} ^{0},Q^{0},\mathbf {p} ^{1},Q^{1}...)$ iteratively as follows:
$(q_{ji}^{t}):={\dfrac {p_{i}^{t}w_{ij}}{\sum _{k=1}^{n}p_{k}^{t}w_{kj}}}$
$p_{k}^{t+1}:={\dfrac {\prod _{j=1}^{m}(q_{jk}^{t})^{w_{kj}}}{\sum _{i=1}^{n}\prod _{j=1}^{m}(q_{ji}^{t})^{w_{ij}}}}$
For $t=0,1,2...$.
Then, using the theory of optimization, specifically coordinate descent, Yeung showed that the sequence indeed converges to the required maximum. That is,
$\lim _{t\to \infty }\sum _{i=1}^{n}\sum _{j=1}^{m}p_{i}^{t}w_{ij}\log \left({\dfrac {Q_{ji}^{t}}{p_{i}^{t}}}\right)=C$.
So given a channel law $p(y|x)$, the capacity can be numerically estimated up to arbitrary precision.

## Algorithm for Rate-Distortion

Suppose we have a source $X$ with probability $p(x)$ of any given symbol. We wish to find an encoding $p({\hat {x}}|x)$ that generates a compressed signal ${\hat {X}}$ from the original signal while minimizing the expected distortion $\langle d(x,{\hat {x}})\rangle$, where the expectation is taken over the joint probability of $X$ and ${\hat {X}}$. We can find an encoding that minimizes the rate-distortion functional locally by repeating the following iteration until convergence:
    $p_{t+1}({\hat {x}}|x)={\frac {p_{t}({\hat {x}})\exp(-\beta d(x,{\hat {x}}))}{\sum _{\hat {x}}p_{t}({\hat {x}})\exp(-\beta d(x,{\hat {x}}))}}$
    $p_{t+1}({\hat {x}})=\sum _{x}p(x)p_{t+1}({\hat {x}}|x)$
where $\beta$ is a parameter related to the slope in the rate-distortion curve that we are targeting and thus is related to how much we favor compression versus distortion (higher $\beta$ means less compression).