def log_prior(self): """ Compute the log likelihood of a set of SBM parameters :param x: (m,p,v) tuple :return: """ from scipy.stats import dirichlet from graphistician.internals.utils import normal_inverse_wishart_log_prob lp = 0 # Get the log probability of the block probabilities lp += dirichlet(self.pi).logpdf(self.m) # Get the prior probability of the Gaussian parameters under NIW prior for c1 in xrange(self.C): for c2 in xrange(self.C): lp += normal_inverse_wishart_log_prob(self._gaussians[c1][c2]) if self.special_case_self_conns: lp += normal_inverse_wishart_log_prob(self._self_gaussian) # Get the probability of the block assignments lp += (np.log(self.m)[self.c]).sum() return lp
def log_prior(self): from graphistician.internals.utils import normal_inverse_wishart_log_prob lp = 0 lp += normal_inverse_wishart_log_prob(self._gaussian) lp += normal_inverse_wishart_log_prob(self._self_gaussian) return lp
def log_prior(self): """ Compute the prior probability of F, mu0, and lmbda """ from graphistician.internals.utils import \ normal_inverse_wishart_log_prob, \ inverse_wishart_log_prob lp = 0 # Log prior of F under spherical Gaussian prior from scipy.stats import norm, invgamma lp += invgamma.logpdf(self.eta, 1, 1) lp += norm.logpdf(self.b, 0, 1) lp += norm.logpdf(self.L, 0, 1).sum() lp += inverse_wishart_log_prob(self.cov) lp += normal_inverse_wishart_log_prob(self._self_gaussian) # Log prior of mu_0 and mu_self return lp