#### 52.2.2 Student’s t Random Variable

Student’s t random variable is denoted by t(n) where n is the degrees of freedom with n > 0. If Z is a \({\it Normal}(0, 1)\) variable and V is an independent \(\chi^2\) random variable with n degress of freedom, then

$$ Z \over \sqrt{V/n} $$

has a Student’s t-distribution with n degrees of freedom.

Function: pdf_student_t (x,n)

  Returns the value at x of the density function of a Student random variable t(n), with n>0 degrees of freedom. To make use of this function, write first `load("distrib")`.

  The pdf is $$ f(x; n) = \left[\sqrt{n} B\left({1\over 2}, {n\over 2}\right)\right]^{-1} \left(1+{x^2\over n}\right)^{\displaystyle -{n+1\over 2}} $$

  Categories:Package distrib ·

Function: cdf_student_t (x,n)

  Returns the value at x of the distribution function of a Student random variable t(n), with n>0 degrees of freedom.

  The cdf is $$ F(x; n) = \cases{ 1-\displaystyle{1\over 2} I_t\left({n\over 2}, {1\over 2}\right) & $x \ge 0$ \cr \cr \displaystyle{1\over 2} I_t\left({n\over 2}, {1\over 2}\right) & $x < 0$ } $$

  where \(t = n/(n+x^2)\) and \(I_t(a,b)\) is the beta_incomplete_regularized function.

      (%i1) load ("distrib")$

      (%i2) cdf_student_t(1/2, 7/3);
                                                  7  1  28
                      beta_incomplete_regularized(-, -, --)
                                                  6  2  31
      (%o2)       1 - -------------------------------------
                                        2

      (%i3) float(%);
      (%o3)                  0.6698450596140415

  Categories:Package distrib ·

Function: quantile_student_t (q,n)

  Returns the q-quantile of a Student random variable t(n), with n>0; in other words, this is the inverse of `cdf_student_t`. Argument q must be an element of [0,1]. To make use of this function, write first `load("distrib")`.

  Categories:Package distrib ·

Function: mean_student_t (n)

  Returns the mean of a Student random variable t(n), with n>0. To make use of this function, write first `load("distrib")`.

  The mean is $$ E[X] = 0 $$

  Categories:Package distrib ·

Function: var_student_t (n)

  Returns the variance of a Student random variable t(n), with n>2.

  The variance is $$ V[X] = {n\over n-2} $$

      (%i1) load ("distrib")$

      (%i2) var_student_t(n);
                                      n
      (%o2)                         -----
                                    n - 2

  Categories:Package distrib ·

Function: std_student_t (n)

  Returns the standard deviation of a Student random variable t(n), with n>2. To make use of this function, write first `load("distrib")`.

  The standard deviation is $$ D[X] = \sqrt{\displaystyle{n\over n-2}} $$

  Categories:Package distrib ·

Function: skewness_student_t (n)

  Returns the skewness coefficient of a Student random variable t(n), with n>3, which is always equal to 0. To make use of this function, write first `load("distrib")`.

  The skewness coefficient is $$ SK[X] = 0 $$

  Categories:Package distrib ·

Function: kurtosis_student_t (n)

  Returns the kurtosis coefficient of a Student random variable t(n), with n>4. To make use of this function, write first `load("distrib")`.

  The kurtosis coefficient is $$ KU[X] = {6\over n-4} $$

  Categories:Package distrib ·

Function: random_student_t (n)
`random_student_t` (n,m)

  Returns a Student random variate t(n), with n>0. Calling `random_student_t` with a second argument m, a random sample of size m will be simulated.

  The implemented algorithm is based on the fact that if Z is a normal random variable \({\it Normal}(0, 1)\) and S^2 is a \(\chi^2\) random variable with n degrees of freedom, \(\chi^2(n)\), then

  $$ X={{Z}\over{\sqrt{{S^2}\over{n}}}} $$

  is a Student random variable with n degrees of freedom, t(n).

  To make use of this function, write first `load("distrib")`.

  Categories:Package distrib ·Random numbers ·