5
$\begingroup$

I am trying to generate a set of N random numbers where the set has a normal distribution.

I'm currently using a brute force approach:

  1. Randomly select N numbers from a normal distribution.
  2. Check the set's standard deviation (more important than mean).
  3. If it is the best set so far, keep it.
  4. Repeat 10000 times, and use the best set.

Is there any better approach? Anyone know where I could look?

Thanks in advance!

  • 0
    The step involving checking the standard deviation is revealing. Somehow it seems desired to achieve a certain standard deviation (although sharoz never says that!). But that's really easy: divide every observation by their standard deviation, then multiply by whatever standard deviation you want to get. You're done in one step; there's no need to do it$10000$times.2011-10-11

1 Answers 1

4

Assume we are talking about a standard normal distribution with zero mean and unit variance. For the observer to be able to answer the question "is this sample from a standard normal distribution?" with a high probability of correctness, he needs to know the distribution of distributions from which the sample may have been generated. The probability that the observer will guess "yes" is maximized when the sample is generated from a standard normal distribution, assuming that is possible. So according to my interpretation, you should use the values generated by Box-Muller in step 1 without inspecting them.

  • 0
    You are welcome sir.2011-10-11