[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: exponential distribution

From   "Nick Cox" <>
To   <>
Subject   RE: st: exponential distribution
Date   Wed, 20 Feb 2008 13:14:08 -0000

Austin is naturally correct. But as (1 - uniform(x)) has the same
distribution as uniform(x) 
his expression can be simplified without loss to 

g e1 = -ln(uniform()) 


Austin Nichols

The general approach is to take the cumulative distribution function
F(x) and solve for x in terms of F.  Then replace F with uniform() and
you are done:

so for lambda=1, you can
g e1=-ln(1-uniform())

On Feb 19, 2008 9:02 PM, Jon Schwabish <> wrote:
> Does anyone know how to create an exponential
> distribution with a mean of 1 to use as random
> numbers? I believe it's a tweak on exp=-ln(uniform()),
> but am not sure.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index