Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/family.aunivariate.R

Estimation of the shape parameters of the two-parameter beta distribution.

1 2 3 |

`lshape1, lshape2, i1, i2` |
Details at |

`trim` |
An argument which is fed into |

`A, B` |
Lower and upper limits of the distribution.
The defaults correspond to the |

`parallel, zero` |
See |

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`

.

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*,
New York: Marcel Dekker.

`betaff`

,
`Beta`

,
`genbetaII`

,
`betaII`

,
`betabinomialff`

,
`betageometric`

,
`betaprime`

,
`rbetageom`

,
`rbetanorm`

,
`kumar`

,
`simulate.vlm`

.

1 2 3 4 5 6 7 8 9 10 11 | ```
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))
``` |

```
Loading required package: stats4
Loading required package: splines
VGLM linear loop 1 : coefficients = 0.99453982, 2.66042022
VGLM linear loop 2 : coefficients = 1.0100043, 2.6876497
VGLM linear loop 3 : coefficients = 1.0102765, 2.6881580
VGLM linear loop 4 : coefficients = 1.0102766, 2.6881582
VGLM linear loop 1 : coefficients = 0.00023757603, 0.97934360189
VGLM linear loop 2 : coefficients = 0.010165579, 0.988799243
VGLM linear loop 3 : coefficients = 0.010224105, 0.988856275
VGLM linear loop 4 : coefficients = 0.010224107, 0.988856277
VGLM linear loop 5 : coefficients = 0.010224107, 0.988856277
loge(shape1) loge(shape2)
(Intercept) 0.01022411 0.9888563
shape1 shape2
1.010277 2.688158
VGLM linear loop 1 : loglikelihood = -1723.9357
VGLM linear loop 2 : loglikelihood = -1723.9035
VGLM linear loop 3 : loglikelihood = -1723.9035
shape1 shape2
1.010277 2.688158
meanY
7.181428 7.185306 7.185306
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.