nag_multi_normal_pdf_vector (g01lbc) returns a number of values of the probability density function (PDF), or its logarithm, for the multivariate Normal (Gaussian) distribution.
The probability density function,
of an
-dimensional multivariate Normal distribution with mean vector
and
by
variance-covariance matrix
, is given by
If the variance-covariance matrix,
, is not of full rank then the probability density function, is calculated as
where
is the pseudo-determinant,
a generalized inverse of
and
its rank.
None.
- 1:
– Nag_BooleanInput
-
On entry: the value of
ilog determines whether the logarithmic value is returned in PDF.
- , the probability density function is returned.
- , the logarithm of the probability density function is returned.
- 2:
– IntegerInput
-
On entry: , the number of points the PDF is to be evaluated at.
Constraint:
.
- 3:
– IntegerInput
-
On entry: , the number of dimensions.
Constraint:
.
- 4:
– const doubleInput
-
Note: the dimension,
dim, of the array
x
must be at least
.
Where appears in this document, it refers to the array element
.
On entry: , the matrix of points at which to evaluate the probability density function, with the th dimension for the th point held in .
- 5:
– IntegerInput
-
On entry: the stride separating matrix row elements in the array
x.
Constraint:
.
- 6:
– const doubleInput
-
On entry: , the mean vector of the multivariate Normal distribution.
- 7:
– Nag_MatrixTypeInput
-
On entry: indicates the form of
and how it is stored in
sig.
- sig holds the lower triangular portion of .
- sig holds the upper triangular portion of .
- is a diagonal matrix and sig only holds the diagonal elements.
- sig holds the lower Cholesky decomposition, such that .
- sig holds the upper Cholesky decomposition, such that .
Constraint:
, , , or .
- 8:
– const doubleInput
-
Note: the dimension,
dim, of the array
sig
must be at least
.
Where appears in this document, it refers to the array element
.
On entry: information defining the variance-covariance matrix,
.
- or
- sig must hold the lower or upper portion of , with held in . The supplied variance-covariance matrix must be positive semidefinite.
- is a diagonal matrix and the th diagonal element, , must be held in
- or
- sig must hold or , the lower or upper Cholesky decomposition of , with or held in , depending on the value of iuld. No check is made that or is a valid variance-covariance matrix. The diagonal elements of the supplied or must be greater than zero
- 9:
– IntegerInput
-
On entry: the stride separating matrix row elements in the array
sig.
Constraints:
- if , ;
- otherwise .
- 10:
– doubleOutput
-
On exit:
or
depending on the value of
ilog.
- 11:
– Integer *Output
-
On exit: , rank of .
- 12:
– NagError *Input/Output
-
The NAG error argument (see
Section 2.7 in How to Use the NAG Library and its Documentation).
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_ARRAY_SIZE
-
On entry, .
Constraint: if , .
On entry, .
Constraint: if , .
On entry, and .
Constraint: .
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_DIAG_ELEMENTS
-
On entry, at least one diagonal element of is less than or equal to .
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_MAT_NOT_POS_DEF
-
On entry, is not positive definite and eigenvalue decomposition failed.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
- NE_NOT_POS_SEM_DEF
-
On entry, is not positive semidefinite.
Not applicable.
nag_multi_normal_pdf_vector (g01lbc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_multi_normal_pdf_vector (g01lbc) 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
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.
None.
This example prints the value of the multivariate Normal PDF at a number of different points.