<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def M_step(self):
 """ generate new parameter estimates given updated type distribution """


        for k in range(self.K):
            self.rho[k] = self.type_prob[:, k].sum() / self.N

        for k in range(self.K):
            for m in range(self.M):
                temp_prob = np.dot(self.type_prob[:, k],
                                   self.feature_counts[:, m])
                if temp_prob < 1e-99:
                    temp_prob = 1e-99
                self.mu[k, m] = temp_prob / np.dot(self.type_prob[:, k],
                                                   self.observations)