Generate a pseudorandom number from a Student's t distribution.
double
which specifies the number of degrees of freedom. It must be positive. A double
which specifies a pseudorandom number from a Student's t distribution.
NextStudentsT
generates pseudo-random numbers from a Student's t distribution with df
degrees of freedom, using a method suggested by Kinderman, Monahan, and Ramage (1977). The method ("TMX" in the reference) involves a representation of the t density as the sum of a triangular density over (-2, 2) and the difference of this and the t density. The mixing probabilities depend on the degrees of freedom of the t distribution. If the triangular density is chosen, the variate is generated as the sum of two uniforms; otherwise, an acceptance/rejection method is used to generate a variate from the difference density.
For degrees of freedom less than 100, NextStudentsT
requires approximately twice the execution time as NextNormalAR
, which generates pseudorandom normal deviates. The execution time of NextStudentsT
increases very slowly as the degrees of freedom increase. Since for very large degrees of freedom the normal distribution and the t distribution are very similar, the user may find that the difference in the normal and the t does not warrant the additional generation time required to use NextStudentsT
instead of NextNormalAR
.
Random Class | Imsl.Stat Namespace | Example