NAG Library Routine Document
G01HDF
1 Purpose
G01HDF returns a probability associated with a multivariate Student's -distribution.
2 Specification
FUNCTION G01HDF ( |
N, TAIL, A, B, NU, DELTA, ISCOV, RC, LDRC, EPSABS, EPSREL, NUMSUB, NSAMPL, FMAX, ERREST, IFAIL) |
REAL (KIND=nag_wp) G01HDF |
INTEGER |
N, ISCOV, LDRC, NUMSUB, NSAMPL, FMAX, IFAIL |
REAL (KIND=nag_wp) |
A(N), B(N), NU, DELTA(N), RC(LDRC,N), EPSABS, EPSREL, ERREST |
CHARACTER(1) |
TAIL(N) |
|
3 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 intergrals, 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 , G01HDF attempts to evaluate probabilities within a requested accuracy , for an approximate integral value , absolute accuracy and relative accuracy .
4 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
5 Parameters
- 1: N – INTEGERInput
On entry: , the number of dimensions.
Constraint:
.
- 2: TAIL(N) – CHARACTER(1) arrayInput
On entry: 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 .
- 3: A(N) – REAL (KIND=nag_wp) arrayInput
On entry:
, for
, the lower integral limits of the calculation.
If , is not referenced and the th lower limit of integration is .
- 4: B(N) – REAL (KIND=nag_wp) arrayInput
On entry:
, for
, the upper integral limits of the calculation.
If , is not referenced and the th upper limit of integration is .
Constraint:
if , .
- 5: NU – REAL (KIND=nag_wp)Input
On entry: , the degrees of freedom.
Constraint:
.
- 6: DELTA(N) – REAL (KIND=nag_wp) arrayInput
On entry: the noncentrality parameter for the th dimension, for ; set for the central probability.
- 7: ISCOV – INTEGERInput
On entry: set if the covariance matrix is supplied and if the correlation matrix is supplied.
Constraint:
or .
- 8: RC(LDRC,N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the lower triangle of the matrix must contain the covariance matrix if or the correlation matrix if .
On exit: the strict upper triangle of
RC contains the correlation matrix used in the calculations.
- 9: LDRC – INTEGERInput
On entry: the first dimension of the array
RC as declared in the (sub)program from which G01HDF is called.
Constraint:
.
- 10: EPSABS – REAL (KIND=nag_wp)Input
On entry:
, the absolute accuracy requested in the approximation. If
EPSABS is negative, the absolute value is used.
Suggested value:
.
- 11: EPSREL – REAL (KIND=nag_wp)Input
On entry:
, the relative accuracy requested in the approximation. If
EPSREL is negative, the absolute value is used.
Suggested value:
.
- 12: NUMSUB – INTEGERInput
On entry: if quadrature is used, the number of sub-intervals; otherwise
NUMSUB is not referenced.
Suggested value:
.
Constraint:
if referenced, .
- 13: NSAMPL – INTEGERInput
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:
Constraint:
if referenced, .
- 14: FMAX – INTEGERInput
On entry: if a number theoretic approach is used, the maximum number of evaluations for each integrand function.
Suggested value:
Constraint:
if referenced, .
- 15: ERREST – REAL (KIND=nag_wp)Output
On exit: an estimate of the error in the calculated probability.
- 16: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: and .
-
On entry, .
Constraint: , or .
-
On entry, .
Constraint: for a central probability.
-
On entry, .
Constraint: degrees of freedom .
-
On entry, .
Constraint: or .
-
On entry, the information supplied in
RC is invalid.
-
On entry, and .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
7 Accuracy
An estimate of the error in the calculation is given by the value of
ERREST on exit.
None.
9 Example
This example prints two probabilities from the Student's -distribution.
9.1 Program Text
Program Text (g01hdfe.f90)
9.2 Program Data
Program Data (g01hdfe.d)
9.3 Program Results
Program Results (g01hdfe.r)