naginterfaces.library.stat.pdf_​gamma_​vector

naginterfaces.library.stat.pdf_gamma_vector(ilog, x, a, b)[source]

pdf_gamma_vector returns a number of values of the probability density function (PDF), or its logarithm, for the gamma distribution.

For full information please refer to the NAG Library document for g01kk

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/g01/g01kkf.html

Parameters
ilogint

The value of determines whether the logarithmic value is returned in .

, the probability density function is returned.

, the logarithm of the probability density function is returned.

xfloat, array-like, shape

, the values at which the PDF is to be evaluated.

afloat, array-like, shape

, the shape parameter.

bfloat, array-like, shape

, the scale parameter.

Returns
pdffloat, ndarray, shape

or .

ivalidint, ndarray, shape

indicates any errors with the input arguments, with

No error.

.

.

overflows, the value returned should be a reasonable approximation.

Raises
NagValueError
(errno )

On entry, .

Constraint: or .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

On entry, at least one value of , or was invalid.

Check for more information.

Notes

The gamma distribution with shape parameter and scale parameter has PDF

If then an algorithm based directly on the gamma distribution’s PDF is used. For values outside this range, the function is calculated via the Poisson distribution’s PDF as described in Loader (2000) (see Further Comments).

The input arrays to this function are designed to allow maximum flexibility in the supply of vector arguments by re-using elements of any arrays that are shorter than the total number of evaluations required. See the G01 Introduction for further information.

References

Loader, C, 2000, Fast and accurate computation of binomial probabilities ((not yet published))