|
|
|
|
|
by NY_USA_Hacker
5575 days ago
|
|
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! |
|