Publications Meetings The Profession Membership Programs Math Samplings Policy & Advocacy In the News About the AMS
   
Mobile Device Pairing
Green Open Access
Mathematics of Computation
Mathematics of Computation
ISSN 1088-6842(online) ISSN 0025-5718(print)

 

Generating random variables with a $ t$-distribution


Author: George Marsaglia
Journal: Math. Comp. 34 (1980), 235-236
MSC: Primary 65C10
MathSciNet review: 551301
Full-text PDF Free Access

Abstract | References | Similar Articles | Additional Information

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)^{ - \raise.5ex\hbox{$\scriptstyle 1$}\kern-.1em/ \kern-.15em\l... ...x{$\scriptstyle 1$}\kern-.1em/ \kern-.15em\lower.25ex\hbox{$\scriptstyle 2$} }}$, for any $ n > 2$: Generate $ A = {\text{RNOR}},B = {A^2}/(n - 2)$ and $ C = {\text{REXP}}/(\raise.5ex\hbox{$\scriptstyle 1$}\kern-.1em/ \kern-.15em\lower.25ex\hbox{$\scriptstyle 2$} n - 1)$ until $ {e^{ - B - C}} \leqslant 1 - B$ , then exit with $ T = A{[(1 - 2/n)(1 - B)]^{ - \raise.5ex\hbox{$\scriptstyle 1$}\kern-.1em/ \kern-.15em\lower.25ex\hbox{$\scriptstyle 2$} }}$.


References [Enhancements On Off] (What's this?)


Similar Articles

Retrieve articles in Mathematics of Computation with MSC: 65C10

Retrieve articles in all journals with MSC: 65C10


Additional Information

DOI: http://dx.doi.org/10.1090/S0025-5718-1980-0551301-3
PII: S 0025-5718(1980)0551301-3
Article copyright: © Copyright 1980 American Mathematical Society