| Discrete Weibull {BDgraph} | R Documentation |
Density, distribution function, quantile function and random generation for the discrete Weibull distribution (type I) with parameters q and β.
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 )
x |
vector of quantiles. |
p |
vector of probabilities. |
q, beta |
shape and scale parameters, the latter defaulting to 1. |
zero |
logical; if |
n |
number of observations. If |
The discrete Weibull distribution has density given by
f(x) = q^x^β - q^(x+1)^β, x = 0, 1, 2, …
For the case zero = FALSE:
f(x) = q^(x-1)^β - q^x^β, x = 1, 2, …
Cumulative distribution function
F(x) = 1-q^(x+1)^β
For the case zero = FALSE, x+1 should replaced by x.
ddweibull gives the density, pdweibull gives the distribution function, qdweibull gives the quantile function, and rdweibull generates random values.
Reza Mohammadi a.mohammadi@uva.nl, Pariya Behrouzi, Veronica Vinciotti
Nakagawa, T. and Osaki, S. (1975). The Discrete Weibull Distribution. IEEE Transactions on Reliability, R-24, 300-301, doi: 10.1109/TR.1975.5214915
n = 1000 q = 0.4 beta = 0.8 set.seed( 7 ) 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" )