Learn R Programming

LaplacesDemon (version 16.1.6)

dist.Inverse.Beta: Inverse Beta Distribution

Description

This is the density function and random generation from the inverse beta distribution.

Usage

dinvbeta(x, a, b, log=FALSE)
rinvbeta(n, a, b)

Arguments

n

This is the number of draws from the distribution.

x

This is a location vector at which to evaluate density.

a

This is the scalar shape parameter \(\alpha\).

b

This is the scalar shape parameter \(\beta\)

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Value

dinvbeta gives the density and rinvbeta generates random deviates.

Details

  • Application: Continuous Univariate

  • Density: \(p(\theta) = \frac{\theta^{\alpha - 1} (1 + \theta)^{-\alpha - \beta}}{\beta(\alpha, \beta)}\)

  • Inventor: Dubey (1970)

  • Notation 1: \(\theta \sim \mathcal{B}^{-1}(\alpha, \beta)\)

  • Notation 2: \(p(\theta) = \mathcal{B}^{-1}(\theta | \alpha, \beta)\)

  • Parameter 1: shape \(\alpha > 0\)

  • Parameter 2: shape \(\beta > 0\)

  • Mean: \(E(\theta) = \frac{\alpha}{\beta - 1}\), for \(\beta > 1\)

  • Variance: \(var(\theta) = \frac{\alpha(\alpha + \beta - 1)}{(\beta - 1)^2 (\beta - 2)}\)

  • Mode: \(mode(\theta) = \frac{\alpha - 1}{\beta + 1}\)

The inverse-beta, also called the beta prime distribution, applies to variables that are continuous and positive. The inverse beta is the conjugate prior distribution of a parameter of a Bernoulli distribution expressed in odds.

The inverse-beta distribution has also been extended to the generalized beta prime distribution, though it is not (yet) included here.

References

Dubey, S.D. (1970). "Compound Gamma, Beta and F Distributions". Metrika, 16, p. 27--31.

See Also

dbeta

Examples

Run this code
# NOT RUN {
library(LaplacesDemon)
x <- dinvbeta(5:10, 2, 3)
x <- rinvbeta(10, 2, 3)

#Plot Probability Functions
x <- seq(from=0.1, to=20, by=0.1)
plot(x, dinvbeta(x,2,2), ylim=c(0,1), type="l", main="Probability Function",
     ylab="density", col="red")
lines(x, dinvbeta(x,2,3), type="l", col="green")
lines(x, dinvbeta(x,3,2), type="l", col="blue")
legend(2, 0.9, expression(paste(alpha==2, ", ", beta==2),
     paste(alpha==2, ", ", beta==3), paste(alpha==3, ", ", beta==2)),
     lty=c(1,1,1), col=c("red","green","blue"))
# }

Run the code above in your browser using DataLab