nag_multi_normal (g01hbc) returns the upper tail, lower tail or central probability associated with a multivariate Normal distribution of up to ten dimensions.
Let the vector random variable
follow an
-dimensional multivariate Normal distribution with mean vector
and
by
variance-covariance matrix
, 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
given
and
and the marginal bivariate Normal distribution of
and
. The bivariate Normal probability can be evaluated as described in
nag_bivariate_normal_dist (g01hac) and numerical integration is then used over the remaining
dimensions. In the case of
,
nag_1d_quad_gen_1 (d01sjc)
is used and for
nag_multid_quad_adapt_1 (d01wcc)
is used.
To evaluate the probability for
a direct call to
nag_prob_normal (g01eac) is made and for
calls to
nag_bivariate_normal_dist (g01hac) are made.
- 1:
tail – Nag_TailProbabilityInput
On entry: indicates which probability is to be returned.
- The lower tail probability is returned.
- The upper tail probability is returned.
- The central probability is returned.
Constraint:
, or .
- 2:
n – IntegerInput
On entry: , the number of dimensions.
Constraint:
.
- 3:
a[n] – const doubleInput
On entry: if
or
, the lower bounds,
, for
.
If
,
a is not referenced.
- 4:
b[n] – const doubleInput
On entry: if
or
, the upper bounds,
, for
.
If
b, is not referenced.
Constraint:
if , , for .
- 5:
mean[n] – const doubleInput
On entry: , the mean vector of the multivariate Normal distribution.
- 6:
sigma[] – const doubleInput
-
Note: the th element of the matrix is stored in .
On entry: , the variance-covariance matrix of the multivariate Normal distribution. Only the lower triangle is referenced.
Constraint:
must be positive definite.
- 7:
tdsig – IntegerInput
-
On entry: the stride separating matrix column elements in the array
sigma.
Constraint:
.
- 8:
tol – doubleInput
On entry: if
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.
If
,
tol is not referenced.
Suggested value:
.
Constraint:
if , .
- 9:
maxpts – IntegerInput
On entry: the maximum number of sub-intervals or integrand evaluations.
If
, then the maximum number of sub-intervals used by
nag_1d_quad_gen_1 (d01sjc) is
maxpts/4. Note however increasing
maxpts above 1000 will not increase the maximum number of sub-intervals above 250.
If
the maximum number of integrand evaluations used by
nag_multid_quad_adapt_1 (d01wcc) is
(
maxpts/
), where
.
If
or 2, then
maxpts will not be used.
Suggested value:
2000 if and 1000 if .
Constraint:
if , .
- 10:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
The accuracy should be as specified by
tol. When on exit
NE_ACC 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
, where
is the inverse univariate Normal distribution function.
nag_multi_normal (g01hbc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_multi_normal (g01hbc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
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.