[R] how can generate from trunceted gamma distribution in R ?

David Scott d.scott at auckland.ac.nz
Sat Dec 12 03:38:16 CET 2009


Duncan Murdoch wrote:
> On 11/12/2009 7:12 AM, khazaei at ceremade.dauphine.fr wrote:
>> Hi, all
>> How can generate a sample from truncated inverse  gamma distribution in R?
> 
> Using the inverse CDF method or rejection sampling are possible, 
> depending on what your truncation is like.  If your truncation forces 
> the observations far out into the tails, you need to be careful about 
> rounding and underflow when using the the inverse CDF method.
> 
> Duncan Murdoch
> 

I think perusal of this paper might be a good idea:

Sampling Truncated Normal, Beta, and Gamma Densities
Paul Damien and Stephen G. Walker
Journal of Computational and Graphical Statistics, Vol. 10, No. 2 (Jun., 
2001), pp. 206-215

Remembering that the inverse gamma is the inverse of a gamma, you may be 
able to get a truncated inverse gamma from a truncated (at the other 
end) gamma. Alternatively, the methodology outlined in the paper most 
likely can be modified for the inverse gamma.

David Scott


_________________________________________________________________
David Scott	Department of Statistics
		The University of Auckland, PB 92019
		Auckland 1142,    NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:	d.scott at auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics




More information about the R-help mailing list