nag_bivariate_students_t (g01hcc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_bivariate_students_t (g01hcc)

+ Contents

    1  Purpose
    7  Accuracy

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:     tailNag_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:     dfIntegerInput
On entry: ν, the degrees of freedom of the bivariate Student's t-distribution.
Constraint: df1.
5:     rhodoubleInput
On entry: ρ, the correlation of the bivariate Student's t-distribution.
Constraint: -1.0rho1.0.
6:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

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.
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

Not applicable.

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)


nag_bivariate_students_t (g01hcc) (PDF version)
g01 Chapter Contents
g01 Chapter Introduction
NAG Library Manual

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