Bug 108

Summary: bounds useless for assymetric Normal random variables
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: coreAssignee: ns-bugs <ns-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: raj.b
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   

Description Mathieu Lacage 2007-11-19 04:20:42 UTC
the bounds which can be specified with the constructor:

NormalVariable(double m, double v, double b = INFINITE_VALUE);

are useless for a NormalVariable which is not symmetric. What is needed is:

NormalVariable(double m, double v, double min, double max);
Comment 1 Rajib Bhattacharjea 2007-11-19 10:19:09 UTC
The intention of the API is not to create asymmetric distributions, but rather to keep the computer from occasionally returning 10000 for a distribution with mean of 0 and variance of 1.  Mathieu, what is your use case that requires asymmetric cutoffs of the normal distribution? 
Comment 2 Mathieu Lacage 2007-11-19 10:25:14 UTC
I need to generate a distribution with a non-zero mean and to avoid values outside of a non-symmetric range. Since the API allows me to create non-zero mean distributions, and since it provides bounds, I thought that it made sense to be able to use both at the same time. Of course, I can add the cutoff inside my own code as an extra step.
Comment 3 Mathieu Lacage 2008-04-15 11:47:01 UTC
Raj, what is your thinking about this ? 
Comment 4 Rajib Bhattacharjea 2008-04-15 12:45:50 UTC
I really think the user should add a check to get values in the range he wants.  The semantics of the "mean" parameter are completely violated if you have asymmetric bounds, i.e. if you calculated the mean of an infinite number of values from an asymmetric distribution you describe, the value you get would be completely different than what you asked for in your creation of the generator when you provided the "mean" parameter.