def logp_crp_unorm(N, K, alpha):
"""Returns the log unnormalized P(N,K|alpha), where N is the number of
customers and K is the number of tables. Use for effeciency to avoid
computing terms that are not a function of alpha.
"""
return K*log(alpha) + lgamma(alpha) - lgamma(N+alpha)
评论列表
文章目录