Friday, January 25, 2008

Generating samples from a normal distribution

Stumbled upon an elegant result today:
If F is the cumulative distribution function of X, then F(X) is the Uniform Distribution on [0,1].

How to use this in practice? Well, NORMSINV(RAND()) can be used in Excel to pick a random value from a standard normal (Gaussian) distribution. Though accurate, this is very slow as it involves the inverse of an integral.

No comments: