def beta_loglik(self, beta_estimand):
    beta_matrix = np.reshape(beta_estimand, (self.J, self.K), order='F')
    Z = self.current_Z
    counts = self.context.counts
    covariates = self.context.covariates
    fixed_effects = np.sum(np.multiply(Z, np.dot(covariates, beta_matrix)), axis=1)
    poisson_part = np.sum((np.multiply(counts, fixed_effects) - np.exp(fixed_effects)))
    beta_part = self.beta_prior.log_pdf(beta_estimand, self.J)
    output = (poisson_part + beta_part)
    return output
def beta_loglik(self, beta_estimand):
    beta_matrix = np.reshape(beta_estimand, (self.J, self.K), order='F')
    Z = self.current_Z
    counts = self.context.counts
    covariates = self.context.covariates
    fixed_effects = np.sum(np.multiply(Z, np.dot(covariates, beta_matrix)), axis=1)
    poisson_part = np.sum((np.multiply(counts, fixed_effects) - np.exp(fixed_effects)))
    beta_part = self.beta_prior.log_pdf(beta_estimand, self.J)
    output = (poisson_part + beta_part)
    return output