|
Post by u9 on Feb 10, 2007 14:56:25 GMT -5
I wasn't sure where to post this. But about the math.GausseInRange method.
1: Why is it not called GaussInRange? Where does the e come from?
2: What is the input? Is it the standard diviation?
The name to me is a bit strange. In MATLAB they call the function randn because it returns a random value with a normal (Gaussian) distribution.
|
|
|
Post by Guilect on Feb 10, 2007 19:15:46 GMT -5
I guess I thought that that is how it was spelled.
it is the range , +/-, that you would like the randomness to cover. If you specify a Guassian distribution with a range of +/- 10 then you could get values from -10 to +10. Most being around 0.
I am not familiar with 'randn'. But I think it would be consistant with other rnd-like commands. I believe it will be renamed 'randn' in the next release.
|
|
|
Post by u9 on Feb 10, 2007 19:54:13 GMT -5
...I am not familiar with 'randn'. But I think it would be consistent with other rnd-like commands. I believe it will be renamed 'randn' in the next release. Been thinking... maybe you should call it math.getRndNormal() ... to be more consistent with the other random commands in the math object? What do you think? If you create a function outside an object like the rnd() function, then it could be called rndn() but this is probably a more advanced method and should stay in the math object. Also, if possible, you should make the input be the standard deviation rather. As far as i know a normal distributed variable can have any number (in theory), only the likelihood of the output decreases as you move away from 0. Check out this image from wikipedia's standard deviation page. The image shows that 68.2% of all values are withing one sigma (standard deviation) of the mean (zero in this case) in a Gaussian distribution. So if the input to getRndNormal() is 1, then 68.2% of the output should be within -1 to 1. The reason I think it is important that the input be the standard deviation is that this is what I think people would expect from a mathematical point of view. People looking into what getRndNormal() really is, would find consistency between the function and mathematical explanations found on e.g. wikipedia. What do you think? You can let me know (PM) if you need help implementing the input as the standard deviation, maybe I can help. We used a function that made a Gaussian distribution out of a rnd() function for my final bachelor thesis so maybe I could look it up. Btw, I think it is an excellent function to have, also even if the input won't be the standard deviation. Two thumbs up! Now I only hope I can use it for something
|
|