View source: R/family.aunivariate.R
betaprime  R Documentation 
Estimation of the two shape parameters of the betaprime distribution by maximum likelihood estimation.
betaprime(lshape = "loglink", ishape1 = 2, ishape2 = NULL, zero = NULL)
lshape 
Parameter link function applied to the two (positive) shape
parameters. See 
ishape1, ishape2, zero 
See

The betaprime distribution is given by
f(y) = y^(shape11) * (1+y)^(shape1shape2) / B(shape1,shape2)
for y > 0. The shape parameters are positive, and here, B is the beta function. The mean of Y is shape1 / (shape21) provided shape2>1; these are returned as the fitted values.
If Y has a Beta(shape1,shape2) distribution then Y/(1Y) and (1Y)/Y have a Betaprime(shape1,shape2) and Betaprime(shape2,shape1) distribution respectively. Also, if Y1 has a gamma(shape1) distribution and Y2 has a gamma(shape2) distribution then Y1/Y2 has a Betaprime(shape1,shape2) distribution.
An object of class "vglmff"
(see vglmffclass
).
The object is used by modelling functions
such as vglm
,
rrvglm
and vgam
.
The response must have positive values only.
The betaprime distribution is also known as the beta distribution of the second kind or the inverted beta distribution.
Thomas W. Yee
Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1995). Chapter 25 of: Continuous Univariate Distributions, 2nd edition, Volume 2, New York: Wiley.
betaff
,
Beta
.
nn < 1000 bdata < data.frame(shape1 = exp(1), shape2 = exp(3)) bdata < transform(bdata, yb = rbeta(nn, shape1, shape2)) bdata < transform(bdata, y1 = (1yb) / yb, y2 = yb / (1yb), y3 = rgamma(nn, exp(3)) / rgamma(nn, exp(2))) fit1 < vglm(y1 ~ 1, betaprime, data = bdata, trace = TRUE) coef(fit1, matrix = TRUE) fit2 < vglm(y2 ~ 1, betaprime, data = bdata, trace = TRUE) coef(fit2, matrix = TRUE) fit3 < vglm(y3 ~ 1, betaprime, data = bdata, trace = TRUE) coef(fit3, matrix = TRUE) # Compare the fitted values with(bdata, mean(y3)) head(fitted(fit3)) Coef(fit3) # Useful for interceptonly models
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.