﻿ g01fb Method
g01fb returns the deviate associated with the given tail probability of Student's $t$-distribution with real degrees of freedom.

# Syntax

C#
```public static double g01fb(
string tail,
double p,
double df,
out int ifail
)```
Visual Basic
```Public Shared Function g01fb ( _
tail As String, _
p As Double, _
df As Double, _
<OutAttribute> ByRef ifail As Integer _
) As Double```
Visual C++
```public:
static double g01fb(
String^ tail,
double p,
double df,
[OutAttribute] int% ifail
)```
F#
```static member g01fb :
tail : string *
p : float *
df : float *
ifail : int byref -> float
```

#### Parameters

tail
Type: System..::..String
On entry: indicates which tail the supplied probability represents.
${\mathbf{tail}}=\text{"U"}$
The upper tail probability, i.e., $P\left(T\ge {t}_{p}:\nu \right)$.
${\mathbf{tail}}=\text{"L"}$
The lower tail probability, i.e., $P\left(T\le {t}_{p}:\nu \right)$.
${\mathbf{tail}}=\text{"S"}$
The two tail (significance level) probability, i.e., $P\left(T\ge \left|{t}_{p}\right|:\nu \right)+P\left(T\le -\left|{t}_{p}\right|:\nu \right)$.
${\mathbf{tail}}=\text{"C"}$
The two tail (confidence interval) probability, i.e., $P\left(T\le \left|{t}_{p}\right|:\nu \right)-P\left(T\le -\left|{t}_{p}\right|:\nu \right)$.
Constraint: ${\mathbf{tail}}=\text{"U"}$, $\text{"L"}$, $\text{"S"}$ or $\text{"C"}$.
p
Type: System..::..Double
On entry: $p$, the probability from the required Student's $t$-distribution as defined by tail.
Constraint: $0.0<{\mathbf{p}}<1.0$.
df
Type: System..::..Double
On entry: $\nu$, the degrees of freedom of the Student's $t$-distribution.
Constraint: ${\mathbf{df}}\ge 1.0$.
ifail
Type: System..::..Int32%
On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

#### Return Value

g01fb returns the deviate associated with the given tail probability of Student's $t$-distribution with real degrees of freedom.

# Description

The deviate, ${t}_{p}$ associated with the lower tail probability, $p$, of the Student's $t$-distribution with $\nu$ degrees of freedom is defined as the solution to
 $PT
For $\nu =1\text{​ or ​}2$ the integral equation is easily solved for ${t}_{p}$.
For other values of $\nu <3$ a transformation to the beta distribution is used and the result obtained from g01fe.
For $\nu \ge 3$ an inverse asymptotic expansion of Cornish–Fisher type is used. The algorithm is described by Hill (1970).

# References

Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Hill G W (1970) Student's $t$-distribution Comm. ACM 13(10) 617–619

# Error Indicators and Warnings

Note: g01fb may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
If ${\mathbf{ifail}}={1}$${2}$ or ${3}$ on exit, then g01fb returns zero.
${\mathbf{ifail}}=1$
 On entry, ${\mathbf{tail}}\ne \text{"U"}$, $\text{"S"}$, $\text{"C"}$ or $\text{"L"}$.
${\mathbf{ifail}}=2$
 On entry, ${\mathbf{p}}\le 0.0$, or ${\mathbf{p}}\ge 1.0$.
${\mathbf{ifail}}=3$
 On entry, ${\mathbf{df}}<1.0$.
${\mathbf{ifail}}=5$
Convergence in the calculation of the inverse beta value was not achieved. However, the result should be a reasonable approximation to the correct value.
${\mathbf{ifail}}=-9000$
An error occured, see message report.

# Accuracy

The results should be accurate to five significant digits, for most parameter values. The error behaviour for various parameter values is discussed in Hill (1970).

# Parallelism and Performance

None.

The value ${t}_{p}$ may be calculated by using the transformation described in [Description] and using g01fe. This method allows you to set the required accuracy.

# Example

This example reads the probability, the tail that probability represents and the degrees of freedom for a number of Student's $t$-distributions and computes the corresponding deviates.

Example program (C#): g01fbe.cs

Example program data: g01fbe.d

Example program results: g01fbe.r