### 8.4.6 Student’s distribution

#### The probability density function for Student’s distribution: student studentd

Student’s distribution (also called Student’s t-distribution or just the t-distribution) with n degrees of freedom has density function given by

student(n,x) = |
Γ((n+1)/2)
Γ(n/2) | √ |
nπ
| ⎛ ⎜ ⎜ ⎝ | 1 + |
x2
n
| ⎞ ⎟ ⎟ ⎠ |
−n−1/2

where recall the Gamma function is defined for x>0 by Γ(x) = ∫0∞e−ttx−1dx. If you enter

student(2,3)

you will get

sqrt(pi)/(11*sqrt(2*pi)*sqrt(11/2))

which can be numerically approximated by

evalf(student(2,3))

which is

0.0274101222343

#### The cumulative distribution function for Student’s distribution: student_cdf

The cumulative distribution function for Student’s distribution with n degrees of freedom at a value x is student_cdf(n,x) = Prob(X ≤ x); if you enter

student_cdf(5,2)

you will get

0.949030260585

If you give student_cdf an extra argument, you will get the probability that the random variable lies between two values; student_cdf(n,x,y) = Prob(x ≤ X ≤ y). If you enter

student_cdf(5,-2,2)

you will get

0.89806052117

#### The inverse distribution function for Student’s distribution: student_icdf

The inverse distribution function for Student’s distribution with n degrees of freedom is computed with student_icdf(n,h); recall that this will return the value x with student_cdf(n,x) = h. If you enter

student_icdf(5,0.95)

you will get

2.01504837333

#### The upper tail cumulative function for Student’s distribution: UTPT

The UTPT (the Upper Tail Probability - T distribution) will compute Prob(X > x). If you enter

UTPT(5,2)

you will get

0.0509697394149