def multigammaln(a, p): """Multivariate Log Gamma Parameters ---------- a: tensor like p: int degrees of freedom. p > 0 """ i = at.arange(1, p + 1) return p * (p - 1) * at.log(np.pi) / 4.0 + at.sum(gammaln(a + (1.0 - i) / 2.0), axis=0)
def betaln(x, y): return gammaln(x) + gammaln(y) - gammaln(x + y)
def factln(n): return gammaln(n + 1)