# expgeometric: Exponential Geometric Distribution Family Function In VGAM: Vector Generalized Linear and Additive Models

## Description

Estimates the two parameters of the exponential geometric distribution by maximum likelihood estimation.

## Usage

 ```1 2 3``` ```expgeometric(lscale = "loglink", lshape = "logitlink", iscale = NULL, ishape = NULL, tol12 = 1e-05, zero = 1, nsimEIM = 400) ```

## Arguments

 `lscale, lshape` Link function for the two parameters. See `Links` for more choices. `iscale, ishape` Numeric. Optional initial values for the scale and shape parameters. `tol12` Numeric. Tolerance for testing whether a parameter has value 1 or 2. `zero, nsimEIM` See `CommonVGAMffArguments`.

## Details

The exponential geometric distribution has density function

(1/c) * (1 - s) * e^(-y/c) * (1 - s * e^(-y/c))^(-2)

where y > 0, c > 0 and 0 < s < 1. The mean, (c * (s - 1)/ s) * log(1 - s) is returned as the fitted values. Note the median is c * log(2 - s). Simulated Fisher scoring is implemented.

## Value

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

## Note

We define `scale` as the reciprocal of the scale parameter used by Adamidis and Loukas (1998).

## Author(s)

J. G. Lauder and T. W. Yee

## References

Adamidis, K., Loukas, S. (1998). A lifetime distribution with decreasing failure rate. Statistics and Probability Letters, 39, 35–42.

`dexpgeom`, `exponential`, `geometric`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```## Not run: Scale <- exp(2); shape = logitlink(-1, inverse = TRUE); edata <- data.frame(y = rexpgeom(n = 2000, scale = Scale, shape = shape)) fit <- vglm(y ~ 1, expgeometric, edata, trace = TRUE) c(with(edata, mean(y)), head(fitted(fit), 1)) coef(fit, matrix = TRUE) Coef(fit) summary(fit) ## End(Not run) ```

### Example output

```Loading required package: stats4
VGLM    linear loop  1 :  loglikelihood = -5672.17283
VGLM    linear loop  2 :  loglikelihood = -5670.44506
VGLM    linear loop  3 :  loglikelihood = -5670.43414
VGLM    linear loop  4 :  loglikelihood = -5670.43413
 6.310734 6.303428
(Intercept)       2.051906       -0.6861986
scale     shape
7.7827217 0.3348793

Call:
vglm(formula = y ~ 1, family = expgeometric, data = edata, trace = TRUE)

Pearson residuals:
Min      1Q  Median     3Q   Max
loglink(scale)   -0.8181 -0.6203 -0.3332 0.2120 7.666
logitlink(shape) -1.1289 -0.8385 -0.1682 0.7299 6.922

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept):1   2.0519     0.0513  39.997  < 2e-16 ***
(Intercept):2  -0.6862     0.2408  -2.849  0.00438 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1