In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Linda) wrote:

>I want to generate a series of random variables, X with exponential
>PDF with a given mean,MU value. However, I only want X to be in some
>specified lower and upper limit?? Say between 0 -> 150 i.e. rejected
>anything outside this range Does anyone have any ideas how should I do
>that??

I am a little unclear on what you want. A random variable with an 
exponential distribution has no upper bound. Are you looking for a 
random deviate from a truncated distribution?

In any case, X = -ln(U) where U is a uniform random deviate will be 
exponentially distributed with lambda = 1. For a different lambda simply 
scale -ln(U) by a suitable constant. To have a different minimum, simply 
add whatever offset you want. To truncate the distribution, simply throw 
away values above the desired limit. Note this can be made a bit more 
computationally efficient by truncating the uniform distribution prior 
to taking the logartithm.

-- 
-
PGPKey fingerprint: 6DA1 E71F EDFC 7601 0201  9243 E02A C9FD EF09 EAE5


=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at
                  http://jse.stat.ncsu.edu/
=================================================================

Reply via email to