dexran(3f) - [M_datapac:RANDOM] generate double exponential random numbers
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References
subroutine dexran(N,Istart,X)
integer,intent(in) :: N integer,intent(inout) :: Istart real(kind=wp) :: X(:)
DEXRAN(3f) generates a random sample of size n from the double exponential (Laplace) distribution with mean = 0 and standard deviation = sqrt(2).This distribution is defined for all X and has the probability density function
f(X) = 0.5*exp(-abs(X))
N The desired integer number of random numbers to be generated. ISTART An integer flag code which (if set to 0) will start the generator over and hence produce the same random sample over and over again upon successive calls to this subroutine within a run; or (if set to some integer value not equal to 0, like, say, 1) will allow the generator to continue from where it stopped and hence produce different random samples upon successive calls to this subroutine within a run.
X A REAL vector (of dimension at least N) into which the generated random sample will be placed.
Sample program:
program demo_dexran use M_datapac, only : dexran implicit none ! call dexran(x,y) end program demo_dexranResults:
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 Filliben, Simple and Robust Linear Estimation of the Location Parameter of a Symmetric Distribution (Unpublished PH.D. dissertation, Princeton University), 1969, page 231. o Filliben, The percent point function, (Unpublished manuscript), 1970, pages 28-31. o Johnson and Kotz, Continuous Univariate Distributions--2, 1970, pages 22-36.
Nemo Release 3.1 | dexran (3) | February 23, 2025 |