PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_bivariate_students_t (g01hc)
Purpose
nag_stat_prob_bivariate_students_t (g01hc) returns probabilities for the bivariate Student's -distribution.
Syntax
Description
Let the vector random variable
follow a bivariate Student's
-distribution with degrees of freedom
and correlation
, then the probability density function is given by
The lower tail probability is defined by:
The upper tail probability is defined by:
The central probability is defined by:
Calculations use the
Dunnet and Sobel (1954) method, as described by
Genz (2004).
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 (2004) Numerical computation of rectangular bivariate and trivariate Normal and probabilities Statistics and Computing 14 151–160
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
, the degrees of freedom of the bivariate Student's -distribution.
Constraint:
.
- 2:
– double scalar
-
, the correlation of the bivariate Student's -distribution.
Constraint:
.
Optional Input Parameters
- 1:
– double array
-
If upper tail or central probablilities are to be returned,
a should supply the lower bounds,
, for
.
- 2:
– double array
-
If lower tail or central probablilities are to be returned,
b should supply the upper bounds,
, for
.
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– 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:
If on exit, , then nag_stat_prob_bivariate_students_t (g01hc) returns zero.
-
-
On entry, for central probability, for some .
-
-
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
Accuracy of the algorithm implemented here is discussed in comparison with algorithms based on a generalized Placket formula by
Genz (2004), who recommends the Dunnet and Sobel method. This implementation should give a maximum absolute error of the order of
.
Further Comments
None.
Example
This example calculates the bivariate Student's probability given the choice of tail and degrees of freedom, correlation and bounds.
Open in the MATLAB editor:
g01hc_example
function g01hc_example
fprintf('g01hc example results\n\n');
a = [-Inf -Inf;
-40 0;
-2 8];
b = [ 4 0.8;
2 4;
Inf Inf];
tail = {'L'; 'C'; 'U'};
df = int64([ 8; 12; 2 ]);
rho = [ 0.6; -0.2; 0.3 ];
p = rho;
fprintf('%9s%12s%12s%12s%7s%6s%6s%4s\n', 'a(1)', 'b(1)', 'a(2)', ...
'b(2)', 'df', 'rho','tail', 'p');
for j = 1:numel(df)
if tail{j}=='L'
[p(j), ifail] = g01hc( ...
df(j), rho(j), 'b', b(j,:));
elseif tail{j}=='C'
[p(j), ifail] = g01hc( ...
df(j), rho(j), 'a', a(j,:), 'b', b(j,:));
else
[p(j), ifail] = g01hc( ...
df(j), rho(j), 'a', a(j,:));
end
fprintf('%12.4e%12.4e%12.4e%12.4e%4d%7.4f%5s%7.4f\n', a(j,1), b(j,1), ...
a(j,2), b(j,2), df(j), rho(j), tail{j}, p(j));
end
g01hc example results
a(1) b(1) a(2) b(2) df rho tail p
-Inf 4.0000e+00 -Inf 8.0000e-01 8 0.6000 L 0.7764
-4.0000e+01 2.0000e+00 0.0000e+00 4.0000e+00 12-0.2000 C 0.4876
-2.0000e+00 Inf 8.0000e+00 Inf 2 0.3000 U 0.0059
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015