Sample(Generate random variables) from normal distribution
In the following previous posts, I mentioned about rejection sampling.
But I was a little confused when I learn rejection sampling.
Because we need a known distribution which we already know how to draw samples from.
Of course I know how to sample from uniform distribution. (e.g. by using /dev/random in unix).
But I don’t know others…
I started googling about how to draw samples from normal distribution.
I found a post in stack exchange.
I don’t know how credible it is, but it seems to be decent.
There are two steps when we want to draw a sample from a normal distribution whose mean is and variance is
- Draw a sample from a normal distribution with mean 0 and variance 1 .
- Transform the value to a sample from a normal distribution with mean and variance by calculating .
Step 1 is not trivial. I think I will write about it next time.