HyperMath

T_Rnd

T_Rnd

Previous topic Next topic No expanding text in this topic  

T_Rnd

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Generates random data from the student t probability distribution. There are two forms.

Syntax

RND = T_Rnd(n, Rows, Cols, Seed, State)

RND = T_Rnd(n, Seed, State)

Arguments

Name

Description

 

n

Degrees of freedom parameter. A scalar, vector or matrix of positive integers.

 

Rows

(optional)

Number of output rows. A positive integer. Only valid when n is scalar.

 

Cols

(optional)

Number of output columns. A positive integer. Only valid when n is a scalar.

 

Seed

(optional)

The seed to initialize the random number generator. A positive integer. See Comments below.

 

State

(optional)

Set to "discard" if the state of the pseudo random number is not to be retained for future use. The default is "retain".

Outputs

Name

Description

 

RND

Random numbers from the student t distribution. Its dimensions are determined by the input arguments. See Comments below.

Example 1

Generate two random numbers from the student t distribution with n = 5 and 3 respectively, with a random seed of 2003

 

Syntax

 

rnd = T_Rnd([5,3],2003)

 

Results

 

rnd = -2.5509    1.4237

Example 2

Generate a 1x4 vector of random numbers from the student t distribution with n = 5, and a random seed of 2003.

 

Syntax

 

rnd = T_Rnd(5,1,4,2003)

 

Results

 

rnd = -2.5509    1.4237    -0.53733    -0.17536

Comments

If the optional size inputs are omitted, the size of the output is solely determined by the size of the input n. Each entry in the output uses the corresponding entries in the input n.

If the optional size inputs are provided, both must be supplied. In that case n must be a scalar and the size of the output is determined by Rows and Cols. That is, the input n is used for each element of the output.

The Seed can be any number. Using a seed allows a random sequence to be repeated.

See Also:

T_CDF

T_InvCDF

T_PDF

Probability Distributions