
betaff(A=0, B=1,
lmu=if(A==0 & B==1) "logit" else "elogit", lphi="loge",
emu=if(lmu=="elogit") list(min=A,max=B) else list(),
ephi=list(), imu=NULL, iphi=NULL, method.init=1, zero=NULL)
Links
for more choices.earg
in Links
for general information.NULL
value means a value is obtained in the
initialize
slot.CommonVGAMffArguments
for more information."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.beta
).
The parameter $\mu_1$ satisfies
$\mu_1 = (\mu - A) / (B-A)$
where $\mu$ is the mean of $Y$.
That is, $\mu_1$ is the mean of of a standard beta distribution:
$E(Y) = A + (B-A) \times \mu_1$,
and these are the fitted values of the object.
Also, $\phi$ is positive and $A < \mu < B$.
Here, the limits $A$ and $B$ are known. Another parameterization of the beta distribution involving the raw
shape parameters is implemented in beta.ab
.
For general $A$ and $B$, the variance of $Y$ is $(B-A)^2 \times \mu_1 \times (1-\mu_1) / (1+\phi)$. Then $\phi$ can be interpreted as a precision parameter in the sense that, for fixed $\mu$, the larger the value of $\phi$, the smaller the variance of $Y$. Also, $\mu_1 = shape1/(shape1+shape2)$ and $\phi = shape1+shape2$.
Fisher scoring is implemented.
If $A$ and $B$ are unknown then the beta4()
can be used to estimate these too.
Documentation accompanying the
beta.ab
,
Beta
,
genbetaII
,
betaII
,
betabin.ab
,
betageometric
,
betaprime
,
rbetageom
,
rbetanorm
,
kumar
,
beta4
,
elogit
.y = rbeta(n <- 1000, shape1=exp(0), shape2=exp(1))
fit = vglm(y ~ 1, betaff, trace = TRUE)
coef(fit, matrix=TRUE)
Coef(fit) # Useful for intercept-only models
# General A and B, and with a covariate
x = runif(n <- 1000)
mu = logit(0.5-x, inverse=TRUE)
prec = exp(3+x) # phi
shape2 = prec * (1-mu)
shape1 = mu * prec
y = rbeta(n, shape1=shape1, shape2=shape2)
Y = 5 + 8 * y # From 5 to 13, not 0 to 1
fit = vglm(Y ~ x, betaff(A=5,B=13), trace=TRUE)
coef(fit, mat=TRUE)
Run the code above in your browser using DataLab