naginterfaces.library.stat.prob_gamma_vector¶
- naginterfaces.library.stat.prob_gamma_vector(tail, g, a, b)[source]¶
prob_gamma_vector
returns a number of lower or upper tail probabilities for the gamma distribution.For full information please refer to the NAG Library document for g01sf
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01sff.html
- Parameters
- tailstr, length 1, array-like, shape
Indicates whether a lower or upper tail probability is required. For , for :
The lower tail probability is returned, i.e., .
The upper tail probability is returned, i.e., .
- gfloat, array-like, shape
, the value of the gamma variate.
- afloat, array-like, shape
The parameter of the gamma distribution.
- bfloat, array-like, shape
The parameter of the gamma distribution.
- Returns
- pfloat, ndarray, shape
, the probabilities of the beta distribution.
- ivalidint, ndarray, shape
indicates any errors with the input arguments, with
No error.
On entry, invalid value supplied in when calculating .
On entry, .
On entry, , or, .
The solution did not converge in iterations, see
specfun.gamma_incomplete
for details. The probability returned should be a reasonable approximation to the solution.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (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, or the solution did not converge.
Check for more information.
- 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
.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
Hastings, N A J and Peacock, J B, 1975, Statistical Distributions, Butterworth