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)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_multi_students_t (g01hd) returns a probability associated with a multivariate Student's t-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 xn that follows a Student's t-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 ,  
and probability p given by:
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 n 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, for an approximate integral value I, absolute accuracy εa and relative accuracy εr.

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

Parameters

Compulsory Input Parameters

1:     tailn – cell array of strings
Defines the calculated probability, set taili to:
taili='L'
If the ith lower limit ai is negative infinity.
taili='U'
If the ith upper limit bi is infinity.
taili='C'
If both ai and bi are finite.
Constraint: taili='L', 'U' or 'C', for i=1,2,,n.
2:     an – double array
ai, for i=1,2,,n, the lower integral limits of the calculation.
If taili='L', ai is not referenced and the ith lower limit of integration is -.
3:     bn – double array
bi, for i=1,2,,n, the upper integral limits of the calculation.
If taili='U', bi is not referenced and the ith upper limit of integration is .
Constraint: if taili='C', bi>ai.
4:     nu – double scalar
ν, the degrees of freedom.
Constraint: nu>0.0.
5:     deltan – double array
deltai the noncentrality parameter for the ith dimension, for i=1,2,,n; set deltai=0 for the central probability.
6:     iscov int64int32nag_int scalar
Set iscov=1 if the covariance matrix is supplied and iscov=2 if the correlation matrix is supplied.
Constraint: iscov=1 or 2.
7:     rcldrcn – double array
ldrc, the first dimension of the array, must satisfy the constraint ldrcn.
The lower triangle of either the covariance matrix (if iscov=1) or the correlation matrix (if iscov=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.)
n, the number of dimensions.
Constraint: 1<n1000.
2:     epsabs – double scalar
Default: 0.0
εa, the absolute accuracy requested in the approximation. If epsabs is negative, the absolute value is used.
3:     epsrel – double scalar
Default: 0.001
εr, the relative accuracy requested in the approximation. If epsrel is negative, the absolute value is used.
4:     numsub int64int32nag_int scalar
Default: 350
If quadrature is used, the number of sub-intervals used by the quadrature algorithm; otherwise numsub is not referenced.
Constraint: if referenced, numsub>0.
5:     nsampl int64int32nag_int scalar
Default: 8
If quadrature is used, nsampl is not referenced; otherwise nsampl is the number of samples used to estimate the error in the approximation.
Constraint: if referenced, nsampl>0.
6:     fmax int64int32nag_int scalar
Default: 1000×n
If a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Constraint: if referenced, fmax1.

Output Parameters

1:     result – double scalar
The result of the function.
2:     rcldrcn – double array
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=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
Constraint: 1<n1000.
   ifail=2
Constraint: tailk='L', 'U' or 'C'.
   ifail=4
Constraint: bk>ak for a central probability.
   ifail=5
Constraint: degrees of freedom nu>0.0.
   ifail=8
Constraint: iscov=1 or 2.
   ifail=9
On entry, the information supplied in rc is invalid.
   ifail=10
Constraint: ldrcn.
   ifail=12
Constraint: numsub1.
   ifail=13
Constraint: nsampl1.
   ifail=14
Constraint: fmax1.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

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

Further Comments

None.

Example

This example prints two probabilities from the Student's t-distribution.
function g01hd_example


fprintf('g01hd example results\n\n');

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('Example 1:\n');
fprintf('Probability:   %24.5e\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.5e\nError estimate:%24.2e\n', result, errest);


g01hd example results

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

Example 2:
Probability:                8.62903e-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–2015