nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#689 random variables are not correctly inclusive / exclusive, #2429

Open nikhilgupta10 opened 7 years ago

nikhilgupta10 commented 7 years ago

Some random distributions require inclusive bounds, while others exclusive. The current code appears to be inclusive on the upper (1), but not on the lower (0).

Suggest a separate randunit for exclusive and inclusive bounds.

,

nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: "dchassin": * owner changed from mhauer to dchassin

Minor clarification: the current implementation of randunit in trunk is exclusive of both 0 and 1. The uniform distribution uses randunit directly, but the definition of uniform is inclusive of 0 and 1.

Extreme caution in making corrections to randunit is required because some distribution require (0,1), some )0,1), some (0,1( and other )0,1(.

,

"dchassin": * owner changed from dchassin to jcfuller

Very important warning: this fix will alter all the autotests that are sensitive to the random number sequence. This needs review before action.

It is worth noting that the random number generators do not include numbers they shouldn't. But some do exclude number they shouldn't.

Suggest implementing in random.c internal functions for randunit() for exclusive of 0 and 1, randunit_0() for inclusive of 0, randunit_1() for inclusive of 1, and randunit_01() inclusive of 0 and 1. In addition, the follow should be used for supported distributions:

uniform randunit_01 (needs to be fixed)
normal randunit_1 (needs to be fixed)
bernoulli randunit_01 (needs to be fixed)
sample randunit_0 (needs to be fixed)
pareto randunit (ok)
lognormal randunit_1 (will be fixed through normal)
exponential randunit (ok)
weibull randunit (ok)
rayleigh randunit_1 (needs to be fixed)
gamma randunit (ok)
beta randunit (ok through gamma)
triangle randunit (ok)

,

"dchassin":- Milestone: Unscheduled --> Version 4.0 RC1 ,