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??

        For untruncated exponential RV's the negative-log method of converting
a uniform [0,1] RV is about as good as you can get:

        ExpVar = -ln(UnifVar); 

 It can easily be adjusted to censor to any interval [a,b] by prescaling
onto [exp(-b),exp(-a)];

        TruncExpVar = -ln(exp(-b) + (exp(-a)-exp(-b))*UnifVar);


        -R. Dawson


=================================================================
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