Bug 108 - bounds useless for assymetric Normal random variables
bounds useless for assymetric Normal random variables
Status: RESOLVED INVALID
Product: ns-3
Classification: Unclassified
Component: core
pre-release
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-19 04:20 UTC by Mathieu Lacage
Modified: 2008-07-01 13:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.