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_stat_prob_students_t_noncentral (g01gb)


nag_stat_prob_students_t_noncentral (g01gb) returns the lower tail probability for the noncentral Student's tt-distribution.


[result, ifail] = g01gb(t, df, delta, 'tol', tol, 'maxit', maxit)
[result, ifail] = nag_stat_prob_students_t_noncentral(t, df, delta, 'tol', tol, 'maxit', maxit)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 23: tol now optional (default 0)


The lower tail probability of the noncentral Student's tt-distribution with νν degrees of freedom and noncentrality parameter δδ, P(Tt : ν;δ)P(Tt:ν;δ), is defined by
P(Tt : ν;δ) = Cν
( αuδ )
1/(sqrt(2π))ex2 / 2dx
uν1eu2 / 2du,  ν > 0.0
P(Tt:ν;δ)=Cν0 (12π- αu-δe-x2/2dx) uν-1e-u2/2du,  ν>0.0
Cν = 1/(Γ ((1/2)ν)2(ν2) / 2),   α = t/(sqrt(ν)).
Cν=1Γ (12ν )2(ν- 2)/2 ,   α=tν.
The probability is computed in one of two ways.
(i) When t = 0.0t=0.0, the relationship to the normal is used:
P(Tt : ν;δ) = 1/(sqrt(2π))eu2 / 2du.
(ii) Otherwise the series expansion described in Equation 9 of Amos (1964) is used. This involves the sums of confluent hypergeometric functions, the terms of which are computed using recurrence relationships.


Amos D E (1964) Representations of the central and non-central tt-distributions Biometrika 51 451–458


Compulsory Input Parameters

1:     t – double scalar
tt, the deviate from the Student's tt-distribution with νν degrees of freedom.
2:     df – double scalar
νν, the degrees of freedom of the Student's tt-distribution.
Constraint: df1.0df1.0.
3:     delta – double scalar
δδ, the noncentrality parameter of the Students tt-distribution.

Optional Input Parameters

1:     tol – double scalar
The absolute accuracy required by you in the results. If nag_stat_prob_students_t_noncentral (g01gb) is entered with tol greater than or equal to 1.01.0 or less than 10 × machine precision10×machine precision (see nag_machine_precision (x02aj)), then the value of 10 × machine precision10×machine precision is used instead.
Default: 0.00.0
2:     maxit – int64int32nag_int scalar
The maximum number of terms that are used in each of the summations.
Default: 100100. See Section [Further Comments] for further comments.
Constraint: maxit1maxit1.

Input Parameters Omitted from the MATLAB Interface


Output Parameters

1:     result – double scalar
The result of the function.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 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 ifail0ifail0, then nag_stat_prob_students_t_noncentral (g01gb) returns 0.00.0.
  ifail = 1ifail=1
On entry,df < 1.0df<1.0.
  ifail = 2ifail=2
On entry,maxit < 1maxit<1.
  ifail = 3ifail=3
One of the series has failed to converge. Reconsider the requested tolerance and/or maximum number of iterations.
  ifail = 4ifail=4
The probability is too small to calculate accurately.


The series described in Amos (1964) are summed until an estimated upper bound on the contribution of future terms to the probability is less than tol. There may also be some loss of accuracy due to calculation of gamma functions.

Further Comments

The rate of convergence of the series depends, in part, on the quantity t2 / (t2 + ν)t2/(t2+ν). The smaller this quantity the faster the convergence. Thus for large tt and small νν the convergence may be slow. If νν is an integer then one of the series to be summed is of finite length.
If two tail probabilities are required then the relationship of the tt-distribution to the FF-distribution can be used:
F = T2,λ = δ2,ν1 = 1  and  ν2 = ν,
F=T2,λ=δ2,ν1=1  and  ν2=ν,
and a call made to nag_stat_prob_f_noncentral (g01gd).
Note that nag_stat_prob_students_t_noncentral (g01gb) only allows degrees of freedom greater than or equal to 11 although values between 00 and 11 are theoretically possible.


function nag_stat_prob_students_t_noncentral_example
t = -1.528;
df = 20;
delta = 2;
[result, ifail] = nag_stat_prob_students_t_noncentral(t, df, delta)

result =


ifail =


function g01gb_example
t = -1.528;
df = 20;
delta = 2;
[result, ifail] = g01gb(t, df, delta)

result =


ifail =


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–2013