NAG CPP Interface
nagcpp::stat::prob_students_t_noncentral (g01gb)

1 Purpose

prob_students_t_noncentral returns the lower tail probability for the noncentral Student's t-distribution.

2 Specification

#include "g01/nagcpp_g01gb.hpp"
double prob_students_t_noncentral(const double t, const double df, const double delta, OptionalG01GB opt)
double prob_students_t_noncentral(const double t, const double df, const double delta)

3 Description

The lower tail probability of the noncentral Student's t-distribution with ν degrees of freedom and noncentrality parameter δ, P(Tt:ν;δ), is defined by
P(Tt:ν;δ)=Cν0 (12π- αu-δe-x2/2dx) uν-1e-u2/2du,  ν>0.0  
Cν=1Γ (12ν)2(ν-2)/2 ,   α=tν.  
The probability is computed in one of two ways.
  1. (i)When t=0.0, the relationship to the normal is used:
  2. (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.

4 References

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

5 Arguments

1: t double Input
On entry: t, the deviate from the Student's t-distribution with ν degrees of freedom.
2: df double Input
On entry: ν, the degrees of freedom of the Student's t-distribution.
Constraint: df1.0.
3: delta double Input
On entry: δ, the noncentrality parameter of the Students t-distribution.
4: opt OptionalG01GB Input/Output
Optional parameter container, derived from Optional.
Container for:
This optional parameter may be set using the method OptionalG01GB::tol and accessed via OptionalG01GB::get_tol.
Default: 0.0
On entry: the absolute accuracy required by you in the results. If prob_students_t_noncentral is entered with tol greater than or equal to 1.0 or less than 10×machine precision (see precision), the value of 10×machine precision is used instead.
This optional parameter may be set using the method OptionalG01GB::maxit and accessed via OptionalG01GB::get_maxit.
Default: 100
On entry: the maximum number of terms that are used in each of the summations.
Suggested value: 100. See Section 9 for further comments.
Constraint: maxit1.

6 Exceptions and Warnings

Errors or warnings detected by the function:
If on exit errorid0, then prob_students_t_noncentral returns 0.0.
All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of opt.ifail, depending on how errors and warnings are being handled (see Error Handling for more details).
Raises: ErrorException
On entry, df=value.
Constraint: df1.0.
On entry, maxit = value.
Constraint: maxit 1.
Unable to calculate the probability as it is too close to zero or one.
An unexpected error has been triggered by this routine.
Your licence key may have expired or may not have been installed correctly.
Dynamic memory allocation failed.
Raises: WarningException
One of the series has failed to converge with maxit = value
and tol=value.
Reconsider the requested tolerance and/or the maximum number of iterations.
The probability is too close to 0 or 1.
The returned value should be a reasonable estimate of the true value.

7 Accuracy

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.

8 Parallelism and Performance

Please see the description for the underlying computational routine in this section of the FL Interface documentation.

9 Further Comments

The rate of convergence of the series depends, in part, on the quantity t2/(t2+ν). The smaller this quantity the faster the convergence. Thus for large t 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 t-distribution to the F-distribution can be used:
F=T2,λ=δ2,ν1=1  and  ν2=ν,  
and a call made to g01gdf (no CPP interface).
Note that prob_students_t_noncentral only allows degrees of freedom greater than or equal to 1 although values between 0 and 1 are theoretically possible.

10 Example

This example reads values from, and degrees of freedom for, and noncentrality parameters of the noncentral Student's t-distributions, calculates the lower tail probabilities and prints all these values until the end of data is reached.
Source FileDataResults