Generates pseudorandom numbers from a Student’s t distribution.
#include <imsls.h>
float *imsls_f_random_student_t (int n_random, float df, ..., 0)
The type double function is imsls_d_random_student_t.
int n_random
(Input)
Number of random numbers to generate.
float df
(Input)
Degrees of freedom. Parameter df must be
positive.
An array of length n_random containing the random deviates of a Student’s t distribution.
#include <imsls.h>
float
*imsls_f_random_student_t (int n_random, float df,
IMSLS_RETURN_USER, float r[],
IMSLS_MEAN, float
mean,
IMSLS_VARIANCE, float
variance,
0)
IMSLS_MEAN, float mean
(Input)
Mean of the Student’s t
distribution.
Default: mean =
0.0
IMSLS_VARIANCE, float variance
(Input)
Variance of the Student’s t
distribution.
Default: variance =
1.0
IMSLS_RETURN_USER, float r[]
(Output)
User-supplied array of length n_random containing
the random Student’s t deviates.
Function imsls_f_random_student_t generates pseudorandom numbers from a Student’s t distribution with df degrees of freedom, using a method suggested by Kinderman et al. (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 the difference density.
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |