C Library Functions  - hfnran (3)

NAME

hfnran(3f) - [M_datapac:RANDOM] generate half-normal random numbers

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References

SYNOPSIS

SUBROUTINE HFNRAN(N,Iseed,X)

       INTEGER,intent(in)         :: N
       INTEGER,intent(inout)      :: Iseed
       REAL(kind=wp),intent(out)  :: X(:)

DESCRIPTION

HFNRAN(3f) generates a random sample of size n from the halfnormal distribution.

The prototype halfnormal distribution used herein has mean = sqrt(2/pi) = 0.79788456 and standard deviation = 1. this distribution is defined for all non-negative X and has the probability density function

       f(X) = (2/sqrt(2*pi)) * exp(-X*X/2).

The prototype halfnormal distribution used herein is the distribution of the variate X = abs(Z) where the variate Z is normally distributed with mean = 0 and standard deviation = 1.

INPUT ARGUMENTS

N = The desired integer number of random numbers to be generated.

ISEED An integer iseed 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.

OUTPUT ARGUMENTS

X = A vector (of dimension at least N) into which the generated random sample from the halfnormal distribution will be placed.

EXAMPLES

Sample program:

   program demo_hfnran
   use M_datapac, only : hfnran
   implicit none
   ! call hfnran(x,y)
   end program demo_hfnran

Results:

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0

REFERENCES

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 53, 59, 81, 83.


Nemo Release 3.1 hfnran (3) July 22, 2023
Generated by manServer 1.08 from f7047ace-68e9-4836-8ddd-a7c55d513cfa using man macros.