Generating random variables with a $t$-distribution
HTML articles powered by AMS MathViewer
- by George Marsaglia PDF
- Math. Comp. 34 (1980), 235-236 Request permission
Abstract:
Let RNOR and REXP represent normal and exponential random variables produced by computer subroutines. Then this simple algorithm may be used to generate a random variable T with ${t_n}$ density $c(1 + {t^2}/n)^{- 1/2 n - 1/2}$, for any $n > 2$: Generate $A = \mathrm {RNOR}, B = A^2/(n - 2)$ and $C = \mathrm {REXP}/ 1/2 n - 1)$ until $e^{ - B - C} \leqslant 1 - B$, then exit with $T = A[(1 - 2/n)(1 - B)]^{-1/2}$.References
- A. J. Kinderman, J. F. Monahan, and J. G. Ramage, Computer methods for sampling from Student’s $t$ distribution, Math. Comp. 31 (1977), no. 140, 1009–1018. MR 443294, DOI 10.1090/S0025-5718-1977-0443294-4 M. D. MACLAREN, G. MARSAGLIA & T. A. BRAY, "A fast procedure for generating exponential random variables," Comm. ACM, v. 7, 1964, pp. 298-300.
- G. Marsaglia, K. Ananthanarayanan, and N. J. Paul, Improvements on fast methods for generating normal random variables, Information Processing Lett. 5 (1976), no. 2, 27–30. MR 438652, DOI 10.1016/0020-0190(76)90074-0
- George Marsaglia, The exact-approximation method for generating random variables in a computer, J. Amer. Statist. Assoc. 79 (1984), no. 385, 218–221. MR 742873, DOI 10.1080/01621459.1984.10477088
Additional Information
- © Copyright 1980 American Mathematical Society
- Journal: Math. Comp. 34 (1980), 235-236
- MSC: Primary 65C10
- DOI: https://doi.org/10.1090/S0025-5718-1980-0551301-3
- MathSciNet review: 551301