NAG Library Routine Document
G01HBF returns the upper tail, lower tail or central probability associated with a multivariate Normal distribution of up to ten dimensions.
|FUNCTION G01HBF (
||TAIL, N, A, B, XMU, SIG, LDSIG, TOL, WK, LWK, IFAIL)
|REAL (KIND=nag_wp) G01HBF
||N, LDSIG, LWK, IFAIL
||A(N), B(N), XMU(N), SIG(LDSIG,N), TOL, WK(LWK)
Let the vector random variable
-dimensional multivariate Normal distribution with mean vector
, then the probability density function,
, is given by
The lower tail probability is defined by:
The upper tail probability is defined by:
The central probability is defined by:
To evaluate the probability for
, the probability density function of
is considered as the product of the conditional probability of
and the marginal bivariate Normal distribution of
. The bivariate Normal probability can be evaluated as described in G01HAF
and numerical integration is then used over the remaining
dimensions. In the case of
is used and for D01FCF
To evaluate the probability for
a direct call to G01EAF
is made and for
calls to G01HAF
Kendall M G and Stuart A (1969) The Advanced Theory of Statistics (Volume 1) (3rd Edition) Griffin
- 1: TAIL – CHARACTER(1)Input
: indicates which probability is to be returned.
- The lower tail probability is returned.
- The upper tail probability is returned.
- The central probability is returned.
, or .
- 2: N – INTEGERInput
On entry: , the number of dimensions.
- 3: A(N) – REAL (KIND=nag_wp) arrayInput
, the lower bounds,
is not referenced.
- 4: B(N) – REAL (KIND=nag_wp) arrayInput
, the upper bounds,
, is not referenced.
if , , for .
- 5: XMU(N) – REAL (KIND=nag_wp) arrayInput
On entry: , the mean vector of the multivariate Normal distribution.
- 6: SIG(LDSIG,N) – REAL (KIND=nag_wp) arrayInput
On entry: , the variance-covariance matrix of the multivariate Normal distribution. Only the lower triangle is referenced.
must be positive definite.
- 7: LDSIG – INTEGERInput
: the first dimension of the array SIG
as declared in the (sub)program from which G01HBF is called.
- 8: TOL – REAL (KIND=nag_wp)Input
the relative accuracy required for the probability, and if the upper or the lower tail probability is requested then TOL
is also used to determine the cut-off points, see Section 7
is not referenced.
if , .
- 9: WK(LWK) – REAL (KIND=nag_wp) arrayWorkspace
- 10: LWK – INTEGERInput
: the length of workspace provided in array WK
. This workspace is used by the numerical integration routines D01AJF
, then the maximum number of sub-intervals used by D01AJF
. Note, however, increasing LWK
will not increase the maximum number of sub-intervals above
the maximum number of integrand evaluations used by D01FCF
, then WK
will not be used.
2000 if and if .
- if , ;
- if , .
- 11: 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: G01HBF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
If on exit , or , then G01HBF returns zero.
|or||, or ,|
|or|| and ,|
|or||LWK is too small.|
|On entry,|| and , for some .|
|On entry,|| is not positive definite, i.e., is not a correct variance-covariance matrix.|
The requested accuracy has not been achieved, a larger value of TOL
should be tried or the length of the workspace should be increased. The returned value will be an approximation to the required result.
Round-off error prevents the requested accuracy from being achieved; a larger value of TOL
should be tried. The returned value will be an approximation to the required result. This error will only occur if
The accuracy should be as specified by TOL
. When on exit
the approximate accuracy achieved is given in the error message. For the upper and lower tail probabilities the infinite limits are approximated by cut-off points for the
dimensions over which the numerical integration takes place; these cut-off points are given by
is the inverse univariate Normal distribution function.
The time taken is related to the number of dimensions, the range over which the integration takes place (, for ) and the value of as well as the accuracy required. As the numerical integration does not take place over the last two dimensions speed may be improved by arranging so that the largest ranges of integration are for and .
This example reads in the mean and covariance matrix for a multivariate Normal distribution and computes and prints the associated central probability.
9.1 Program Text
Program Text (g01hbfe.f90)
9.2 Program Data
Program Data (g01hbfe.d)
9.3 Program Results
Program Results (g01hbfe.r)