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_multi_students_t (g01hd)

Purpose

nag_multi_students_t (g01hd) returns a probability associated with a multivariate Student's tt-distribution.

Syntax

[result, rc, errest, ifail] = g01hd(tail, a, b, nu, delta, iscov, rc, 'n', n, 'epsabs', epsabs, 'epsrel', epsrel, 'numsub', numsub, 'nsampl', nsampl, 'fmax', fmax)
[result, rc, errest, ifail] = nag_multi_students_t(tail, a, b, nu, delta, iscov, rc, 'n', n, 'epsabs', epsabs, 'epsrel', epsrel, 'numsub', numsub, 'nsampl', nsampl, 'fmax', fmax)

Description

A random vector xnxn that follows a Student's tt-distribution with νν degrees of freedom and covariance matrix ΣΣ has density:
( Γ ((ν + n) / 2) )/( Γ (ν / 2) νn / 2 πn / 2 |Σ|1 / 2 [1 + 1/νxTΣ1x] (ν + n) / 2 ) ,
Γ ( (ν+n) / 2 ) Γ (ν/2) νn/2 πn/2 |Σ| 1/2 [ 1+ 1ν xT Σ-1x ] (ν+n) / 2 ,
and probability pp given by:
b1b2 bn
p = ( Γ ((ν + n) / 2) )/( Γ (ν / 2) sqrt( |Σ| (πν)n ) )(1 + xTΣ1x / ν) (ν + n) / 2 dx.
a1a2 an
p = Γ ( (ν+n) / 2 ) Γ (ν/2) |Σ| (πν)n a1 b1 a2 b2 an bn ( 1+ xT Σ-1x/ν) - (ν+n)/2 dx .
The method of calculation depends on the dimension nn and degrees of freedom νν. The method of Dunnet and Sobel is used in the bivariate case if νν is a whole number. A Plackett transform followed by quadrature method is adopted in other bivariate cases and trivariate cases. In dimensions higher than three a number theoretic approach to evaluating multidimensional integrals is adopted.
Error estimates are supplied as the published accuracy in the Dunnet and Sobel case, a Monte–Carlo standard error for multidimensional integrals, and otherwise the quadrature error estimate.
A parameter δδ allows for non-central probabilities. The number theoretic method is used if any δδ is nonzero.
In cases other than the central bivariate with whole νν, nag_multi_students_t (g01hd) attempts to evaluate probabilities within a requested accuracy max (εa,εr × I)max(εa,εr×I), for an approximate integral value II, absolute accuracy εaεa and relative accuracy εrεr.

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 and Bretz F (2002) Methods for the computation of multivariate tt-probabilities Journal of Computational and Graphical Statistics (11) 950–971

Parameters

Compulsory Input Parameters

1:     tail(n) – cell array of strings
n, the dimension of the array, must satisfy the constraint 1 < n10001<n1000.
Defines the calculated probability, set tail(i)taili to:
tail(i) = 'L'taili='L'
If the iith lower limit aiai is negative infinity.
tail(i) = 'U'taili='U'
If the iith upper limit bibi is infinity.
tail(i) = 'C'taili='C'
If both aiai and bibi are finite.
Constraint: tail(i) = 'L'taili='L', 'U''U' or 'C''C', for i = 1,2,,ni=1,2,,n.
2:     a(n) – double array
n, the dimension of the array, must satisfy the constraint 1 < n10001<n1000.
aiai, for i = 1,2,,ni=1,2,,n, the lower integral limits of the calculation.
If tail(i) = 'L'taili='L', a(i)ai is not referenced and the iith lower limit of integration is -.
3:     b(n) – double array
n, the dimension of the array, must satisfy the constraint 1 < n10001<n1000.
bibi, for i = 1,2,,ni=1,2,,n, the upper integral limits of the calculation.
If tail(i) = 'U'taili='U', b(i)bi is not referenced and the iith upper limit of integration is .
Constraint: if tail(i) = 'C'taili='C', b(i) > a(i)bi>ai.
4:     nu – double scalar
νν, the degrees of freedom.
Constraint: nu > 0.0nu>0.0.
5:     delta(n) – double array
n, the dimension of the array, must satisfy the constraint 1 < n10001<n1000.
delta(i)deltai the noncentrality parameter for the iith dimension, for i = 1,2,,ni=1,2,,n; set delta(i) = 0deltai=0 for the central probability.
6:     iscov – int64int32nag_int scalar
Set iscov = 1iscov=1 if the covariance matrix is supplied and iscov = 2iscov=2 if the correlation matrix is supplied.
Constraint: iscov = 1iscov=1 or 22.
7:     rc(ldrc,n) – double array
ldrc, the first dimension of the array, must satisfy the constraint ldrcnldrcn.
The lower triangle of either the covariance matrix (if iscov = 1iscov=1) or the correlation matrix (if iscov = 2iscov=2). In either case the array elements corresponding to the upper triangle of the matrix need not be set.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The dimension of the arrays tail, a, b, delta and the first dimension of the array rc and the second dimension of the array rc. (An error is raised if these dimensions are not equal.)
nn, the number of dimensions.
Constraint: 1 < n10001<n1000.
2:     epsabs – double scalar
εaεa, the absolute accuracy requested in the approximation. If epsabs is negative, the absolute value is used.
Default: 0.00.0
3:     epsrel – double scalar
εrεr, the relative accuracy requested in the approximation. If epsrel is negative, the absolute value is used.
Default: 0.0010.001
4:     numsub – int64int32nag_int scalar
If quadrature is used, the number of sub-intervals used by the quadrature algorithm; otherwise numsub is not referenced.
Default: 350350
Constraint: if referenced, numsub > 0numsub>0.
5:     nsampl – int64int32nag_int scalar
If quadrature is used, nsampl is not referenced; otherwise nsampl is the number of samples used to estimate the error in the approximation.
Default: 88
Constraint: if referenced, nsampl > 0nsampl>0.
6:     fmax – int64int32nag_int scalar
If a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Default: 1000 × n1000×n
Constraint: if referenced, fmax1fmax1.

