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

*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

$$P\left(T<{t}_{p}:\nu \right)=p=\frac{\Gamma \left(\left(\nu +1\right)/2\right)}{\sqrt{\nu \pi}\Gamma \left(\nu /2\right)}\underset{-\infty}{\overset{{t}_{p}}{\int}}{\left(1+\frac{{T}^{2}}{\nu}\right)}^{-\left(\nu +1\right)/2}dT\text{, \hspace{1em}}\nu \ge 1\text{;}-\infty <{t}_{p}<\infty \text{.}$$ |

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*ButterworthHill 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:

- ${\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.

# 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.

# Further Comments

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