NAG CL Interface
g01hdc (prob_​multi_​students_​t)

Settings help

CL Name Style:

1 Purpose

g01hdc returns a probability associated with a multivariate Student's t-distribution.

2 Specification

#include <nag.h>
double  g01hdc (Integer n, const Nag_TailProbability tail[], const double a[], const double b[], double nu, const double delta[], Nag_Boolean iscov, double rc[], Integer pdrc, double epsabs, double epsrel, Integer numsub, Integer nsampl, Integer fmax, double *errest, NagError *fail)
The function may be called by the names: g01hdc, nag_stat_prob_multi_students_t or nag_multi_students_t.

3 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 Dunnett and Sobel (1954) 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 Dunnett and Sobel (1954) 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 ν, g01hdc 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.

4 References

Dunnett 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

5 Arguments

1: n Integer Input
On entry: n, the number of dimensions.
Constraint: 1<n1000.
2: tail[n] const Nag_TailProbability Input
On entry: defines the calculated probability, set tail[i-1] to:
If the ith lower limit ai is negative infinity.
If the ith upper limit bi is infinity.
If both ai and bi are finite.
Constraint: tail[i-1]=Nag_LowerTail, Nag_UpperTail or Nag_Central, for i=1,2,,n.
3: a[n] const double Input
On entry: ai, for i=1,2,,n, the lower integral limits of the calculation.
If tail[i-1]=Nag_LowerTail, a[i-1] is not referenced and the ith lower limit of integration is -.
4: b[n] const double Input
On entry: bi, for i=1,2,,n, the upper integral limits of the calculation.
If tail[i-1]=Nag_UpperTail, b[i-1] is not referenced and the ith upper limit of integration is .
Constraint: if tail[i-1]=Nag_Central, b[i-1]>a[i-1].
5: nu double Input
On entry: ν, the degrees of freedom.
Constraint: nu>0.0.
6: delta[n] const double Input
On entry: delta[i-1] the noncentrality parameter for the ith dimension, for i=1,2,,n; set delta[i-1]=0 for the central probability.
7: iscov Nag_Boolean Input
On entry: set iscov=Nag_TRUE if the covariance matrix is supplied and iscov=Nag_FALSE if the correlation matrix is supplied.
8: rc[n×pdrc] double Input/Output
Note: the (i,j)th element of the matrix is stored in rc[(i-1)×pdrc+j-1].
On entry: the lower triangle of either the covariance matrix (if iscov=Nag_TRUE) or the correlation matrix (if iscov=Nag_FALSE). In either case the array elements corresponding to the upper triangle of the matrix need not be set.
On exit: the strict upper triangle of rc contains the correlation matrix used in the calculations.
9: pdrc Integer Input
On entry: the stride separating matrix column elements in the array rc.
Constraint: pdrcn.
10: epsabs double Input
On entry: εa, the absolute accuracy requested in the approximation. If epsabs is negative, the absolute value is used.
Suggested value: 0.0.
11: epsrel double Input
On entry: εr, the relative accuracy requested in the approximation. If epsrel is negative, the absolute value is used.
Suggested value: 0.001.
12: numsub Integer Input
On entry: if quadrature is used, the number of sub-intervals used by the quadrature algorithm; otherwise numsub is not referenced.
Suggested value: 350.
Constraint: if referenced, numsub>0.
13: nsampl Integer Input
On entry: if quadrature is used, nsampl is not referenced; otherwise nsampl is the number of samples used to estimate the error in the approximation.
Suggested value: 8.
Constraint: if referenced,nsampl>0.
14: fmax Integer Input
On entry: if a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Suggested value: 1000×n.
Constraint: if referenced,fmax1.
15: errest double * Output
On exit: an estimate of the error in the calculated probability.
16: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, pdrc=value and n=value.
Constraint: pdrcn.
On entry, argument value had an illegal value.
On entry, fmax=value.
Constraint: fmax1.
On entry, n=value.
Constraint: 1<n1000.
On entry, nsampl=value.
Constraint: nsampl1.
On entry, numsub=value.
Constraint: numsub1.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
On entry, the information supplied in rc is invalid.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
On entry, nu=value.
Constraint: degrees of freedom nu>0.0.
On entry, k=value.
Constraint: b[k-1]>a[k-1] for a central probability.

7 Accuracy

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

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
g01hdc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g01hdc makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments


10 Example

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

10.1 Program Text

Program Text (g01hdce.c)

10.2 Program Data

Program Data (g01hdce.d)

10.3 Program Results

Program Results (g01hdce.r)