Estimation of the shape parameters of the two-parameter beta distribution.
betaR(lshape1 = "loglink", lshape2 = "loglink",
i1 = NULL, i2 = NULL, trim = 0.05,
A = 0, B = 1, parallel = FALSE, zero = NULL)
Details at CommonVGAMffArguments
.
See Links
for more choices.
An argument which is fed into mean()
; it is the fraction (0
to 0.5) of observations to be trimmed from each end of the response
y
before the mean is computed. This is used when computing
initial values, and guards against outliers.
Lower and upper limits of the distribution. The defaults correspond to the standard beta distribution where the response lies between 0 and 1.
See CommonVGAMffArguments
for more information.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
The two-parameter beta distribution is given by
beta
).
The shape parameters are positive, and
here, the limits
For the standard beta distribution the variance of
Another parameterization of the beta distribution involving the mean
and a precision parameter is implemented in betaff
.
Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1995). Chapter 25 of: Continuous Univariate Distributions, 2nd edition, Volume 2, New York: Wiley.
Gupta, A. K. and Nadarajah, S. (2004). Handbook of Beta Distribution and Its Applications, New York: Marcel Dekker.
betaff
,
Beta
,
genbetaII
,
betaII
,
betabinomialff
,
betageometric
,
betaprime
,
rbetageom
,
rbetanorm
,
kumar
,
simulate.vlm
.
# NOT RUN {
bdata <- data.frame(y = rbeta(n = 1000, shape1 = exp(0), shape2 = exp(1)))
fit <- vglm(y ~ 1, betaR(lshape1 = "identitylink", lshape2 = "identitylink"),
data = bdata, trace = TRUE, crit = "coef")
fit <- vglm(y ~ 1, betaR, data = bdata, trace = TRUE, crit = "coef")
coef(fit, matrix = TRUE)
Coef(fit) # Useful for intercept-only models
bdata <- transform(bdata, Y = 5 + 8 * y) # From 5 to 13, not 0 to 1
fit <- vglm(Y ~ 1, betaR(A = 5, B = 13), data = bdata, trace = TRUE)
Coef(fit)
c(meanY = with(bdata, mean(Y)), head(fitted(fit),2))
# }
Run the code above in your browser using DataLab