def log_prob_z(self):
"""
Return the log marginal probability of component assignment P(z).
See (24.24) in Murphy, p. 842.
"""
log_prob_z = (
gammaln(self.alpha)
- gammaln(self.alpha + np.sum(self.components.counts))
+ np.sum(
gammaln(
self.components.counts
+ float(self.alpha)/self.components.K_max
)
- gammaln(self.alpha/self.components.K_max)
)
)
return log_prob_z
评论列表
文章目录