02-19-2020 07:15 PM - edited 02-19-2020 07:18 PM
Hi, I am using Labview 2019. I have a "uniformly distributed" 1-D array in Labview. From this 1-D array, I would like to produce a "normally distributed" 1-D array. The only restriction I would like to have is that the normally distributed array should have it's mean as a particular value.
I am struggling to convert my 1-D uniformly distributed array to a gaussian distributed aka normally distributed array. I would appreciate your assistance to help achieve this purpose. Thanks!
02-19-2020 09:33 PM
There's a very general approach for mapping a uniform probability distribution (where P(x) = k, a horizontal line at constant value k) into any other P(x) shape, including Gaussian.
There are a couple key ideas. First, be prepared to think of the ranges for your distributions in *normalized* terms, i.e., treat them as going from 0 to 100%.
Second, integrate your probability distribution function to get a *cumulative* probability. Be sure to normalize this cumulative probability so it also goes from 0 to 100%. You can precalculate this to create a reverse lookup table. That is, given a particular cumulative probability, what is the value where that cumulative probability occurs?
Now, for each uniformly distributed value, you can map it to an equivalent 0-100% of the range. Then you can do a lookup for that same cumulative % probability, and discover the corresponding value. The resulting values will be distributed according to the desired P(x) shape.
Understanding this idea will let you generate distributions of any shape you want, you won't be limited to the most common ones.
-Kevin P
02-19-2020 11:54 PM
Look into the box-muller transformation, which gives you two values of gaussian distributed numbers given two uniform distributed values (0...1).
Apply scale and offset for desired mean and sigma.