PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_multi_students_t (g01hd)
Purpose
nag_multi_students_t (g01hd) returns a probability associated with a multivariate Student's -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
that follows a Student's
-distribution with
degrees of freedom and covariance matrix
has density:
and probability
given by:
The method of calculation depends on the dimension 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 , for an approximate integral value , absolute accuracy and relative accuracy .
References
Dunnet C W and Sobel M (1954) A bivariate generalization of Student's -distribution, with tables for certain special cases Biometrika 41 153–169
Genz A and Bretz F (2002) Methods for the computation of multivariate -probabilities Journal of Computational and Graphical Statistics (11) 950–971
Parameters
Compulsory Input Parameters
- 1:
– cell array of strings
-
Defines the calculated probability, set
to:
- If the th lower limit is negative infinity.
- If the th upper limit is infinity.
- If both and are finite.
Constraint:
, or , for .
- 2:
– double array
-
, for
, the lower integral limits of the calculation.
If , is not referenced and the th lower limit of integration is .
- 3:
– double array
-
, for
, the upper integral limits of the calculation.
If , is not referenced and the th upper limit of integration is .
Constraint:
if , .
- 4:
– double scalar
-
, the degrees of freedom.
Constraint:
.
- 5:
– double array
-
the noncentrality parameter for the th dimension, for ; set for the central probability.
- 6:
– int64int32nag_int scalar
-
Set if the covariance matrix is supplied and if the correlation matrix is supplied.
Constraint:
or .
- 7:
– double array
-
ldrc, the first dimension of the array, must satisfy the constraint
.
The lower triangle of either the covariance matrix (if ) or the correlation matrix (if ). In either case the array elements corresponding to the upper triangle of the matrix need not be set.
Optional Input Parameters
- 1:
– 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.)
, the number of dimensions.
Constraint:
.
- 2:
– double scalar
Default:
, the absolute accuracy requested in the approximation. If
epsabs is negative, the absolute value is used.
- 3:
– double scalar
Default:
, the relative accuracy requested in the approximation. If
epsrel is negative, the absolute value is used.
- 4:
– int64int32nag_int scalar
Default:
If quadrature is used, the number of sub-intervals used by the quadrature algorithm; otherwise
numsub is not referenced.
Constraint:
if referenced, .
- 5:
– int64int32nag_int scalar
Default:
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, .
- 6:
– int64int32nag_int scalar
Default:
If a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Constraint:
if referenced, .
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– double array
-
The strict upper triangle of
rc contains the correlation matrix used in the calculations.
- 3:
– double scalar
-
An estimate of the error in the calculated probability.
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
Constraint: .
-
-
Constraint: , or .
-
-
Constraint: for a central probability.
-
-
Constraint: degrees of freedom .
-
-
Constraint: or .
-
-
On entry, the information supplied in
rc is invalid.
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
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 -distribution.
Open in the MATLAB editor:
g01hd_example
function g01hd_example
fprintf('g01hd example results\n\n');
iscov = int64(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];
[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);
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];
[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)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015