Calculates this formula (1), given the log of the numerator as input
                     
                     p_k * f(x_i, a_k)
        t_k(x_i) = -----------------------
                    ---K
                    \   p_k * f(x_i, a_k)
                    /__k=1
        
        x_i is data point i
        P_k is cluster k of K
        t_k is the posterior probability of x_i belonging to P_k
        p_k is the prior probability of belong to P_k (the proportional size of P_k)
        f(x, a) is the likelihood of x with parameters a

def likelihood_table_to_probs(self, lktable):
        """
        Calculates this formula (1), given the log of the numerator as input
                     
                     p_k * f(x_i, a_k)
        t_k(x_i) = -----------------------
                    ---K
                    \   p_k * f(x_i, a_k)
                    /__k=1
        
        x_i is data point i
        P_k is cluster k of K
        t_k is the posterior probability of x_i belonging to P_k
        p_k is the prior probability of belong to P_k (the proportional size of P_k)
        f(x, a) is the likelihood of x with parameters a
        """
        m = lktable.max(1)  # row max of lktable
        shifted = lktable-m[:,np.newaxis]  # shift lktable of log-likelihoods to a non-underflowing range
        expsum = np.exp(shifted).sum(1)  # convert logs to (scaled) normal space, and sum the rows
        logexpsum = np.log(expsum)+m  # convert back to log space, and undo the scaling
        return np.exp(lktable - logexpsum[:, np.newaxis])