Discrete Weibull {BDgraph} R Documentation

## The Discrete Weibull Distribution (Type 1)

### Description

Density, distribution function, quantile function and random generation for the discrete Weibull distribution (type I) with parameters q and β.

### Usage

```ddweibull( x, q = exp( -1 ), beta = 1, zero = TRUE )
pdweibull( x, q = exp( -1 ), beta = 1, zero = TRUE )
qdweibull( p, q = exp( -1 ), beta = 1, zero = TRUE )
rdweibull( n, q = exp( -1 ), beta = 1, zero = TRUE )
```

### Arguments

 `x` vector of quantiles. `p` vector of probabilities. `q, beta` shape and scale parameters, the latter defaulting to 1. `zero` logical; if `TRUE` (default), the support contains 0; `FALSE` otherwise. `n` number of observations. If `length(n) > 1`, the length is taken to be the number required.

### Details

The discrete Weibull distribution has density given by

f(x) = q^x^β - q^(x+1)^β, x = 0, 1, 2, …

And for the case `zero` = `FALSE`:

f(x) = q^(x-1)^β - q^x^β, x = 1, 2, …

Cumulative distribution function

F(x) = 1-q^(x+1)^β

And for the case `zero` = `FALSE`, `x+1` should replaced by `x`.

### Value

`ddweibull` gives the density, `pdweibull` gives the distribution function, `qdweibull` gives the quantile function, and `rdweibull` generates random values.

### References

Nakagawa, T. and Osaki, S. (1975). The Discrete Weibull Distribution. IEEE Transactions on Reliability, R-24, 300-301.

### Examples

```n <- 1000
q <- 0.4
beta <- 0.8

rdw <- rdweibull( n = n, q = q, beta = beta )

plot( prop.table( table( rdw ) ), type = "h", col = "gray50" )

x <- 0:max( rdw )

lines( x, ddweibull( x = x, q = q, beta = beta ), type = "o", col = "blue", lwd = 2 )

hist( pdweibull( x = rdw, q = q, beta = beta ) )

plot( ecdf( rdw ) )
lines( x, pdweibull( x, q = q, beta = beta ), col = "blue", lwd = 2, type = "s" )
```

[Package BDgraph version 2.64 Index]