I could not find it in numpy, but it looked enough to implement. Here is an ugly little liner. (I followed the function specified on Wikipedia, except that you need to provide x = [x1, ..., xk] and alpha = [a1, ..., ak]).
import math import operator def dirichlet_pdf(x, alpha): return (math.gamma(sum(alpha)) / reduce(operator.mul, [math.gamma(a) for a in alpha]) * reduce(operator.mul, [x[i]**(alpha[i]-1.0) for i in range(len(alpha))]))
Warning: I have not tested this. Let me know if this works.
source share