I am interested in finding the distribution "$p^*$" closest to an empirical distribution $\hat{p}$ where $p^*$ is a mixture of first and zeroth order Markov models. That is, I want to find $$ p^* = \arg\min_p \sum_{i,j} D\left(\,\hat{p}(j|i)\, \| \, p(j|i) \,\right) $$ subject to the following constraints

- $p(j|i) = \alpha \cdot r(j) + (1 - \alpha) \cdot q(j|i)$
- $r(j) \ge 0$ for all $j$
- $\sum_j r(j) = 1$
- $q(j|i) \ge 0$ for all $i$ and $j$
- $\sum_j q(j|i) = 1$ for all $i$

where $\alpha$ is a mixture parameter in $[0,1]$ that is given and fixed.

I know I can hand this off to a solver, but I am actually interested in deriving the updates and writing the optimization procedure myself. Therefore, any assistance in this endeavor is greatly appreciated.