PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_beta_noncentral (g01ge)
Purpose
nag_stat_prob_beta_noncentral (g01ge) returns the probability associated with the lower tail of the noncentral beta distribution.
Syntax
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 23: |
tol was made optional (default 0) |
Description
The lower tail probability for the noncentral beta distribution with parameters
and
and noncentrality parameter
,
, is defined by
where
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).
References
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
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the deviate from the beta distribution, for which the probability is to be found.
Constraint:
.
- 2:
– double scalar
-
, the first parameter of the required beta distribution.
Constraint:
.
- 3:
– double scalar
-
, the second parameter of the required beta distribution.
Constraint:
.
- 4:
– double scalar
-
, the noncentrality parameter of the required beta distribution.
Constraint:
, where
is the safe range parameter as defined by
nag_machine_real_safe (x02am).
Optional Input Parameters
- 1:
– double scalar
Default:
The relative accuracy required by you in the results. If
nag_stat_prob_beta_noncentral (g01ge) is entered with
tol greater than or equal to
or less than
(see
nag_machine_precision (x02aj)), then the value of
is used instead.
See
Accuracy for the relationship between
tol and
maxit.
- 2:
– int64int32nag_int scalar
Default:
.
The maximum number of iterations that the algorithm should use.
See
Accuracy for suggestions as to suitable values for
maxit for different values of the arguments.
Constraint:
.
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Note: nag_stat_prob_beta_noncentral (g01ge) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
On entry, | , |
or | , |
or | , |
or | , |
or | , |
or | , where safe range argument as defined by nag_machine_real_safe (x02am), |
or | , |
or | , |
or | . |
If on exit then nag_stat_prob_beta_noncentral (g01ge) returns zero.
- W
-
The solution has failed to converge in
maxit iterations. You should try a larger value of
maxit or
tol. The returned value will be an approximation to the correct value.
- W
-
The probability is too close to or for the algorithm to be able to calculate the required probability. nag_stat_prob_beta_noncentral (g01ge) will return or as appropriate, this should be a reasonable approximation.
- W
-
The required accuracy was not achieved when calculating the initial value of
. You should try a larger value of
tol. The returned value will be an approximation to the correct value.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Convergence is theoretically guaranteed whenever
where
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.
Further Comments
The central beta probabilities can be obtained by setting .
Example
This example reads values for several beta distributions and calculates and prints the lower tail probabilities until the end of data is reached.
Open in the MATLAB editor:
g01ge_example
function g01ge_example
fprintf('g01ge example results\n\n');
x = [ 0.25 0.75 0.5];
a = [ 1 1.5 2 ];
b = [ 2 1.5 1 ];
rlamda = [ 1 0.5 0 ];
p = x;
fprintf(' x a b rlamda p\n');
for j = 1:numel(x)
[p(j), ifail] = g01ge( ...
x(j), a(j), b(j), rlamda(j));
end
fprintf('%8.3f%8.3f%8.3f%8.3f%8.4f\n', [x; a; b; rlamda; p]);
g01ge example results
x a b rlamda p
0.250 1.000 2.000 1.000 0.3168
0.750 1.500 1.500 0.500 0.7705
0.500 2.000 1.000 0.000 0.2500
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015