dist.Inverse.Beta: Inverse Beta Distribution

Description Usage Arguments Details Value References See Also Examples

Description

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

Usage

1
2
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.

Details

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.

Value

dinvbeta gives the density and rinvbeta generates random deviates.

References

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

See Also

dbeta

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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"))

Example output



LaplacesDemon documentation built on July 9, 2021, 5:07 p.m.