Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Random variate generation for the generalized inverse Gaussian distribution

  • 928 Accesses

  • 10 Citations


We provide a uniformly efficient and simple random variate generator for the entire parameter range of the generalized inverse Gaussian distribution. A general algorithm is provided as well that works for all densities that are proportional to a log-concave function φ, even if the normalization constant is not known. It requires only black box access to φ and its derivative.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3


  1. Atkinson, A.C.: The simulation of generalized inverse Gaussian, generalised hyperbolic, gamma and related random variables. Research reports no. 52, Imperial College London (1979)

  2. Atkinson, A.C.: The simulation of generalized inverse Gaussian and hyperbolic random variables. SIAM J. Sci. Comput. 3, 502–515 (1982)

  3. Barndorff-Nielsen, O.E., Halgreen, O.: Infinite divisibility of the hyperbolic and generalized inverse Gaussian distribution. Z. Wahrscheinlichkeitstheor. Verw. Geb. 38, 309–311 (1977)

  4. Botts, C., Hörmann, W., Leydold, J.: Transformed density rejection with inflection points. Research report series report 110, Institute for Statistics and Mathematics, Vienna University of Economics and Business (2011)

  5. Breymann, W., Lüthi, D.: ghyp: a package on generalized hyperbolic distributions. Technical report, Institute of Data Analysis and Process Design (2011)

  6. Dagpunar, J.S.: An easily implemented generalised inverse Gaussian generator. Commun. Stat., Simul. Comput. 18, 703–710 (1989)

  7. Devroye, L.: A simple algorithm for generating random variates with a log-concave density. Computing 33, 247–257 (1984)

  8. Devroye, L.: Non-uniform Random Variate Generation. Springer, New York (1986)

  9. Eberlein, E., von Hammerstein, E.A.: Generalized hyperbolic and inverse Gaussian distributions: limiting cases and approximation of processes. Technical report nr. 80, Department of Mathematical Stochastics, University of Freiburg (2002)

  10. Folks, J.L., Chhikara, R.S.: The inverse Gaussian distribution and its statistical applications. A review. J. R. Stat. Soc. B 40, 263–289 (1978)

  11. Gilks, W.R.: Derivative-free adaptive rejection sampling for Gibbs sampling. In: Bernardo, J., Berger, J., Dawid, A.P., Smith, A.F.M. (eds.) Bayesian Statistics, vol. 4. Oxford University Press, London (1992)

  12. Gilks, W.R., Wild, P.: Adaptive rejection sampling for Gibbs sampling. Appl. Stat. 41, 337–348 (1992)

  13. Gilks, W.R., Wild, P.: Algorithm AS 287: adaptive rejection sampling from log-concave density function. Appl. Stat. 41, 701–709 (1993)

  14. Halphen, E.: Sur un nouveau type de courbe de fréquence. Comptes Rendus des séances de l’Académie des Sciences (1941)

  15. Hörmann, W.: A universal generator for discrete log-concave distributions. ACM Trans. Model. Comput. Simul. 4, 96–106 (1994)

  16. Hörmann, W.: A rejection technique for sampling from T-concave distributions. ACM Trans. Math. Softw. 21, 182–193 (1995)

  17. Hörmann, W., Leydold, J., Derflinger, G.: Automatic Nonuniform Random Variate Generation. Springer, Berlin (2004)

  18. Lai, Y.: Generating inverse Gaussian random variates by approximation. Comput. Stat. Data Anal. 53, 3553–3559 (2009)

  19. Lesosky, M., Horrocks, J.: Generating random variables from the inverse Gaussian and first-passage-two-barrier distributions. Technical report, Department of Mathematics and Statistic, University of Guelph, Ontario (2003)

  20. Leydold, J., Hörmann, W.: Black box algorithms for generating non-uniform continuous random variates. In: Jansen, W., Bethlehem, J.G. (eds.) Compstat 2000, pp. 53–54 (2000)

  21. Leydold, J., Hörmann, W.: Universal algorithms as an alternative for generating non-uniform continuous random variates. In: Schuler, G.I., Spanos, P.D. (eds.) Monte Carlo Simulation, pp. 177–183 (2001)

  22. Michael, J.R., Schucany, W.R., Haas, R.W.: Generating random variates using transformations with multiple roots. Am. Stat. 30, 88–90 (1976)

  23. Morlat, G.: Les lois de probabilité de Halphen. Rev. Stat. Appl. 4, 21–46 (1956)

  24. Jørgensen, B.: Statistical Properties of the Generalized Inverse Gaussian Distribution. Springer, New York (1982)

  25. Seshadri, V.: Halphen’s laws. In: Kotz, S., Read, C.B., Banks, D.L. (eds.) Encyclopedia of Statistical Sciences, Update, vol. 1, pp. 302–306. Wiley, New York (1997)

Download references


I would like to thank both referees.

Author information

Correspondence to Luc Devroye.

Additional information

Research sponsored by NSERC Grant A3456.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Devroye, L. Random variate generation for the generalized inverse Gaussian distribution. Stat Comput 24, 239–246 (2014). https://doi.org/10.1007/s11222-012-9367-z

Download citation


  • Random variate generation
  • Simulation
  • Monte Carlo method
  • Expected time analysis