khazaei at ceremade.dauphine.fr
2009-Dec-11 12:12 UTC
[R] how can generate from trunceted gamma distribution in R ?
Hi, all How can generate a sample from truncated inverse gamma distribution in R? thanks
Greg Snow
2009-Dec-11 20:53 UTC
[R] how can generate from trunceted gamma distribution in R ?
One approach is to sample from a non-truncated inverse gamma, then if the observation is in the part you want truncated, throw it away and generate a new value. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of khazaei at ceremade.dauphine.fr > Sent: Friday, December 11, 2009 5:12 AM > To: r-help at r-project.org > Subject: [R] how can generate from trunceted gamma distribution in R ? > > > Hi, all > How can generate a sample from truncated inverse gamma distribution in > R? > > thanks > > ______________________________________________ > R-help at 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.
Duncan Murdoch
2009-Dec-12 00:20 UTC
[R] how can generate from trunceted gamma distribution in R ?
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> > thanks > > ______________________________________________ > R-help at 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.
David Scott
2009-Dec-12 02:38 UTC
[R] how can generate from trunceted gamma distribution in R ?
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