beta.ab {VGAM} | R Documentation |
Estimation of the shape parameters of the two-parameter beta distribution.
beta.ab(lshape1="loge", lshape2="loge", eshape1=list(), eshape2=list(), i1 = NULL, i2 = NULL, trim = 0.05, A = 0, B = 1, parallel=FALSE, zero=NULL)
lshape1, lshape2 |
Parameter link functions applied to the two shape parameters.
See Links for more choices.
The log link (defaults) ensures that the parameters are positive.
|
eshape1, eshape2 |
List. Extra argument for the links.
See earg in Links for general information.
|
i1, i2 |
Initial value for the first and second shape parameters respectively.
A NULL value means it is obtained in the initialize slot.
|
trim |
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.
|
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.
|
parallel, zero |
See CommonVGAMffArguments for more information.
|
The two-parameter beta distribution is given by f(y) =
(y-A)^(shape1-1) * (B-y)^(shape2-1) / [Beta(shape1,shape2) * (B-A)^(shape1+shape2-1)]
for A < y < B, and Beta(.,.) is the beta function
(see beta
).
The shape parameters are positive, and
here, the limits A and B are known.
The mean of Y is E(Y) = A + (B-A) * shape1 /
(shape1 + shape2), and these are the fitted values of the object.
For the standard beta distribution the variance of Y is shape1 * shape2 / ((1+shape1+shape2) * (shape1+shape2)^2). If σ^2= 1 / (1+shape1+shape2) then the variance of Y can be written mu*(1-mu)*sigma^2 where mu=shape1 / (shape1 + shape2) is the mean of Y.
Another parameterization of the beta distribution involving the mean
and a precision parameter is implemented in betaff
.
If A and B are unknown, then the VGAM family function
beta4()
can be used to estimate these too.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
The response must have values in the interval (A, B).
VGAM 0.7-4 and prior called this function betaff
.
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.
Gupta, A. K. and Nadarajah, S. (2004) Handbook of Beta Distribution and Its Applications, NY: Marcel Dekker, Inc.
Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.
betaff
,
Beta
,
genbetaII
,
betaII
,
betabin.ab
,
betageometric
,
betaprime
,
rbetageom
,
rbetanorm
,
kumar
,
beta4
.
y = rbeta(n=1000, shape1=exp(0), shape2=exp(1)) fit = vglm(y ~ 1, beta.ab(lshape1="identity", lshape2="identity"), trace = TRUE, crit="c") fit = vglm(y ~ 1, beta.ab, trace = TRUE, crit="c") coef(fit, matrix=TRUE) Coef(fit) # Useful for intercept-only models Y = 5 + 8 * y # From 5 to 13, not 0 to 1 fit = vglm(Y ~ 1, beta.ab(A=5, B=13), trace = TRUE) Coef(fit) c(mean(Y), fitted(fit)[1:2,])