04-16-2007 02:29 PM
04-16-2007 02:48 PM
04-16-2007 03:30 PM
@altenbach wrote:
...Simply autoindex the scalar function value at the left loop boundary.
04-17-2007 05:15 AM
Just inexperience..
Why in the world would you use a waveform chart in your code??? Only a waveform graph seems suitable for a histogram.
I am used to do it, but I know it's not necesary to do this.
And why are you writing to a local variable instead of the terminal inside the loop?
Thanks, understood.
Also: when building the distribution in frame 1, there is no reason to built an array in a shift register. Simply autoindex the scalar function value at the left loop boundary. The input terminals belong outside the loop because the values should not change during loop execution.
Sure you are right... now i see it more clearly. Thanks!!
Also: Your function does not give a normal distribution. The "dice" gives an even distribution between 0 and 1 and none of your scaling will change that.
04-17-2007 12:13 PM - edited 04-17-2007 12:13 PM
@javivi wrote:
So, now, my last doubt, i hope someone can answer me: I pick up numbers randomly from an array of values which i know they come from a probability distribution. Are these picked up values following the probability distribution too?
Only if that array is of near infinite size. In all other cases you will get a distribution from a set of finite values and thus statistically suspect. Here's an example:
Of course if you always get a new array with gaussian noise, it might be OK. In this case you might as well just get a fresh gaussian white noise array with one element each time and leave out the random indexing, right?
There is also a very simple formula to get a normal distributed random number from two even distributed random numbers, (it was actually used on the texas instruments programmable calculators in the seventies). Maybe I can find it somewhere. If I remember right, I implemented it in LabVIEW about 10 years ago. 😉
Message Edited by altenbach on 04-17-2007 10:14 AM
04-17-2007 12:48 PM - edited 04-17-2007 12:48 PM
@altenbach wrote:
There is also a very simple formula to get a normal distributed random number from two even distributed random numbers, (it was actually used on the texas instruments programmable calculators in the seventies). Maybe I can find it somewhere. If I remember right, I implemented it in LabVIEW about 10 years ago. 😉
OK, found it! To generate a normal distributed random number, you can use the Box-Muller algorithm (look it up!). A simple LabVIEW implementation is shown here:
Message Edited by altenbach on 04-17-2007 10:49 AM