in reply to Re: Need technique for generating constrained random data sets
in thread Need technique for generating constrained random data sets
I suspect that there was originally the idea of using a normal distribution, but then the switch to a flat distribution was done because of boundaries at 0 and 100.
An alternative would be to use a bounded probability distribution like the Beta distribution or the Kumaraswamy distribution.
I keep meaning to implement Kumaraswamy in Math::Random::OO one of these days. (Right after I fix it to use Math::Random::MT::Auto as the underlying generator and recode other transformations in XS.)
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|