Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It wasn't quite that simple. Yes I'd heard of it, but I didn't know how to randomly sample from a Gaussian distribution, nor why it was necessary to use it in the algorithm I was working on ("why can't I just sample from a uniform distribution?").[1]

Also, I was in a special situation. I had a strong passion for the work I was doing, knew my boss before I got hired, and had done related research that showed I was able to push my way through challenging problems.

[1] http://www.nashcoding.com/2010/07/07/evolutionary-algorithms...



Sample from a univariate distribution by taking the inverse function of the cumulative distribution and plugging in a [0,1] uniform random number. So, if X is a real valued random variable, then its 'cumulative distribution' F_X(x) = P(X <= x) where P denotes probability. Then F_X is monotone increasing so has an inverse function, say, G(u) = F_X^(-1). Then if U is a random variable uniform on [0,1], G(U) has distribution F_X like X does. Note: Have to patch up a little in the case F_X is not strictly monotone increasing.

For the inverse of the mean zero, variance 1 Gaussian distribution, look in the old NBS AMS-55 math handbook. They have two nice, simple formulas that are plenty good as approximations; one formula is a little more accurate than the other.

For getting samles from a multivariate Gaussian, that is the second lecture!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: