3 ms·
Once you have U([0,1]) you can generate anything you want. Just take Finv(u) where Finv is the inverse CDF of the thing you want. See [1] property 5. https://
by rmrfstar 6y ago
Once you have U([0,1]) you can generate anything you want. Just take Finv(u) where Finv is the inverse CDF of the thing you want. See [1] property 5.
https://en.wikipedia.org/wiki/Cumulative_distribution_function#Inverse_distribution_function_.28quantile_function.29 https://en.wikipedia.org/wiki/Cumulative_distribution_functi...
- kqr 6y agoObviously. But as further reading exposes, the inverse is not always easily memorable -- or even easy to to compute! The inverse of the normal distribution, specifically, needs estimation of an integral to compute.
- rmrfstar 6y agoI guess it depends on what you assume are mathematical "primitives". Log is an integral. Exp is an infinite series. Normal cdf (erf) and its inverse (erfinv) are implemented almost everywhere exp and log are implemented. E.g. MKL and CUDA. Both can be computed via series or integral (like exp and log). [1] https://en.wikipedia.org/wiki/Error_function https://en.wikipedia.org/wiki/Error_function [2] https://people.maths.ox.ac.uk/gilesm/files/gems_erfinv.pdf https://people.maths.ox.ac.uk/gilesm/files/gems_erfinv.pdf
- kqr 6y agoNow that! Is much more constructive information. I'll look for those methods sooner in the future.