# expgeometricUC: The Exponential Geometric Distribution In VGAM: Vector Generalized Linear and Additive Models

 expgeom R Documentation

## The Exponential Geometric Distribution

### Description

Density, distribution function, quantile function and random generation for the exponential geometric distribution.

### Usage

```dexpgeom(x, scale = 1, shape, log = FALSE)
pexpgeom(q, scale = 1, shape)
qexpgeom(p, scale = 1, shape)
rexpgeom(n, scale = 1, shape)
```

### Arguments

 `x, q` vector of quantiles. `p` vector of probabilities. `n` number of observations. If `length(n) > 1` then the length is taken to be the number required. `scale, shape` positive scale and shape parameters. `log` Logical. If `log = TRUE` then the logarithm of the density is returned.

### Details

See `expgeometric`, the VGAM family function for estimating the parameters, for the formula of the probability density function and other details.

### Value

`dexpgeom` gives the density, `pexpgeom` gives the distribution function, `qexpgeom` gives the quantile function, and `rexpgeom` generates random deviates.

### 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

`expgeometric`, `exponential`, `geometric`.

### Examples

```## Not run:
shape <- 0.5; scale <- 1; nn <- 501
x <- seq(-0.10, 3.0, len = nn)
plot(x, dexpgeom(x, scale, shape), type = "l", las = 1, ylim = c(0, 2),
ylab = paste("[dp]expgeom(shape = ", shape, ", scale = ", scale, ")"),
col = "blue", cex.main = 0.8,
main = "Blue is density, red is cumulative distribution function",
sub = "Purple lines are the 10,20,...,90 percentiles")
lines(x, pexpgeom(x, scale, shape), col = "red")
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qexpgeom(probs, scale, shape)
lines(Q, dexpgeom(Q, scale, shape), col = "purple", lty = 3, type = "h")
lines(Q, pexpgeom(Q, scale, shape), col = "purple", lty = 3, type = "h")
abline(h = probs, col = "purple", lty = 3)
max(abs(pexpgeom(Q, scale, shape) - probs))  # Should be 0

## End(Not run)
```

VGAM documentation built on July 6, 2022, 5:05 p.m.