NAG Library Function Document
nag_prob_non_central_beta_dist (g01gec) returns the probability associated with the lower tail of the noncentral beta distribution.
||nag_prob_non_central_beta_dist (double x,
The lower tail probability for the noncentral beta distribution with parameters
and noncentrality parameter
, is defined by
which is the central beta probability function or incomplete beta function.
Recurrence relationships given in Abramowitz and Stegun (1972)
are used to compute the values of
for each step of the summation (1)
The algorithm is discussed in Lenth (1987)
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Lenth R V (1987) Algorithm AS 226: Computing noncentral beta probabilities Appl. Statist. 36 241–244
x – doubleInput
On entry: , the deviate from the beta distribution, for which the probability is to be found.
a – doubleInput
On entry: , the first parameter of the required beta distribution.
b – doubleInput
On entry: , the second parameter of the required beta distribution.
lambda – doubleInput
On entry: , the noncentrality parameter of the required beta distribution.
is the safe range parameter as defined by nag_real_safe_small_number (X02AMC)
tol – doubleInput
: the relative accuracy required by you in the results. If nag_prob_non_central_beta_dist (g01gec) is entered with tol
greater than or equal to
or less than
(see nag_machine_precision (X02AJC)
), then the value of
is used instead.
See Section 7
for the relationship between tol
max_iter – IntegerInput
: the maximum number of iterations that the algorithm should use.
See Section 7
for suggestions as to suitable values for max_iter
for different values of the arguments.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
Dynamic memory allocation failed.
The solution has failed to converge in
Consider increasing max_iter
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
The required accuracy was not achieved when calculating the initial value
of the beta distribution. You should try a larger value of tol
The returned value will be an approximation to the correct value.
The probability is too close to 0.0 or 1.0 for the algorithm to be able to
calculate the required probability.
nag_prob_non_central_beta_dist (g01gec) will return 0.0 or 1.0 as appropriate.
This should be a reasonable approximation.
is the safe range argument
as defined by nag_real_safe_small_number (X02AMC)
On entry, .
Convergence is theoretically guaranteed whenever
has a Poisson distribution with mean
. Excessive round-off errors are possible when the number of iterations used is high and tol
is close to machine precision
. See Lenth (1987)
for further comments on the error bound.
The central beta probabilities can be obtained by setting .
This example reads values for several beta distributions and calculates and prints the lower tail probabilities until the end of data is reached.
9.1 Program Text
Program Text (g01gece.c)
9.2 Program Data
Program Data (g01gece.d)
9.3 Program Results
Program Results (g01gece.r)