Duncan Murdoch wrote:
On 11/12/2009 7:12 AM, khaz...@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.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to