g05fbf

g05fbf © Numerical Algorithms Group, 2002.

Purpose

G05FBF Generates a vector of pseudo-random numbers from a (negative) exponential distribution

Synopsis

[x] = g05fbf(a,n)

Description

 
 The distribution has PDF (probability density function)
 
           1 -x/a 
     f(x)= -e     if x>0,
           a      
 
     f(x)=0       otherwise.
 
 The routine returns the values
 
                             x =-a*ln(y ) 
                              i        i
 
 where y  are the next n numbers generated by the basic uniform 
        i                                                      
 (0,1) generator.
 

Parameters

g05fbf

Required Input Arguments:

a                                     real
n                                     integer

Output Arguments:

x (n)                                 real