Learn R Programming

Boom (version 0.4)

gamma.prior: Gamma prior distribution

Description

Specifies gamma prior distribution.

Usage

GammaPrior(a = NULL, b = NULL, prior.mean = NULL, initial.value = NULL)

Arguments

a
The shape parameter in the Gamma(a, b) distribution.
b
The scale paramter in the Gamma(a, b) distribution.
prior.mean
The mean the Gamma(a, b) distribution, which is a/b.
initial.value
The initial value in the MCMC algorithm of the variable being modeled.

Details

The mean of the Gamma(a, b) distribution is a/b and the variance is a/b^2. If prior.mean is not NULL, then one of either a or b must be non-NULL as well.

GammaPrior is the conjugate prior for a Poisson mean or an exponential rate. For a Poisson mean a corresponds to a prior sum of observations and b to a prior number of observations. For an exponential rate the roles are reversed a represents a number of observations and b the sum of the observed durations. The gamma distribution is a generally useful for parameters that must be positive.

The gamma distribution is the conjugate prior for the reciprocal of a Guassian variance, but SdPrior should usually be used in that case.

References

Gelman, Carlin, Stern, Rubin (2003), "Bayesian Data Analysis", Chapman and Hall.