Working in the log domain.

Since probabilities can become extremely small, it is necessary to remain in the log-domain. Staying in the log-domain is a problem when summations are required. Let $ l_i=\log {\cal N}({\bf z}_k,$$ \mu$$ _{i},$$ \Sigma$$ _i)$. The summation

$\displaystyle \log S=\log\left[{\displaystyle \sum_{i=1}^{L}}
\;\alpha_{i} \exp(l_i) \right]

which appears in the first step of the E-M algorithm should be implemented as

$\displaystyle \log S = M + \log\left\{\displaystyle \sum_{i=1}^{L} \;\alpha_{i} \exp(l_i-M)

where $ M=\max_i l_i$.

Baggenstoss 2017-05-19