# kumar: Kumaraswamy Regression Family Function In VGAM: Vector Generalized Linear and Additive Models

## Description

Estimates the two parameters of the Kumaraswamy distribution by maximum likelihood estimation.

## Usage

 ```1 2 3``` ```kumar(lshape1 = "loglink", lshape2 = "loglink", ishape1 = NULL, ishape2 = NULL, gshape1 = exp(2*ppoints(5) - 1), tol12 = 1.0e-4, zero = NULL) ```

## Arguments

 `lshape1, lshape2` Link function for the two positive shape parameters, respectively, called a and b below. See `Links` for more choices.
 `ishape1, ishape2` Numeric. Optional initial values for the two positive shape parameters. `tol12` Numeric and positive. Tolerance for testing whether the second shape parameter is either 1 or 2. If so then the working weights need to handle these singularities. `gshape1` Values for a grid search for the first shape parameter. See `CommonVGAMffArguments` for more information. `zero` See `CommonVGAMffArguments`.

## Details

The Kumaraswamy distribution has density function

a*b*y^(a-1)*(1-y^a)^(b-1)

where 0 < y < 1 and the two shape parameters, a and b, are positive. The mean is b * Beta(1+1/a,b) (returned as the fitted values) and the variance is b * Beta(1+2/a,b) - (b * Beta(1+1/a,b))^2. Applications of the Kumaraswamy distribution include the storage volume of a water reservoir. Fisher scoring is implemented. Handles multiple responses (matrix input).

## Value

An object of class `"vglmff"` (see `vglmff-class`). The object is used by modelling functions such as `vglm` and `vgam`.

T. W. Yee

## References

Kumaraswamy, P. (1980). A generalized probability density function for double-bounded random processes. Journal of Hydrology, 46, 79–88.

Jones, M. C. (2009). Kumaraswamy's distribution: A beta-type distribution with some tractability advantages. Statistical Methodology, 6, 70–81.

`dkumar`, `betaff`, `simulate.vlm`.

## Examples

 ```1 2 3 4 5 6 7``` ```shape1 <- exp(1); shape2 <- exp(2) kdata <- data.frame(y = rkumar(n = 1000, shape1, shape2)) fit <- vglm(y ~ 1, kumar, data = kdata, trace = TRUE) c(with(kdata, mean(y)), head(fitted(fit), 1)) coef(fit, matrix = TRUE) Coef(fit) summary(fit) ```

### Example output

```Loading required package: stats4
VGLM    linear loop  1 :  loglikelihood = 481.40387
VGLM    linear loop  2 :  loglikelihood = 484.397
VGLM    linear loop  3 :  loglikelihood = 484.41951
VGLM    linear loop  4 :  loglikelihood = 484.41951
 0.4041637 0.4040727
(Intercept)        1.004928        2.073021
shape1   shape2
2.731711 7.948800

Call:
vglm(formula = y ~ 1, family = kumar, data = kdata, trace = TRUE)

Pearson residuals:
Min      1Q Median     3Q    Max
loglink(shape1) -5.416 -0.4898 0.2566 0.8061 1.1107
loglink(shape2) -8.519 -0.1266 0.3598 0.5900 0.6587

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept):1  1.00493    0.02876   34.95   <2e-16 ***
(Intercept):2  2.07302    0.06458   32.10   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1