Input Parameters Omitted from the MATLAB Interface

ldrc

Output Parameters

1:     result – double scalar
The result of the function.
2:     rc(ldrc,n) – double array
ldrcnldrcn.
The strict upper triangle of rc contains the correlation matrix used in the calculations.
3:     errest – double scalar
An estimate of the error in the calculated probability.
4:     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:
  ifail = 1ifail=1
Constraint: 1 < n10001<n1000.
  ifail = 2ifail=2
Constraint: tail(k) = 'L'tailk='L', 'U''U' or 'C''C'.
  ifail = 4ifail=4
Constraint: b(k) > a(k)bk>ak for a central probability.
  ifail = 5ifail=5
Constraint: degrees of freedom nu > 0.0nu>0.0.
  ifail = 8ifail=8
Constraint: iscov = 1iscov=1 or 22.
  ifail = 9ifail=9
On entry, the information supplied in rc is invalid.
  ifail = 10ifail=10
Constraint: ldrcnldrcn.
  ifail = 12ifail=12
Constraint: numsub1numsub1.
  ifail = 13ifail=13
Constraint: nsampl1nsampl1.
  ifail = 14ifail=14
Constraint: fmax1fmax1.

Accuracy

An estimate of the error in the calculation is given by the value of errest on exit.

Further Comments

None.

Example

function nag_multi_students_t_example
iscov  = int64(1);

% Example 1
nu = 10;
tail = {'u'; 'u'; 'u'; 'u'; 'u'};
a = [-0.1; -0.1; -0.1; -0.1; -0.1];
b = [888; 888; 888; 888; 888];
delta = [0; 0; 0; 0; 0];
rc = [1.00, 0.75, 0.75, 0.75, 0.75;
      0.75, 1.00, 0.75, 0.75, 0.75;
      0.75, 0.75, 1.00, 0.75, 0.75;
      0.75, 0.75, 0.75, 1.00, 0.75;
      0.75, 0.75, 0.75, 0.75, 1.00];

% Calculate probability
[result, rc, errest, ifail] = ...
  nag_multi_students_t(tail, a, b, nu, delta, iscov, rc);

fprintf('\nExample 1:\n');
fprintf('Probability:   %24.8e\nError estimate:%24.2e\n', result, errest);


% Example 2
nu = 3;
tail = {'l'; 'l'; 'l'; 'l'; 'l'};
a = [888; 888; 888; 888; 888];
b = [-0.1; -0.1; -0.1; -0.1; -0.1];
delta = [1; 2; 3; 3; 3];
rc = [1.00, 0.75, 0.75, 0.75, 0.75;
      0.75, 1.00, 0.75, 0.75, 0.75;
      0.75, 0.75, 1.00, 0.75, 0.75;
      0.75, 0.75, 0.75, 1.00, 0.75;
      0.75, 0.75, 0.75, 0.75, 1.00];

% Calculate probability
[result, rc, errest, ifail] = ...
  nag_multi_students_t(tail, a, b, nu, delta, iscov, rc);

fprintf('\nExample 2:\n');
fprintf('Probability:   %24.8e\nError estimate:%24.2e\n', result, errest);
 

Example 1:
Probability:             3.01642215e-01
Error estimate:                1.09e-05

Example 2:
Probability:             8.62903029e-05
Error estimate:                1.62e-07

function g01hd_example
iscov  = int64(1);

% Example 1
nu = 10;
tail = {'u'; 'u'; 'u'; 'u'; 'u'};
a = [-0.1; -0.1; -0.1; -0.1; -0.1];
b = [888; 888; 888; 888; 888];
delta = [0; 0; 0; 0; 0];
rc = [1.00, 0.75, 0.75, 0.75, 0.75;
      0.75, 1.00, 0.75, 0.75, 0.75;
      0.75, 0.75, 1.00, 0.75, 0.75;
      0.75, 0.75, 0.75, 1.00, 0.75;
      0.75, 0.75, 0.75, 0.75, 1.00];

% Calculate probability
[result, rc, errest, ifail] = ...
  g01hd(tail, a, b, nu, delta, iscov, rc);

fprintf('\nExample 1:\n');
fprintf('Probability:   %24.8e\nError estimate:%24.2e\n', result, errest);


% Example 2
nu = 3;
tail = {'l'; 'l'; 'l'; 'l'; 'l'};
a = [888; 888; 888; 888; 888];
b = [-0.1; -0.1; -0.1; -0.1; -0.1];
delta = [1; 2; 3; 3; 3];
rc = [1.00, 0.75, 0.75, 0.75, 0.75;
      0.75, 1.00, 0.75, 0.75, 0.75;
      0.75, 0.75, 1.00, 0.75, 0.75;
      0.75, 0.75, 0.75, 1.00, 0.75;
      0.75, 0.75, 0.75, 0.75, 1.00];

% Calculate probability
[result, rc, errest, ifail] = ...
  g01hd(tail, a, b, nu, delta, iscov, rc);

fprintf('\nExample 2:\n');
fprintf('Probability:   %24.8e\nError estimate:%24.2e\n', result, errest);
 

Example 1:
Probability:             3.01642215e-01
Error estimate:                1.09e-05

Example 2:
Probability:             8.62903029e-05
Error estimate:                1.62e-07


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