Chapter 12: Random Number Generation

random_student_t

Generates pseudorandom numbers from a Student's t distribution.

Synopsis

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

Required Arguments

int n_random   (Input)
Number of random numbers to generate.

float df   (Input)
Degrees of freedom. Parameter df must be positive.

Return Value

An array of length n_random containing the random deviates of a Student's t distribution.

Synopsis with Optional Arguments

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

Optional Arguments

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.

Description

Function imsls_f_random_student_t generates pseudorandom numbers from a Student's t distribu­tion 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 tri­angular 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.
Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260