hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_stat_prob_bivariate_students_t (g01hc)

Purpose

nag_stat_prob_bivariate_students_t (g01hc) returns probabilities for the bivariate Student's tt-distribution.

Syntax

[result, ifail] = g01hc(df, rho, 'a', a, 'b', b)
[result, ifail] = nag_stat_prob_bivariate_students_t(df, rho, 'a', a, 'b', b)

Description

Let the vector random variable X = (X1,X2)T X = (X1,X2)T  follow a bivariate Student's tt-distribution with degrees of freedom νν and correlation ρρ, then the probability density function is given by
f(X : ν,ρ) = 1/( 2π sqrt( 1ρ2 ) ) (1 + ( X12 + X22 2 ρ X1 X2 )/( ν (1ρ2) ))ν / 21 .
f(X:ν,ρ) = 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 f(X : ν,ρ) dX2 dX1 .
P( X1 b1 , X2 b2 :ν,ρ) = - b1 - b2 f(X:ν,ρ) dX2 dX1 .
The upper tail probability is defined by:
P( X1 a1 , X2 a2 : ν,ρ) = a1 a2 f(X : ν,ρ) dX2 dX1 .
P( X1 a1 , X2 a2 :ν,ρ) = a1 a2 f(X:ν,ρ) dX2 dX1 .
The central probability is defined by:
P( a1 X1 b1 , a2 X2 b2 : ν,ρ) = a1b1 a2b2 f(X : ν,ρ) dX2 dX1 .
P( a1 X1 b1 , a2 X2 b2 :ν,ρ) = a1 b1 a2 b2 f(X:ν,ρ) dX2 dX1 .
Calculations use the Dunnet and Sobel (1954) method, as described by Genz (2004).

References

Dunnet C W and Sobel M (1954) A bivariate generalization of Student's tt-distribution, with tables for certain special cases Biometrika 41 153–169
Genz A (2004) Numerical computation of rectangular bivariate and trivariate Normal and tt probabilities Statistics and Computing 14 151–160

Parameters

Compulsory Input Parameters

1:     df – int64int32nag_int scalar
νν, the degrees of freedom of the bivariate Student's tt-distribution.
Constraint: df1df1.
2:     rho – double scalar
ρρ, the correlation of the bivariate Student's tt-distribution.
Constraint: 1.0rho1.0-1.0rho1.0.

Optional Input Parameters

1:     a(22) – double array
If upper tail or central probablilities are to be returned, a should supply the lower bounds, aiai, for i = 1,2i=1,2.
2:     b(22) – double array
If lower tail or central probablilities are to be returned, b should supply the upper bounds, bibi, for i = 1,2i=1,2.

Input Parameters Omitted from the MATLAB Interface

tail

Output Parameters

1:     result – double scalar
The result of the function.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
If on exit, ifail0ifail0, then nag_stat_prob_bivariate_students_t (g01hc) returns zero.
  ifail = 1ifail=1
On entry, tail is not valid:
  ifail = 3ifail=3
On entry, b(i)a(i)biai for central probability, for some i = 1,2i=1,2.
  ifail = 4ifail=4
Constraint: df1df1.
  ifail = 5ifail=5
Constraint: 1.0rho1.0-1.0rho1.0.

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

Further Comments

None.

Example

function nag_stat_prob_bivariate_students_t_example
[result1, ifail] = ...
    nag_stat_prob_bivariate_students_t(int64(8),   0.6, 'b', [4.0, 0.8]);
[result2, ifail] = ...
    nag_stat_prob_bivariate_students_t(int64(12), -0.2, 'a', [-40, 0], 'b', [2.0, 4.0]);
[result3, ifail] = ...
    nag_stat_prob_bivariate_students_t(int64(2),   0.3, 'a', [-2, 8])
 

result3 =

    0.0059


ifail =

                    0


function g01hc_example
[result1, ifail] = g01hc(int64(8),   0.6, 'b', [4.0, 0.8]);
[result2, ifail] = g01hc(int64(12), -0.2, 'a', [-40, 0], 'b', [2.0, 4.0]);
[result3, ifail] = g01hc(int64(2),   0.3, 'a', [-2, 8])
 

result3 =

    0.0059


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013