Beta-binomial gradient with respect to its theta parameter

grad_theta(ms, ns, pi, theta, MemLim = 2048L, Xtra = 7L)