# Is there a LogBeta function like the LogGamma?

In a computation, I need Log[Beta[alpha+j,beta-j+n]] of some kind.

Is there a LogBeta function built-in to avoid any under/over flow problems? There is one in R, called lbeta(a,b).

I could rewrite them in terms of Gamma functions and thus in terms of LogGamma. But I am lazy. I search a bit for it, just can't seem to find it.

So Mathematica does not have it?

On a related matter, Beta sometimes gives bad results, see here.

• Beta[a,b]==Gamma[a] Gamma[b]/Gamma[a+b] So logBeta[a_, b_]:= LogGamma[a] + LogGamma[b] - LogGamma[a+b] Dec 22, 2014 at 1:02
• @belisarius please post this as an answer! Dec 22, 2014 at 17:59
• @OleksandrR. Done, but not sure if it's constructive. In any case logbeta[] is now available when googling the site :) Dec 22, 2014 at 19:29

From MathWorld

Beta[a,b] == Gamma[a] Gamma[b]/Gamma[a+b]


So we can define

logBeta[a_, b_]:= LogGamma[a] + LogGamma[b] - LogGamma[a+b]

GraphicsRow[ Plot3D[#@logBeta[x, y], {x, -10, 10}, {y, -10, 10}] & /@ {Re, Im}] • What about the logarithm of the incomplete Beta function? That can't be reduced to LogGammas. Just asking cause I had a similar underflow/overflow problem using Beta or BetaRegularized to compute incomplete Beta values.
– a06e
Dec 22, 2014 at 19:44
• @becko I haven't thought about that. The question is about the complete beta (I guess). Let me see, but it seems a different problem. Dec 22, 2014 at 20:22
• @becko, that is a much more difficult problem; the complete implementation of a polyalgorithm (algorithms valid for different domains patched together) will be needed for that. May 27, 2015 at 8:59