NAG C Library Function Document

nag_bivariate_students_t (g01hcc)

1
Purpose

nag_bivariate_students_t (g01hcc) returns probabilities for the bivariate Student's t-distribution.

2
Specification

#include <nag.h>
#include <nagg01.h>
double  nag_bivariate_students_t (Nag_TailProbability tail, const double a[], const double b[], Integer df, double rho, NagError *fail)

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
Arguments

1:     tail Nag_TailProbabilityInput
On entry: indicates which probability is to be returned.
tail=Nag_LowerTail
The lower tail probability is returned.
tail=Nag_UpperTail
The upper tail probability is returned.
tail=Nag_Central
The central probability is returned.
Constraint: tail=Nag_LowerTail, Nag_UpperTail or Nag_Central.
2:     a[2] const doubleInput
On entry: if tail=Nag_Central or Nag_UpperTail, the lower bounds a1 and a2.
If tail=Nag_LowerTail, a is not referenced.
3:     b[2] const doubleInput
On entry: if tail=Nag_Central or Nag_LowerTail, the upper bounds b1 and b2.
If tail=Nag_UpperTail, b is not referenced.
Constraint: if tail=Nag_Central, 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 doubleInput
On entry: ρ, the correlation of the bivariate Student's t-distribution.
Constraint: -1.0rho1.0.
6:     fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

6
Error Indicators and Warnings

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_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, df=value.
Constraint: df1.
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.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
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_REAL
On entry, rho=value.
Constraint: -1.0rho1.0.
NE_REAL_2
On entry, b[i-1]a[i-1] for central probability, for some i=1,2.

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
Parallelism and Performance

nag_bivariate_students_t (g01hcc) is not threaded in any implementation.

9
Further Comments

None.

10
Example

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

10.1
Program Text

Program Text (g01hcce.c)

10.2
Program Data

Program Data (g01hcce.d)

10.3
Program Results

Program Results (g01hcce.r)