def f_loglik(self, F_estimand):
    f_matrix = np.reshape(F_estimand, (self.B, self.K), order='F')
    Z = self.current_Z
    f_full_matrix = gp_inflate_duplicate(f_matrix, self.block_assignment_numeric, self.N, self.K)
    output = 0
    temp = (f_full_matrix - logsumexp(f_full_matrix, axis=1)[:, np.newaxis])
    output += np.sum(np.multiply(Z, temp))
    for k in range(self.K):
        output += self.f_prior.get_logpdf(f=f_matrix[:, k])
    return output
def f_loglik(self, F_estimand):
    f_matrix = np.reshape(F_estimand, (self.B, self.K), order='F')
    Z = self.current_Z
    f_full_matrix = gp_inflate_duplicate(f_matrix, self.block_assignment_numeric, self.N, self.K)
    output = 0
    temp = (f_full_matrix - logsumexp(f_full_matrix, axis=1)[:, np.newaxis])
    output += np.sum(np.multiply(Z, temp))
    for k in range(self.K):
        output += self.f_prior.get_logpdf(f=f_matrix[:, k])
    return output