[go: up one dir, main page]

Menu

[749e29]: / man / invgamma.Rd  Maximize  Restore  History

Download this file

52 lines (42 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\name{InvGamma}
\alias{dinvgamma}
\alias{rinvgamma}
\alias{InvGamma}
\title{The Inverse Gamma Distribution}
\description{
Density function and random generation from the inverse gamma distribution.
}
\usage{
rinvgamma(n, shape, scale = 1)
dinvgamma(x, shape, scale = 1)
}
\arguments{
\item{x}{Scalar location to evaluate density.}
\item{n}{Number of draws from the distribution.}
\item{shape}{Scalar shape parameter.}
\item{scale}{Scalar scale parameter (default value one).}
}
\value{
\code{dinvgamma} evaluates the density at \code{x}. \code{rinvgamma} takes
\code{n} draws from the inverse Gamma distribution. The parameterization is
consistent with the Gamma Distribution in the stats package.
}
\details{
An inverse gamma random variable with shape \eqn{a}{a} and scale
\eqn{b}{b} has mean \eqn{\frac{b}{a-1}}{b/(a-1)} (assuming \eqn{a>1}{a>1}) and
variance \eqn{\frac{b^2}{(a-1)^2(a-2)}}{(b^2)/((a-1)^2 (a-2))} (assuming
\eqn{a>2}{a>2}).
}
\references{ Andrew Gelman, John B. Carlin, Hal S. Stern, and Donald
B. Rubin. 2004. \emph{Bayesian Data Analysis}. 2nd Edition. Boca Raton:
Chapman & Hall. }
\author{Andrew D. Martin <admartin@wustl.edu>, Kevin M. Quinn
<kquinn@law.berkeley.edu>, and Jong Hee Park <jhp@uchicago.edu>}
\examples{
\dontrun{
density <- dinvgamma(4.2, 1.1)
draws <- rinvgamma(10, 3.2)
}
}
\keyword{distribution}
\seealso{\code{\link[stats]{GammaDist}}}