G01HDF (PDF version)
G01 Chapter Contents
G01 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G01HDF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

G01HDF returns a probability associated with a multivariate Student's t-distribution.

2  Specification

FUNCTION G01HDF ( N, TAIL, A, B, NU, DELTA, ISCOV, RC, LDRC, EPSABS, EPSREL, NUMSUB, NSAMPL, FMAX, ERREST, IFAIL)
REAL (KIND=nag_wp) G01HDF
INTEGER  N, ISCOV, LDRC, NUMSUB, NSAMPL, FMAX, IFAIL
REAL (KIND=nag_wp)  A(N), B(N), NU, DELTA(N), RC(LDRC,N), EPSABS, EPSREL, ERREST
CHARACTER(1)  TAIL(N)

3  Description

A random vector xn that follows a Student's t-distribution with ν degrees of freedom and covariance matrix Σ has density:
Γ ν+n / 2 Γ ν/2 νn/2 πn/2 Σ 1/2 1+ 1ν xT Σ-1x ν+n / 2 ,
and probability p given by:
p = Γ ν+n / 2 Γ ν/2 Σ πνn a1 b1 a2 b2 an bn 1+ xT Σ-1x/ν - ν+n/2 dx .
The method of calculation depends on the dimension n and degrees of freedom ν. The method of Dunnet and Sobel is used in the bivariate case if ν is a whole number. A Plackett transform followed by quadrature method is adopted in other bivariate cases and trivariate cases. In dimensions higher than three a number theoretic approach to evaluating multidimensional integrals is adopted.
Error estimates are supplied as the published accuracy in the Dunnet and Sobel case, a Monte–Carlo standard error for multidimensional intergrals, and otherwise the quadrature error estimate.
A parameter δ allows for non-central probabilities. The number theoretic method is used if any δ is nonzero.
In cases other than the central bivariate with whole ν, G01HDF attempts to evaluate probabilities within a requested accuracy maxεa,εr×I, for an approximate integral value I, absolute accuracy εa and relative accuracy εr.

4  References

Dunnet C W and Sobel M (1954) A bivariate generalization of Student's t-distribution, with tables for certain special cases Biometrika 41 153–169
Genz A and Bretz F (2002) Methods for the computation of multivariate t-probabilities Journal of Computational and Graphical Statistics (11) 950–971

5  Parameters

1:     N – INTEGERInput
On entry: n, the number of dimensions.
Constraint: 1<N<1000.
2:     TAIL(N) – CHARACTER(1) arrayInput
On entry: defines the calculated probability, set TAILi to:
TAILi='L'
If the ith lower limit ai is negative infinity.
TAILi='U'
If the ith upper limit bi is infinity.
TAILi='C'
If both ai and bi are finite.
Constraint: TAILi='L', 'U' or 'C', for i=1,2,,N.
3:     A(N) – REAL (KIND=nag_wp) arrayInput
On entry: ai, for i=1,2,,n, the lower integral limits of the calculation.
If TAILi='L', Ai is not referenced and the ith lower limit of integration is -.
4:     B(N) – REAL (KIND=nag_wp) arrayInput
On entry: bi, for i=1,2,,n, the upper integral limits of the calculation.
If TAILi='U', Bi is not referenced and the ith upper limit of integration is .
Constraint: if TAILi='C', Bi>Ai.
5:     NU – REAL (KIND=nag_wp)Input
On entry: ν, the degrees of freedom.
Constraint: NU>0.0.
6:     DELTA(N) – REAL (KIND=nag_wp) arrayInput
On entry: DELTAi the noncentrality parameter for the ith dimension, for i=1,2,,N; set DELTAi=0 for the central probability.
7:     ISCOV – INTEGERInput
On entry: set ISCOV=1 if the covariance matrix is supplied and ISCOV=2 if the correlation matrix is supplied.
Constraint: ISCOV=1 or 2.
8:     RC(LDRC,N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the lower triangle of the matrix must contain the covariance matrix if ISCOV=1 or the correlation matrix if ISCOV=2.
On exit: the strict upper triangle of RC contains the correlation matrix used in the calculations.
9:     LDRC – INTEGERInput
On entry: the first dimension of the array RC as declared in the (sub)program from which G01HDF is called.
Constraint: LDRCN.
10:   EPSABS – REAL (KIND=nag_wp)Input
On entry: εa, the absolute accuracy requested in the approximation. If EPSABS is negative, the absolute value is used.
Suggested value: 0.0.
11:   EPSREL – REAL (KIND=nag_wp)Input
On entry: εr, the relative accuracy requested in the approximation. If EPSREL is negative, the absolute value is used.
Suggested value: 0.001.
12:   NUMSUB – INTEGERInput
On entry: if quadrature is used, the number of sub-intervals; otherwise NUMSUB is not referenced.
Suggested value: 350.
Constraint: if referenced, NUMSUB>0.
13:   NSAMPL – INTEGERInput
On entry: if quadrature is used, NSAMPL is not referenced; otherwise NSAMPL is the number of samples used to estimate the error in the approximation.
Suggested value: 8
Constraint: if referenced, NSAMPL>0.
14:   FMAX – INTEGERInput
On entry: if a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Suggested value: 1000×N
Constraint: if referenced, FMAX1.
15:   ERREST – REAL (KIND=nag_wp)Output
On exit: an estimate of the error in the calculated probability.
16:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. 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 -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry, N=value.
Constraint: N2 and N1000.
IFAIL=2
On entry, TAILk=value.
Constraint: TAILk='L', 'U' or 'C'.
IFAIL=4
On entry, k=value.
Constraint: BkAk for a central probability.
IFAIL=5
On entry, NU=value.
Constraint: degrees of freedom NU>0.0.
IFAIL=8
On entry, ISCOV=value.
Constraint: ISCOV=1 or 2.
IFAIL=9
On entry, the information supplied in RC is invalid.
IFAIL=10
On entry, LDRC=value and N=value.
Constraint: LDRCN.
IFAIL=12
On entry, NUMSUB=value.
Constraint: NUMSUB1.
IFAIL=13
On entry, NSAMPL=value.
Constraint: NSAMPL1.
IFAIL=14
On entry, FMAX=value.
Constraint: FMAX1.

7  Accuracy

An estimate of the error in the calculation is given by the value of ERREST on exit.

8  Further Comments

None.

9  Example

This example prints two probabilities from the Student's t-distribution.

9.1  Program Text

Program Text (g01hdfe.f90)

9.2  Program Data

Program Data (g01hdfe.d)

9.3  Program Results

Program Results (g01hdfe.r)


G01HDF (PDF version)
G01 Chapter Contents
G01 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012