Skip to main content
Log in

Generating generalized inverse Gaussian random variates

  • Published:
Statistics and Computing Aims and scope Submit manuscript

Abstract

The generalized inverse Gaussian distribution has become quite popular in financial engineering. The most popular random variate generator is due to Dagpunar (Commun. Stat., Simul. Comput. 18:703–710, 1989). It is an acceptance-rejection algorithm method based on the Ratio-of-Uniforms method. However, it is not uniformly fast as it has a prohibitive large rejection constant when the distribution is close to the gamma distribution. Recently some papers have discussed universal methods that are suitable for this distribution. However, these methods require an expensive setup and are therefore not suitable for the varying parameter case which occurs in, e.g., Gibbs sampling. In this paper we analyze the performance of Dagpunar’s algorithm and combine it with a new rejection method which ensures a uniformly fast generator. As its setup is rather short it is in particular suitable for the varying parameter case.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Algorithm 1
Algorithm 2
Algorithm 3
Fig. 4

Similar content being viewed by others

References

  • Eberlein, E., Keller, U.: Hyperbolic distributions in finance. Bernoulli 1, 281–299 (1995)

    Article  MATH  Google Scholar 

  • Seshadri, V.: The Inverse Gaussian Distribution. Lecture Notes in Statistics, vol. 137. Springer, New York (1999)

    MATH  Google Scholar 

  • Barndorff-Nielsen, O., Blæsild, P., Halgreen, C.: First hitting time models for the generalized inverse Gaussian distribution. Stoch. Process. Appl. 7(1), 49–54 (1978). doi:10.1016/0304-4149(78)90036-4

    Article  MATH  Google Scholar 

  • Jørgensen, B.: Statistical Properties of the Generalized Inverse Gaussian Distribution. Lecture Notes in Statistics, vol. 9. Springer, New York (1982)

    Google Scholar 

  • Johnson, N., Kotz, S., Balakrishnan, N.: Continuous Univariate Distributions vol. 1, 2nd edn. Wiley, New York (1994)

    MATH  Google Scholar 

  • Abramowitz, M., Stegun, I.A. (eds.): Handbook of Mathematical Functions 9th edn. Dover, New York (1972). ISBN 0486-612-724

    MATH  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  • Lehner, K.: Erzeugung von Zufallszahlen aus zwei exotischen Verteilungen, Diploma Thesis, Tech. Univ. Graz, Austria, 107 pp. (1989)

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

    Article  MATH  Google Scholar 

  • Dagpunar, J.S.: Simulation and Monte Carlo with Applications in Finance and MCMC. Wiley, New York (2007)

    Book  MATH  Google Scholar 

  • Leydold, J., Hörmann, W.: Generating generalized inverse Gaussian random variates by fast inversion. Comput. Stat. Data Anal. 55(1), 213–217 (2011). doi:10.1016/j.csda.2010.07.011

    Article  MATH  Google Scholar 

  • Derflinger, G., Hörmann, W., Leydold, J.: Random variate generation by numerical inversion when only the density is known. ACM Trans. Model. Comput. Simul. 20(4), 1-25 (2010)

    Article  Google Scholar 

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

    Book  MATH  Google Scholar 

  • Ahrens, J.H.: A one-table method for sampling from continuous and discrete distributions. Computing 54(2), 127–146 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  • Kinderman, A.J., Monahan, J.F.: Computer generation of random variables using the ratio of uniform deviates. ACM Trans. Math. Softw. 3(3), 257–260 (1977)

    Article  MATH  Google Scholar 

  • Leydold, J.: Automatic sampling with the Ratio-of-Uniforms method. ACM Trans. Math. Softw. 26(1), 78–98 (2000). doi:10.1145/347837.347863

    Article  MATH  Google Scholar 

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

    Article  MATH  Google Scholar 

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

    Book  MATH  Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  • Leydold, J.: A simple universal generator for continuous and discrete univariate T-concave distributions. ACM Trans. Math. Softw. 27(1), 66–82 (2001)

    Article  MATH  Google Scholar 

  • Dagpunar, J.: In: Principles of Random Variate Generation. Clarendon, Oxford (1988)

    Google Scholar 

Download references

Acknowledgements

The authors gratefully acknowledge the useful suggestions of the area editor and two anonymous referees that helped to improve the presentation of the paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Josef Leydold.

Appendix

Appendix

1.1 Proof of Lemma 11

Let λ∈[0,1) be fixed. Recall that . Notice that does not contain any point left of the line u=−mv since we have used μ=m in (3), i.e., we have shifted quasi-density g by the mode m to the left, see Fig. 5. Consequently, −mv +u and . Let x + defined as in Sect. 2, i.e., it is the unique root of (5) greater than m. Thus \((x-m)\sqrt{g(x)}\) is monotonically increasing in [m,x +].

Fig. 5
figure 8

, , (−mv +,u+)×(0,v +), and (u 1,v 1) in proof of Lemma 11

Now choose x 1∈(0,x +m) and let (u 1,v 1) be the point on the boundary of corresponding to x 1, i.e., \(v_{1}=\sqrt{g(x_{1}+m)}\) and u 1=xv 1. Then does not intersect the open rectangle (u 1,u +)×(v 1,v +) and thus

We therefore find

(10)

Now let

$$x_0^+(\beta) = \frac{1}{\beta} \bigl((1+\lambda)+\sqrt{(1+ \lambda)^2+\beta^2} \bigr). $$

It is the unique maximum of \(x\sqrt{g(x)}\), see Sect. 5. Since \(((x-m)\sqrt{g(x)} )'\geq (x\sqrt{g(x)} )'\) for all xm, we find \(x_{0}^{+}\leq x^{+}\). Now define

$$u^*=\bigl(x_0^+-m\bigr)\sqrt{g\bigl(x_0^+ \bigr)}. $$

Clearly \(u^{*}\leq u^{+}=\sup (x-m)\sqrt{g(x)}\), and thus ε=u +u ≥0. From (10) we then obtain

(11)

Now set

We first have to check whether the condition x 1∈(0,x +m) is fulfilled. For the limits β→0 we find

An immediate consequence is that for sufficiently small β>0, \(x_{1}(\beta) < x_{0}^{+}(\beta)-m(\beta) \leq x^{+}(\beta)-m(\beta)\) which shows that x 1(β)∈(0,x +m) when β is close enough to zero. Thus inequality (11) holds. Moreover,

$$\lim_{\beta\to 0} u_1(\beta) = \lim_{\beta\to 0} v_1(\beta) \cdot \lim_{\beta\to 0} x_1( \beta) = 1. $$

For the denominators in (11) we find

Finally,

Collecting all limits we find that all fractions on the right hand side of inequality (11) converge to 0 and thus as claimed.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hörmann, W., Leydold, J. Generating generalized inverse Gaussian random variates. Stat Comput 24, 547–557 (2014). https://doi.org/10.1007/s11222-013-9387-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11222-013-9387-3

Keywords

Navigation