Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Anon.
Posts:
379
Registered:
6/2/05
|
|
Re: how to generate a random number following truncated Weibull distribution?
Posted:
Jul 8, 2006 3:38 PM
|
|
john2 wrote: > Lucy wrote: >> Hi all, >> >> I want to generate random numbers that follow truncated Weibull >> distribution. >> >> In Matlab, there is a "wblcdf" function that can generate Weibull >> random numbers, but their support spams the half-line (0, +inf). But >> that's not what I want, I want to derive and generate random numbers >> that fall in (0, d), where "d" is a positive constant. I call this >> "Truncated Weibull distribution", but I am not sure if there is such a >> name existing. >> > > > Usually what is required is just the part of the pdf on [0,d] but > rescaled by its cumulative distribution D(x) value at d. > So W'(x) = W(x)/D(d) 0<x<d > where W(x) is a standard Weibull on [0, inf] > If you're generating random numbers, simply use a standard Weibull, > discard the values which exceed d, and resample, which is the same thing. > That might not be efficient, if D(d)<<1. If it's not, then there are other ideas, such as rejection sampling (which is actually what you're suggesting, but a more efficient proposal distribution could be used), or slice sampling (http://www.cs.toronto.edu/~radford/slice-aos.abstract.html). I'm not going to claim that any one method is better than another, but at least the OP has a couple more options.
Bob
-- Bob O'Hara Department of Mathematics and Statistics P.O. Box 68 (Gustaf Hällströmin katu 2b) FIN-00014 University of Helsinki Finland
Telephone: +358-9-191 51479 Mobile: +358 50 599 0540 Fax: +358-9-191 51400 WWW: http://www.RNI.Helsinki.FI/~boh/ Journal of Negative Results - EEB: www.jnr-eeb.org
|
|
|
|