05-22-2014 09:49 AM
Hey everyone. I'm sure this is simple, but I can't seem to find any info on how to do it.
I need to generate a single random value from a two-number range (user entered limits) using an exponential distribution. Any help is much appreciated.
05-22-2014 09:58 AM
The most general case of generating a random distribution with a desired probaility profile is described here, but you could probably simplify for your case. Try it.
05-22-2014 10:54 AM
@altenbach wrote:
The most general case of generating a random distribution with a desired probaility profile is described here, but you could probably simplify for your case. Try it.
I'm not sure I'm following the code you've linked to, but I'm fairly certain that as you've implied, I need something much simpler. I'll try to do it mathematically from a mathscript node, or something.
05-22-2014 11:44 AM
... That's why I said you could simplify. First we need a less ambiguous problem description.
I can think of several ways to interpret "exponential". Can you be a bit more specific how probability depends on the range and range bounds.
05-22-2014 04:33 PM
Here is my idea of what I would do based on your description.
Take your range min and max, do the exponential math on it to come up with a new min and max.
Use that min and max and do a normal random number based on that.
Take the random number you get, and do the math for the inverse of the exponential you did in step one.
05-22-2014 06:32 PM
RavensFan wrote:Use that min and max and do a normal random number based on that.
you need to be careful with the word "normal". It could imply a random number with a normal distribution. Is that what you meant?
05-22-2014 06:38 PM
Nope. Not that "normal" as in normal distribution. I just meant normal as the ordinary English word, just the basic random number generator present in the numeric palette.
Thanks for pointing that out to help avoid any confusion by my choice of words.
05-23-2014 08:43 AM
I did the math in a node. I was just hoping LabView might have a simple VI that could do it. Thanks.
05-23-2014 09:34 AM
@user0110 wrote:
I did the math in a node. I was just hoping LabView might have a simple VI that could do it. Thanks.
Of course LabVIEW has a simpler way!
As I said, the word "exponentioal" is too ambiguous. You need to tell us the math you want to use, but you have not yet. Can you show us your current code so we get a better understanding how the output should behave based on the input range?