parran(3f) - [M_datapac:RANDOM] generate Pareto random numbers
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References
SUBROUTINE PARRAN(N,Gamma,Iseed,X)
INTEGER :: N REAL(kind=wp) :: Gamma INTEGER :: Iseed REAL(kind=wp) :: X(:)
PARRAN(3f) generates a random sample of size N from the Pareto distribution with tail length parameter value = GAMMA.The prototype Pareto distribution used herein is defined for all X greater than or equal to 1, and has the probability density function
f(X) = GAMMA / (X**(GAMMA+1))
N The desired integer number of random numbers to be generated. GAMMA The value of the tail length parameter. GAMMA should be positive. 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 sequence walk.
X A vector (of dimension at least N) into which the generated random sample from the Pareto distribution will be placed.
Sample program:
program demo_parran use m_datapac, only : parran, plott, label, plotxt, sort implicit none integer,parameter :: n=4000 real :: x(n) integer :: iseed real :: gamma call label(parran) gamma=3.4 iseed=12345 call parran(n,gamma,iseed,x) call plotxt(x,n) call sort(x,n,x) ! sort to show distribution call plotxt(x,n) end program demo_parranResults:
THE FOLLOWING IS A PLOT OF X(I) (VERTICALLY) VERSUS I (HORIZONTALLY I-----------I-----------I-----------I-----------I 0.1956372E+02 - X 0.1879024E+02 I 0.1801675E+02 I 0.1724326E+02 I 0.1646978E+02 I 0.1569629E+02 I 0.1492280E+02 - 0.1414931E+02 I 0.1337583E+02 I 0.1260234E+02 I 0.1182885E+02 I 0.1105537E+02 I X 0.1028188E+02 - 0.9508391E+01 I 0.8734904E+01 I X 0.7961417E+01 I X 0.7187930E+01 I 0.6414443E+01 I X X X XX 0.5640956E+01 - X XX XX 0.4867469E+01 I X X X X XX X X X X 0.4093982E+01 I X X X XX X XX X X X X X 0.3320494E+01 I X X XX XXXXXX X XXX XXX XXX XXXXX XXX XXX X XXXXX 0.2547007E+01 I XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0.1773520E+01 I XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0.1000033E+01 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX I-----------I-----------I-----------I-----------I 0.1000E+01 0.1001E+04 0.2000E+04 0.3000E+04 0.4000E+04THE FOLLOWING IS A PLOT OF X(I) (VERTICALLY) VERSUS I (HORIZONTALLY I-----------I-----------I-----------I-----------I 0.1956372E+02 - X 0.1879024E+02 I 0.1801675E+02 I 0.1724326E+02 I 0.1646978E+02 I 0.1569629E+02 I 0.1492280E+02 - 0.1414931E+02 I 0.1337583E+02 I 0.1260234E+02 I 0.1182885E+02 I 0.1105537E+02 I X 0.1028188E+02 - 0.9508391E+01 I 0.8734904E+01 I X 0.7961417E+01 I X 0.7187930E+01 I 0.6414443E+01 I X 0.5640956E+01 - X 0.4867469E+01 I X 0.4093982E+01 I XX 0.3320494E+01 I X 0.2547007E+01 I XXXX 0.1773520E+01 I XXXXXXXXXXXXX 0.1000033E+01 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX I-----------I-----------I-----------I-----------I 0.1000E+01 0.1001E+04 0.2000E+04 0.3000E+04 0.4000E+04
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 Tocher, The Art of Simulation, 1963, pages 14-15. o Hammersley and Handscomb, Monte Carlo Methods, 1964, page 36. o Johnson and Kotz, Continuous Univariate Distributions--1, 1970, pages 233-249. o Hastings and Peacock, Statistical Distributions--A Handbook for Students and Practitioners, 1975, page 104.
Nemo Release 3.1 | parran (3) | February 23, 2025 |