require.mx('mxjs/base/math/statistics/gamma_function.js');
This is a list of utility functions around computing the gamma function.
These implementations are taking from the java package commons:commons-math3:3.6
Status | Name |
---|---|
Number gammaCDF
(
Number xoverscale,
Number shape,
Number logGammaShape
)
Cumulative density function of the Gamma distribution. |
|
Number gammaPDF
(
Number x,
Number shape,
Number theta,
Number gammaShape
)
Probability density function of the Gamma distribution. |
|
Number gammaPDF2
(
Number x,
Number shape,
Number theta,
Number logGammaShape
)
Probability density function of the Gamma distribution, calculated using lngamma to allow for larger numbers. |
Cumulative density function of the Gamma distribution.
Parameters:Number
xoverscale - x divided by scaleNumber
shape - shape parameter for the Gamma distributionNumber
logGammaShape - (optional) LogGamma(shape). If not provided, this will be calculated as needed. However, if you're calling gammaCDF many times with the same shape parameter, it can save some processing to precalculate this value just once and pass it as a parameter.Number
cdfvalue Probability density function of the Gamma distribution.
Parameters:Number
x - xNumber
shape - shape parameter for the Gamma distribution (aka k).Number
theta - scale parameter for the Gamma distribution (aka theta).Number
gammaShape - (optional) gamma(shape). If not provided, this will be calculated as needed. However, if you're calling gammaPDF many times with the same shape parameter, it can save some processing to precalculate this value just once and pass it as a parameter.Number
pdfvalue Probability density function of the Gamma distribution, calculated using lngamma to allow for larger numbers.
Parameters:Number
x - xNumber
shape - shape parameter for the Gamma distribution (aka k).Number
theta - scale parameter for the Gamma distribution (aka theta).Number
logGammaShape - (optional) LogGamma(shape). If not provided, this will be calculated as needed. However, if you're calling gammaPDF2 many times with the same shape parameter, it can save some processing to precalculate this value just once and pass it as a parameter.Number
pdfvalue