naginterfaces.library.rand.dist_students_t¶
- naginterfaces.library.rand.dist_students_t(n, df, statecomm)[source]¶
dist_students_t
generates a vector of pseudorandom numbers taken from a Student’s -distribution with degrees of freedom.For full information please refer to the NAG Library document for g05sn
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g05/g05snf.html
- Parameters
- nint
, the number of pseudorandom numbers to be generated.
- dfint
, the number of degrees of freedom of the distribution.
- statecommdict, RNG communication object, modified in place
RNG communication structure.
This argument must have been initialized by a prior call to
init_repeat()
orinit_nonrepeat()
.
- Returns
- xfloat, ndarray, shape
The pseudorandom numbers from the specified Student’s -distribution.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, [‘state’] vector has been corrupted or not initialized.
- Notes
The distribution has PDF (probability density function)
dist_students_t
calculates the valueswhere the are generated by
dist_normal()
from a Normal distribution with mean and variance , and the are generated bydist_gamma()
from a gamma distribution with parameters and (i.e., from a -distribution with degrees of freedom).One of the initialization functions
init_repeat()
(for a repeatable sequence if computed sequentially) orinit_nonrepeat()
(for a non-repeatable sequence) must be called prior to the first call todist_students_t
.
- References
Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley