def c_Beta(g1, g0):
''' Calculate cumulant function of the Beta distribution
Input can be vectors, in which case we compute sum over
several cumulant functions of the independent distributions:
\prod_k Beta(g1[k], g0[k])
Args
----
g1 : 1D array, size K
first parameter of a Beta distribution
g0 : 1D array, size K
second parameter of a Beta distribution
Returns
-------
c : scalar sum of the cumulants defined by provided parameters
'''
return np.sum(gammaln(g1 + g0) - gammaln(g1) - gammaln(g0))
评论列表
文章目录