C Library Functions  - betran (3)

NAME

betran(3f) - [M_datapac:RANDOM] generate beta random numbers

CONTENTS

Synopsis
Description
Options
Output
Examples
Author
Maintainer
License
References

SYNOPSIS

subroutine BETRAN (N,Alpha,Beta,Iseed,X)

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

DESCRIPTION

BETRAN(3f) generates a random sample of size N from the beta distribution with shape parameters ALPHA and BETA.

The prototype beta distribution used herein has

      mean = ALPHA/(ALPHA+BETA)

and

      standard_deviation=sqrt((ALPHA*BETA)/((ALPHA+BETA)**2)*(ALPHA+BETA+1))

This distribution is defined for all X between 0.0 (inclusively) and 1.0 (inclusively) and has the probability density function

      f(x) = (1/constant) * x**(alpha-1) * (1.0-x)**(beta-1)

where the constant = the beta function evaluated at the values ALPHA and BETA.

OPTIONS

N The desired integer number of random numbers to be generated.
ALPHA The value of the first shape parameter. ALPHA should be greater than or equal to 1.0.
BETA The value of the second shape parameter. BETA should be greater than or equal to 1.0.

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

X A random sample of size N from the beta distribution with shape parameter values ALPHA and BETA.

A vector (of dimension at least N) into which the generated random sample will be placed.

EXAMPLES

Sample program:

   program demo_betran
   use M_datapac, only : betran
   implicit none
   ! call betran(x,y)
   end program demo_betran

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 Greenwood, ’A Fast Generator for Beta-distributed Random Variables’, Compstat 1974, Proceedings in Computational Statistics, Vienna, September, 1974, pages 19-27.
o Tocher, The Art of Simulation, 1963, pages 24-27.
o Hammersley and Handscomb, Monte Carlo Methods, 1964, pages 36-37.
o Johnson and Kotz, Continuous Univariate Distributions --2, 1970, pages 37-56.
o Hastings and Peacock, Statistical Distributions--A Handbook For Students and Practitioners, 1975, pages 30-35.
o National Bureau of Standards Applied Mathematics Series 55, 1964, page 952.


Nemo Release 3.1 betran (3) July 22, 2023
Generated by manServer 1.08 from 1ee1b557-fce5-432e-8e8b-3921a705052c using man macros.