'EM iteration
Notes
This uses the inherited _em_iteration method for computing the
non-TVTP transition probabilities and then performs the EM step for
regression coefficients and variances.'

def _em_iteration(self, params0):

    (result, params1) = super(MarkovRegression, self)._em_iteration(params0)
    tmp = np.sqrt(result.smoothed_marginal_probabilities)
    coeffs = None
    if (self._k_exog > 0):
        coeffs = self._em_exog(result, self.endog, self.exog, self.parameters.switching['exog'], tmp)
        for i in range(self.k_regimes):
            params1[self.parameters[(i, 'exog')]] = coeffs[i]
    params1[self.parameters['variance']] = self._em_variance(result, self.endog, self.exog, coeffs, tmp)
    return (result, params1)
