07-27-2016 09:51 AM
Afternoon All,
I am looking to add some normally distributed noise about a mean with a known standard deviation so I can run some Monte Carlo simulations using Labview. Fun times. Can anyone tell me why my histogram in the attached VI is not normally distributed?
Paul
Solved! Go to Solution.
07-27-2016 10:53 AM - edited 07-27-2016 10:55 AM
Because you're reading off the pdf value, not sampling from a normal distribution. Use "Continuous Random.vi" or "Continuous Inverse CDF.vi" with the Random Number (0,1) as your input to get a normally distributed rv.
There's also a Gaussian Noise signal generator you could use if you application involves waveform data.
07-28-2016 03:26 AM
I will have a look at those VIs. I think the issue isn't so much the PDF, it is that x is random rather than increasing in fixed steps. If I use a ramp between max min VI and feed that in, it produces a normal distribution.
07-28-2016 07:44 AM
07-28-2016 07:54 AM
You don't want a graph of a Normal Distribution, you want samples drawn from a Normal Distribution. Consider LabVIEW's "Random number" generator, which returns a random number between 0 and 1. If you were to look at the PDF for the Uniform Distribution, it would be 1 for X between XMin and XMax, 0 otherwise.
Note that you can use the Central Limit Theorem to get an excellent (and pretty fast) approximation to a Normal Distribution with mean 0 and variance 1 -- simply sum 12 Uniform (0, 1) random numbers and subtract the expected mean (6). This is, in fact, the approximation that IBM distributed with their Scientific Software Package (Fortran) in the 60's.
Bob Schor
12-03-2020 01:14 PM
Bob,
That worked beautifully to create a normal distribution. Thanks for sharing. I tried Kudos but getting an error.
David Fox