Last chance! 50% off unlimited learning
Sale ends in
betaprime(link = "loge", earg=list(), i1 = 2, i2 = NULL, zero = NULL)
Links
for more choices.earg
in Links
for general information.NULL
value means it is obtained in the initialize
slot.
Note that i2
is obtained using i1
.shape1
and shape2
respectively. If zero=NULL
"vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.If $Y$ has a $Beta(shape1,shape2)$ distribution then $Y/(1-Y)$ and $(1-Y)/Y$ have a $Betaprime(shape1,shape2)$ and $Betaprime(shape2,shape1)$ distribution respectively. Also, if $Y_1$ has a $gamma(shape1)$ distribution and $Y_2$ has a $gamma(shape2)$ distribution then $Y_1/Y_2$ has a $Betaprime(shape1,shape2)$ distribution.
Documentation accompanying the
betaff
.nn = 1000
betadat = data.frame(shape1 = exp(1), shape2 = exp(3))
betadat = transform(betadat, yb = rbeta(nn, shape1, shape2))
betadat = transform(betadat, y1 = (1-yb)/yb, y2 = yb/(1-yb),
y3 = rgamma(nn, exp(3)) / rgamma(nn, exp(2)))
fit1 = vglm(y1 ~ 1, betaprime, betadat, trace=TRUE)
coef(fit1, matrix=TRUE)
fit2 = vglm(y2 ~ 1, betaprime, betadat, trace=TRUE)
coef(fit2, matrix=TRUE)
fit3 = vglm(y3 ~ 1, betaprime, betadat, trace=TRUE)
coef(fit3, matrix=TRUE)
# Compare the fitted values
with(betadat, mean(y3))
head(fitted(fit3))
Coef(fit3) # Useful for intercept-only models
Run the code above in your browser using DataLab