Linda wrote in message <[EMAIL PROTECTED]>... >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?? > >Regards, >Linda
Is MU the mean before truncation? - or afterwards? The ziggurat algorithm seems to be the fastest for generating exponentially-distributed RV's. You can then simply scale them, by multiplying by the mean BEFORE truncation, and then throw away any which exceed the upper bound. -- Alan Miller (Honorary Research Fellow, CSIRO Mathematical & Information Sciences) http://www.ozemail.com.au/~milleraj http://users.bigpond.net.au/amiller/ ================================================================= Instructions for joining and leaving this list, remarks about the problem of INAPPROPRIATE MESSAGES, and archives are available at http://jse.stat.ncsu.edu/ =================================================================