betaff {VGAM} | R Documentation |
The Two-parameter Beta Distribution Family Function
Description
Estimation of the mean and precision parameters of the beta distribution.
Usage
betaff(A = 0, B = 1, lmu = "logitlink", lphi = "loglink",
imu = NULL, iphi = NULL,
gprobs.y = ppoints(8), gphi = exp(-3:5)/4, zero = NULL)
Arguments
A , B |
Lower and upper limits of the distribution. The defaults correspond to the standard beta distribution where the response lies between 0 and 1. |
lmu , lphi |
Link function for the mean and precision parameters.
The values |
imu , iphi |
Optional initial value for the mean and precision parameters
respectively. A |
gprobs.y , gphi , zero |
See |
Details
The two-parameter beta distribution can be written
for , and
is the beta function
(see
beta
).
The parameter satisfies
where
is the mean of
.
That is,
is the mean of of a
standard beta distribution:
,
and these are the fitted values of the object.
Also,
is positive
and
.
Here, the limits
and
are known.
Another parameterization of the beta distribution
involving the raw
shape parameters is implemented in betaR
.
For general and
, the variance of
is
.
Then
can be interpreted as
a precision parameter
in the sense that, for fixed
,
the larger the value of
, the smaller the variance of
.
Also,
and
.
Fisher scoring is implemented.
Value
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions
such as vglm
,
and vgam
.
Note
The response must have values in the
interval (,
).
The user currently needs to manually choose
lmu
to
match the input of arguments A
and B
, e.g.,
with extlogitlink
; see the example below.
Author(s)
Thomas W. Yee
References
Ferrari, S. L. P. and Francisco C.-N. (2004). Beta regression for modelling rates and proportions. Journal of Applied Statistics, 31, 799–815.
See Also
betaR
,
Beta
,
dzoabeta
,
genbetaII
,
betaII
,
betabinomialff
,
betageometric
,
betaprime
,
rbetageom
,
rbetanorm
,
kumar
,
extlogitlink
,
simulate.vlm
.
Examples
bdata <- data.frame(y = rbeta(nn <- 1000, shape1 = exp(0),
shape2 = exp(1)))
fit1 <- vglm(y ~ 1, betaff, data = bdata, trace = TRUE)
coef(fit1, matrix = TRUE)
Coef(fit1) # Useful for intercept-only models
# General A and B, and with a covariate
bdata <- transform(bdata, x2 = runif(nn))
bdata <- transform(bdata, mu = logitlink(0.5 - x2, inverse = TRUE),
prec = exp(3.0 + x2)) # prec == phi
bdata <- transform(bdata, shape2 = prec * (1 - mu),
shape1 = mu * prec)
bdata <- transform(bdata,
y = rbeta(nn, shape1 = shape1, shape2 = shape2))
bdata <- transform(bdata, Y = 5 + 8 * y) # From 5--13, not 0--1
fit <- vglm(Y ~ x2, data = bdata, trace = TRUE,
betaff(A = 5, B = 13, lmu = extlogitlink(min = 5, max = 13)))
coef(fit, matrix = TRUE)