Learn R Programming

VGAM (version 0.8-2)

Benini: The Benini Distribution

Description

Density, distribution function, quantile function and random generation for the Benini distribution with parameter shape.

Usage

dbenini(x, shape, y0, log=FALSE)
pbenini(q, shape, y0)
qbenini(p, shape, y0)
rbenini(n, shape, y0)

Arguments

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations. Must be a positive integer of length 1.
shape
the shape parameter $b$.
y0
the scale parameter $y_0$.
log
Logical. If log=TRUE then the logarithm of the density is returned.

Value

  • dbenini gives the density, pbenini gives the distribution function, qbenini gives the quantile function, and rbenini generates random deviates.

Details

See benini, the VGAM family function for estimating the parameter $b$ by maximum likelihood estimation, for the formula of the probability density function and other details.

References

Kleiber, C. and Kotz, S. (2003) Statistical Size Distributions in Economics and Actuarial Sciences, Hoboken, NJ: Wiley-Interscience.

See Also

benini.

Examples

Run this code
y0 = 1; shape = exp(1)
xx = seq(0.0, 4, len=101)
plot(xx, dbenini(xx, y0=y0,shape=shape), type="l", col="blue", las=1,
     main="Blue is density, red is cumulative distribution function",
     sub="Purple lines are the 10,20,...,90 percentiles", ylim=0:1,
     ylab="", xlab="x")
abline(h=0, col="blue", lty=2)
lines(xx, pbenini(xx, y0=y0,shape=shape), col="red")
probs = seq(0.1, 0.9, by=0.1)
Q = qbenini(probs, y0=y0,shape=shape)
lines(Q, dbenini(Q, y0=y0,shape=shape), col="purple", lty=3, type="h")
pbenini(Q, y0=y0,shape=shape) - probs    # Should be all zero

Run the code above in your browser using DataLab