Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

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 t$t$-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={\left({X}_{1},{X}_{2}\right)}^{\mathrm{T}}$ follow a bivariate Student's t$t$-distribution with degrees of freedom ν$\nu$ and correlation ρ$\rho$, then the probability density function is given by
 f(X : ν,ρ) = 1/( 2π sqrt( 1 − ρ2 ) ) (1 + ( X12 + X22 − 2 ρ X1 X2 )/( ν (1 − ρ2) )) − ν / 2 − 1 . $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 t$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$t$ probabilities Statistics and Computing 14 151–160

## Parameters

### Compulsory Input Parameters

1:     df – int64int32nag_int scalar
ν$\nu$, the degrees of freedom of the bivariate Student's t$t$-distribution.
Constraint: df1${\mathbf{df}}\ge 1$.
2:     rho – double scalar
ρ$\rho$, the correlation of the bivariate Student's t$t$-distribution.
Constraint: 1.0rho1.0$-1.0\le {\mathbf{rho}}\le 1.0$.

### Optional Input Parameters

1:     a(2$2$) – double array
If upper tail or central probablilities are to be returned, a should supply the lower bounds, ai${a}_{\mathit{i}}$, for i = 1,2$\mathit{i}=1,2$.
2:     b(2$2$) – double array
If lower tail or central probablilities are to be returned, b should supply the upper bounds, bi${b}_{\mathit{i}}$, for i = 1,2$\mathit{i}=1,2$.

tail

### Output Parameters

1:     result – double scalar
The result of the function.
2:     ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{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, ifail0${\mathbf{ifail}}\ne 0$, then nag_stat_prob_bivariate_students_t (g01hc) returns zero.
ifail = 1${\mathbf{ifail}}=1$
On entry, tail is not valid:
ifail = 3${\mathbf{ifail}}=3$
On entry, b(i)a(i)${\mathbf{b}}\left(i\right)\le {\mathbf{a}}\left(i\right)$ for central probability, for some i = 1,2$i=1,2$.
ifail = 4${\mathbf{ifail}}=4$
Constraint: df1${\mathbf{df}}\ge 1$.
ifail = 5${\mathbf{ifail}}=5$
Constraint: 1.0rho1.0$-1.0\le {\mathbf{rho}}\le 1.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 1016${10}^{-16}$.

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

```

Chapter Contents
Chapter Introduction
NAG Toolbox

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