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

NAG Library Routine Document


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

G01HCF returns probabilities for the bivariate Student's t-distribution, via the routine name.

2  Specification

REAL (KIND=nag_wp) G01HCF
REAL (KIND=nag_wp)  A(2), B(2), RHO

3  Description

Let the vector random variable X = X1,X2T  follow a bivariate Student's t-distribution with degrees of freedom ν and correlation ρ, then the probability density function is given by
fX:ν,ρ = 1 2π 1-ρ2 1 + X12 + X22 - 2 ρ X1 X2 ν 1-ρ2 -ν/2-1 .
The lower tail probability is defined by:
P X1 b1 , X2 b2 :ν,ρ = - b1 - b2 fX:ν,ρ dX2 dX1 .
The upper tail probability is defined by:
P X1 a1 , X2 a2 :ν,ρ = a1 a2 fX:ν,ρ dX2 dX1 .
The central probability is defined by:
P a1 X1 b1 , a2 X2 b2 :ν,ρ = a1 b1 a2 b2 fX:ν,ρ dX2 dX1 .
Calculations use the Dunnet and Sobel (1954) method, as described by Genz (2004).

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 (2004) Numerical computation of rectangular bivariate and trivariate Normal and t probabilities Statistics and Computing 14 151–160

5  Parameters

1:     TAIL – CHARACTER(1)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: TAIL='L', 'U' or 'C'.
2:     A(2) – REAL (KIND=nag_wp) arrayInput
On entry: if TAIL='C' or 'U', the lower bounds a1 and a2.
If TAIL='L', A is not referenced.
3:     B(2) – REAL (KIND=nag_wp) arrayInput
On entry: if TAIL='C' or 'L', the upper bounds b1 and b2.
If TAIL='U', B is not referenced.
Constraint: if TAIL='C', ai<bi, for i=1,2.
4:     DF – INTEGERInput
On entry: ν, the degrees of freedom of the bivariate Student's t-distribution.
Constraint: DF1.
5:     RHO – REAL (KIND=nag_wp)Input
On entry: ρ, the correlation of the bivariate Student's t-distribution.
Constraint: -1.0RHO1.0.
6:     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:
If on exit, IFAIL0, then G01HCF returns zero.
On entry, TAIL is not valid.
On entry, BiAi for central probability, for some i=1,2.
On entry, DF<1.
On entry, RHO<-1.0 or RHO>1.0.

7  Accuracy

Accuracy of the algorithm implemented here is discussed in comparison with algorithms based on a generalized Placket formula by Genz (2004), who recommends the Dunnet and Sobel method. This implementation should give a maximum absolute error of the order of 10-16.

8  Further Comments


9  Example

This example calculates the bivariate Student's t probability given the choice of tail and degrees of freedom, correlation and bounds.

9.1  Program Text

Program Text (g01hcfe.f90)

9.2  Program Data

Program Data (g01hcfe.d)

9.3  Program Results

Program Results (g01hcfe.r)

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

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