Difference between revisions of "BetaFn"

(Relationship to the GammaFn)
 
Line 6: Line 6:
 
:<math>BetaFn(a,b) = \int_0^1 x^{a-1} (1-x)^{b-1} dx</math>
 
:<math>BetaFn(a,b) = \int_0^1 x^{a-1} (1-x)^{b-1} dx</math>
  
== Library ==
+
The following relationship exists between the [[BetaFn]] and the [[GammaFn]]:
Advanced Math
+
:[[BetaFn]](a,b) = [[GammaFn]](a) * [[GammaFn]](b) / [[GammaFn]](a+b)
 +
 
 +
== Numeric considerations ==
 +
 
 +
For very large values of <code>a</code> and <code>b</code>, the result underflow, so that you might find it better to use <code>[[Ln]]([[BetaFn]](a,b))</code>. However, when computing the log-beta function, you should compute it using:
 +
 
 +
:<code>[[LGamma]](a) + [[LGamma]](b) - [[LGamma]](a+b)</code>
  
 
== See Also ==
 
== See Also ==

Latest revision as of 21:23, 5 February 2016


BetaFn(a, b)

The complete beta function, defined as:

[math]\displaystyle{ BetaFn(a,b) = \int_0^1 x^{a-1} (1-x)^{b-1} dx }[/math]

The following relationship exists between the BetaFn and the GammaFn:

BetaFn(a,b) = GammaFn(a) * GammaFn(b) / GammaFn(a+b)

Numeric considerations

For very large values of a and b, the result underflow, so that you might find it better to use Ln(BetaFn(a,b)). However, when computing the log-beta function, you should compute it using:

LGamma(a) + LGamma(b) - LGamma(a+b)

See Also

Comments


You are not allowed to post comments.