Let's say I have 20 random values between 0-1 and this represents a CDF. How would I go about converting these random uniform values to normally distributed values. Also, what would happen if say I generate a value of 0.5. Would the value that we create be zero or the mean?
How do I convert a uniform number that is randomly generated into a normally distributed number, if I give a random mean and standard deviation?
0
$\begingroup$
statistics
-
0I'm kind of lost on the concept of CDF and normal distributions. I want to start at let's say .50. If this were the case, would that be equivalent to zero or the mean? – 2017-02-23
-
0Microsoft excel has a +NORMSINV function that will convert these to standard normal distributed variables. – 2017-02-23
-
0Oh, I wanted to see how I would go about this by hand. Let's say I have these random values: 0.3, 0.5, 0.7, and a mean of 10, and an stdev of 5, where do I start? – 2017-02-23
-
0The goal is to essentially work backwards, but i'm unsure of how to manipulate a CDF with these two givens? – 2017-02-23
1 Answers
0
One of the standard ways to do it for uniform to normal is using the Box-Muller transform. Let $U_1,U_2$ be independent random variables uniformly distributed on (0,1). Then $$Z_0 = \sqrt{-2\ln U_1}\cos(2\pi U_2),$$ and$$Z_1 = \sqrt{-2\ln U_1}\sin(2\pi U_2)$$ are independent random variables with standard normal distribution. Then, to make $Z_i' \sim N(\mu,\sigma),$ we simply let $$Z_i' = \sigma Z_i + \mu.$$ You could use the inverse transform method, but in this case the inverse CDF is expensive to evaluate (expressed in terms of the inverse error function I suppose). https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform
-
0can U1 and U2 each be a list of numbers or do they have to be one number each? – 2017-02-23
-
0@redfish5042 Well sine and the natural logarithm are univariate functions so they would be individual numbers...but you can just do it as many times as you want so I'm not sure what you mean... – 2017-02-23