tran(3f) - [M_datapac:RANDOM] a random sample of size n from the Students t distribution with integer degrees of freedom parameter NU.
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References
SUBROUTINE TRAN(N,Nu,Iseed,X)
INTEGER,intent(in) :: N INTEGER,intent(in) :: Nu INTEGER,intent(inout) :: Iseed REAL(kind=wp),intent(out) :: X(:)
This subroutine generates a random sample of size N from the Students T distribution with integer degrees of freedom parameter = NU.
N The desired integer number of random numbers to be generated. NU The integer degrees of freedom (parameter) for the T distribution. NU should be a positive integer variable.
ISEED | An integer seed value. Should be set to a non-negative value to start a new sequence of values. Will be set to -1 on return to indicate the next call should continue the current random |
X A vector (of dimension at least N) into which the generated random sample of size N from the Students T distribution will be placed.
Sample program:
program demo_tran use m_datapac, only : tran, plott, label, plotxt, sort implicit none integer,parameter :: n=400 real :: x(n) integer :: iseed integer :: nu call label(tran) nu=3 iseed=12345 call tran(N,Nu,Iseed,X) call plotxt(x,n) call sort(x,n,x) ! sort to show distribution call plotxt(x,n) end program demo_tranResults:
THE FOLLOWING IS A PLOT OF X(I) (VERTICALLY) VERSUS I (HORIZONTALLY I-----------I-----------I-----------I-----------I 0.1029407E+02 - X 0.9486016E+01 I 0.8677961E+01 I 0.7869905E+01 I 0.7061851E+01 I X 0.6253795E+01 I X 0.5445739E+01 - 0.4637684E+01 I 0.3829628E+01 I X X X X 0.3021573E+01 I X X X XX X X X X 0.2213517E+01 I X XX XX X X X X X X 0.1405462E+01 I X XXXX XXXXXXXXXXXX XX XXX XXX XXXXXX 0.5974064E+00 - XX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXX XXX -0.2106485E+00 I XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX -0.1018704E+01 I XX XX XX X XXX XX XXXXXXXXXXXX XX XXXX XX XXX X -0.1826759E+01 I XXXXXX XX XX XX X XX X X X XX XX -0.2634815E+01 I X XX X X X XX -0.3442871E+01 I X X -0.4250926E+01 - X X X X -0.5058982E+01 I X X -0.5867038E+01 I X -0.6675092E+01 I -0.7483148E+01 I -0.8291203E+01 I -0.9099259E+01 - X X I-----------I-----------I-----------I-----------I 0.1000E+01 0.1008E+03 0.2005E+03 0.3002E+03 0.4000E+03THE FOLLOWING IS A PLOT OF X(I) (VERTICALLY) VERSUS I (HORIZONTALLY I-----------I-----------I-----------I-----------I 0.1029407E+02 - X 0.9486016E+01 I 0.8677961E+01 I 0.7869905E+01 I 0.7061851E+01 I X 0.6253795E+01 I X 0.5445739E+01 - 0.4637684E+01 I 0.3829628E+01 I XX 0.3021573E+01 I XX 0.2213517E+01 I XXX 0.1405462E+01 I XXXXXX 0.5974064E+00 - XXXXXXXXXXXX -0.2106485E+00 I XXXXXXXXXXXXXXX -0.1018704E+01 I XXXXXXXXX -0.1826759E+01 I XXXXX -0.2634815E+01 I XX -0.3442871E+01 I X -0.4250926E+01 - X -0.5058982E+01 I X -0.5867038E+01 I X -0.6675092E+01 I -0.7483148E+01 I -0.8291203E+01 I -0.9099259E+01 - X I-----------I-----------I-----------I-----------I 0.1000E+01 0.1008E+03 0.2005E+03 0.3002E+03 0.4000E+03
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
o Mood and Grable, Introduction to the Theory of Statistics, 1963, page 233. o Johnson and Kotz, Continuous Univariate Distributions--2, 1970, page 94. o Hastings and Peacock, Statistical Distributions--A Handbook for Students and Practitioners, 1975, page 121.
Nemo Release 3.1 | tran (3) | February 23, 2025 |