From: Gavin Sinclair Date: 2004-08-15T12:52:12+09:00 Subject: Re: Random variable library? On Sunday, August 15, 2004, 9:11:08 AM, Paul wrote: >> Yes, but what about: "give me a normal distribution between 0 and 10"? >> That probably doesn't make sense without some extra parameters, but >> they can be defaults/derived. > Don't take this personally, but this is where I start getting nervous. > A normal distribution is characterized _entirely_ by its mean and > variance, and has an infinite range. If what you want falls between 0 > and 10, then it ain't normal. That's fine and understood. I'm not looking for distributed random numbers for probability analysis, just for node placement and cluster sizes in a network simulation. There's no scientific validity riding on the values pumped out of the RNG. To use the 0-10 example, if the distribution has mean 5 and std-dev 2, then only a tiny portion of generated numbers will fall outside of (0..10). Those numbers are insignificant to me (not to others, I appreciate), so I can just regenerate until I get a value I want. That makes me realise: the "window" aspect of this (only seeing values within a certain range) is a superficial operation that can be applied seperately from any actual generation and distribution, with themselves are two different layers. >> Then I'd like to be able to bias it as well, if that makes sense. So >> you can have a "normal" distribution between 0 and 10, biased so that >> the center is on 3 instead of 5. >> >> IF that makes sense... :/ > Sorry, but no it doesn't. The normal distribution is symmetric about > its mean. If you want an assymetric distribution (the term is "skewed", > not "biased"), then once again it ain't normal. So I have two choices: either apply a (0..10) window to a Normal(3,2) distribution, or go and learn about asymmetric distributions. (I suspect you can have a plain "skewed distribution" applied to any other distribution to get the result I want.) > If you're going to do probability modeling, you need to understand the > models or you're going to get in trouble. Somebody already suggested > Ross's book, I'll put in my 2-cents for taking a look at "Simulation > Modeling and Analysis" by Law & Kelton. It has a good review of prob & > stats and a very comprehensive discussion of the theory and algorithms > for random variate generation. Like I said, I'm not doing probability modeling, but I'll still be interested to read about these things in more detail. > I know that usenet posts can come across as harsh, and that's not my > intention. Please accept this response as a strong caution rather than > as a put-down. Not at all; thanks very much for the input. You've educated me and helped to clarify my aims. Gavin