Let the vector random variable
follow an
-dimensional multivariate Normal distribution with mean vector
and
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
g01hac and numerical integration is then used over the remaining
dimensions. In the case of
,
d01sjc
is used and for
d01wcc
is used.
To evaluate the probability for
a direct call to
g01eac is made and for
calls to
g01hac are made.
-
1:
– Nag_TailProbability
Input
-
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:
– Integer
Input
-
On entry: , the number of dimensions.
Constraint:
.
-
3:
– const double
Input
-
On entry: if
or
, the lower bounds,
, for
.
If
,
a is not referenced.
-
4:
– const double
Input
-
On entry: if
or
, the upper bounds,
, for
.
If
,
b is not referenced.
Constraint:
if , , for .
-
5:
– const double
Input
-
On entry: , the mean vector of the multivariate Normal distribution.
-
6:
– const double
Input
-
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:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
sigma.
Constraint:
.
-
8:
– double
Input
-
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:
– Integer
Input
-
On entry: this argument is no longer referenced, but is included for backwards compatability.
-
10:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
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.
Background information to multithreading can be found in the
Multithreading documentation.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also 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.