Original articles
Random variate generation for the truncated negative gamma distribution

https://doi.org/10.1016/j.matcom.2020.09.005Get rights and content

Abstract

We provide a uniformly efficient and simple random variate generator for the truncated negative gamma distribution restricted to any interval.

Introduction

In this note, we derive a uniformly fast random variate generator for the family of densities that are proportional to f(x)=xλexpx,x[s,t),where 0<s<t and λ1 are the parameters. For λ<1, we obtain the standard gamma (1λ) distribution, for which many good algorithms are available (see [2], [6] and [4]). For this reason we will call this the negative gamma family. Since it must be a density, we cannot have s=0.

This distribution appears in the astrophysics literature where it is known as the power law with cut-off, or the power law with exponential cut-off. Our nomenclature stresses the tight connection with the gamma distribution.

Deriving uniformly fast algorithms for multi-parameter families of distributions becomes harder as the number of parameters grows. With three parameters, λ, s and t, one must be very careful. Our method is based on the fact that after an exponential transformation, the distribution is log-concave on its support.

The algorithms here are designed for situations in which one or more of the parameters change on each call. If they are static, then there are various other methods that should be considered, including table methods and adaptive rejection sampling [5].

Section snippets

A transformed negative gamma distribution

The following “trick” helps in a large number of examples. If X is negative gamma, then Y=log(Xs) has a log-concave density proportional to exp(λ1)(y+logs)sey,y[0,log(ts)).It is understood that when t=, then the support of this density is [0,). This density has a unique mode at the origin, is monotonically decreasing on the positive halfline, and is log-concave. It is convenient to normalize so that the value of the function we will be dealing with is 1 at the origin. So, Y has density

The rejection algorithm for our example

To apply the rejection method, we need the integrals of eg over [0,z] and [z,), respectively. The former is z. The latter is given by b=def1aeh(z)=1aexp(λ1)zsez1.Furthermore, we note that a random variate with density proportional to eg on [z,) is simply generated as z+Ea, where E is a standard exponential random variable. Finally, in the algorithm below, if W is a candidate point generated from eh, and V is a uniform [0,1] random variable, then we replace the rejection step Veh(W)eg(W)

A special case: λ=1

For the one parameter density proportional to f(x)=1xex,xs>0,the algorithm becomes much simpler:

In the algorithm above, we tacitly replaced z1 by the choice of z given in the first line of the algorithm. One can verify that the bounding method used in Theorem 1 gives the better estimate E{N}e+1.

The gamma density with parameter in (0,1]

There are many methods for generating gamma random variables with arbitrary parameters. We are interested though in the case of gamma random variables with parameter b=1λ(0,1], i.e., having density xλexΓ(1λ),but restricted to the interval [s,t][0,). This is a three parameter family of distributions. The purpose is, once again, to derive a uniformly fast rejection method.

First we note that the transformed random variable Y=Xbhas density proportional to expy1b,y0,when X is gamma (b). It

Acknowledgements

The distribution was pointed out to me by astrophyscist B.T. Ravishankar of the Indian Institute of Space Science and Technology, and UR Rao Satellite Centre, who needed a fast generator for it in order to generalize the work of Magdziarz and Zdziarski [9]. Ravishankar implemented and successfully tested all algorithms shown in this note, but declined having his name as coauthor of the paper. The author would also like to thank both referees.

References (10)

  • DevroyeL.

    A note on generating random variables with log-concave densities

    Statist. Probab. Lett.

    (2012)
  • DevroyeL.

    A simple algorithm for generating random variates with a log-concave density

    Computing

    (1984)
  • DevroyeL.

    Non-Uniform Random Variate Generation

    (1986)
  • DevroyeL.

    Random variate generation for the generalized inverse Gaussian distribution

    Stat. Comput.

    (2014)
  • GilksW.R. et al.

    Adaptive rejection sampling for Gibbs sampling

    Appl. Stat.

    (1992)
There are more references available in the full text version of this article.

Cited by (0)

Research sponsored by NSERC Grant A3456.

View full text