Generating random variables with a 𝑡-distribution

  • Marsaglia G
5Citations
Citations of this article
5Readers
Mendeley users who have this article in their library.

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 {t_n} density c ( 1 + t 2 / n ) − 1 / 2 n − 1 / 2 c(1 + {t^2}/n)^{- 1/2 n - 1/2} , for any n > 2 n > 2 : Generate A = R N O R , B = A 2 / ( n − 2 ) A = \mathrm {RNOR}, B = A^2/(n - 2) and C = R E X P / 1 / 2 n − 1 ) C = \mathrm {REXP}/ 1/2 n - 1) until e − B − C ⩽ 1 − B e^{ - B - C} \leqslant 1 - B , then exit with T = A [ ( 1 − 2 / n ) ( 1 − B ) ] − 1 / 2 T = A[(1 - 2/n)(1 - B)]^{-1/2} .

Cite

CITATION STYLE

APA

Marsaglia, G. (1980). Generating random variables with a 𝑡-distribution. Mathematics of Computation, 34(149), 235–236. https://doi.org/10.1090/s0025-5718-1980-0551301-3

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free