naginterfaces.library.stat.prob_gamma¶
- naginterfaces.library.stat.prob_gamma(g, a, b, tail='L')[source]¶
prob_gamma
returns the lower or upper tail probability of the gamma distribution, with parameters and .For full information please refer to the NAG Library document for g01ef
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01eff.html
- Parameters
- gfloat
, the value of the gamma variate.
- afloat
The parameter of the gamma distribution.
- bfloat
The parameter of the gamma distribution.
- tailstr, length 1, optional
Indicates whether an upper or lower tail probability is required.
The lower tail probability is returned, that is .
The upper tail probability is returned, that is .
- Returns
- pfloat
The lower or upper tail probability of the gamma distribution, with parameters and .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: and .
- Warns
- NagAlgorithmicWarning
- (errno )
The algorithm has failed to converge in iterations. The probability returned should be a reasonable approximation to the solution.
- Notes
The lower tail probability for the gamma distribution with parameters and , , is defined by:
The mean of the distribution is and its variance is . The transformation is applied to yield the following incomplete gamma function in normalized form,
This is then evaluated using
specfun.gamma_incomplete
.
- References
Hastings, N A J and Peacock, J B, 1975, Statistical Distributions, Butterworth