nag_prob_beta_vector (g01sec) computes a number of lower or upper tail probabilities for the beta distribution.
The lower tail probability,
is defined by
The function
, also known as the incomplete beta function is calculated using
nag_incomplete_beta (s14ccc).
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
Section 2.6 in the g01 Chapter Introduction for further information.
Majumder K L and Bhattacharjee G P (1973) Algorithm AS 63. The incomplete beta integral Appl. Statist. 22 409–411
- 1:
ltail – IntegerInput
-
On entry: the length of the array
tail.
Constraint:
.
- 2:
tail[] – const Nag_TailProbabilityInput
-
On entry: indicates whether a lower or upper tail probabilities are required. For
, for
:
- The lower tail probability is returned, i.e., .
- The upper tail probability is returned, i.e., .
Constraint:
or , for .
- 3:
lbeta – IntegerInput
-
On entry: the length of the array
beta.
Constraint:
.
- 4:
beta[lbeta] – const doubleInput
-
On entry: , the value of the beta variate
with , .
Constraint:
, for .
- 5:
la – IntegerInput
-
On entry: the length of the array
a.
Constraint:
.
- 6:
a[la] – const doubleInput
-
On entry: , the first parameter of the required beta distribution
with , .
Constraint:
, for .
- 7:
lb – IntegerInput
-
On entry: the length of the array
b.
Constraint:
.
- 8:
b[lb] – const doubleInput
-
On entry: , the second parameter of the required beta distribution
with , .
Constraint:
, for .
- 9:
p[] – doubleOutput
-
Note: the dimension,
dim, of the array
p
must be at least
.
On exit: , the probabilities for the beta distribution.
- 10:
ivalid[] – IntegerOutput
-
Note: the dimension,
dim, of the array
ivalid
must be at least
.
On exit:
indicates any errors with the input arguments, with
-
No error.
-
| On entry, | invalid value supplied in tail when calculating . |
-
| On entry, | , |
| or | . |
-
| On entry, | , |
| or | , |
- 11:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
The accuracy is limited by the error in the incomplete beta function. See
Section 7 in nag_incomplete_beta (s14ccc) for further details.
None.
This example reads values from a number of beta distributions and computes the associated lower tail probabilities.