NAG Library Routine Document
G01EEF computes the upper and lower tail probabilities and the probability density function of the beta distribution with parameters and .
||X, A, B, TOL, P, Q, PDF
The probability density function of the beta distribution with parameters
The lower tail probability,
is defined by
, also known as the incomplete beta function is calculated using S14CCF
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
- 1: X – REAL (KIND=nag_wp)Input
On entry: , the value of the beta variate.
- 2: A – REAL (KIND=nag_wp)Input
On entry: , the first parameter of the required beta distribution.
- 3: B – REAL (KIND=nag_wp)Input
On entry: , the second parameter of the required beta distribution.
- 4: TOL – REAL (KIND=nag_wp)Input
On entry: this parameter is no longer referenced, but is included for backwards compatability.
- 5: P – REAL (KIND=nag_wp)Output
On exit: the lower tail probability, .
- 6: Q – REAL (KIND=nag_wp)Output
On exit: the upper tail probability, .
- 7: PDF – REAL (KIND=nag_wp)Output
On exit: the probability density function, .
- 8: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if
on exit, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Note: G01EEF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
is too far out into the tails for the probability to be evaluated exactly. The results returned are
as appropriate. These should be a good approximation to the required solution.
The accuracy is limited by the error in the incomplete beta function. See Section 7
in S14CCF for further details.
This example reads values from a number of beta distributions and computes the associated upper and lower tail probabilities and the corresponding value of the probability density function.
9.1 Program Text
Program Text (g01eefe.f90)
9.2 Program Data
Program Data (g01eefe.d)
9.3 Program Results
Program Results (g01eefe.r)