Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rtgamma

Testing truncated Gamma sampling


Description

Truncated Gamma draws are needed for the standard deviation of the random effects Gibbs conditional.

Usage

rtgamma(n, shape, rate, a)

Arguments

n

Number of samples.

shape

Sampling from a truncated Gamma where E[x]=shape/rate.

rate

This parameter is the inverse of the scale which is an alternative representation for the Gamma distribution.

a

The truncation point, i.e., a<x.

Value

Returns n truncated Gamma, i.e., Gam(shape, rate)I(a, infinity).

References

Gentle J. (2013) Random number generation and Monte Carlo methods. Springer, New York, NY.

Examples

set.seed(12)
rtgamma(1, 3, 1, 4)
rtgamma(1, 3, 1, 4)

a=rtgamma(10000, 10, 2, 1)
mean(a)
min(a)

BART

Bayesian Additive Regression Trees

v2.9
GPL (>= 2)
Authors
Robert McCulloch [aut], Rodney Sparapani [aut, cre], Charles Spanbauer [aut], Robert Gramacy [aut], Matthew Pratola [aut], Martyn Plummer [ctb], Nicky Best [ctb], Kate Cowles [ctb], Karen Vines [ctb]
Initial release
2020-12-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.