Discrete Weibull (Type 1) {DiscreteWeibull} | R Documentation |
The type 1 discrete Weibull distribution
Description
Probability mass function, distribution function, quantile function and random generation for the discrete Weibull distribution with parameters and
Usage
ddweibull(x, q, beta, zero = FALSE)
pdweibull(x, q, beta, zero = FALSE)
qdweibull(p, q, beta, zero = FALSE)
rdweibull(n, q, beta, zero = FALSE)
Arguments
x |
vector of quantiles |
p |
vector of probabilities |
q |
first parameter |
beta |
second parameter |
zero |
|
n |
sample size |
Details
The discrete Weibull distribution has probability mass function given by ,
, if
zero
=FALSE
; or ,
, if
zero
=TRUE
. The cumulative distribution function is if
zero
=FALSE
; otherwise
Value
ddweibull
gives the probability function, pdweibull
gives the distribution function, qdweibull
gives the quantile function, and rdweibull
generates random values.
Author(s)
Alessandro Barbiero
Examples
# Ex.1
x <- 1:10
q <- 0.6
beta <- 0.8
ddweibull(x, q, beta)
t <- qdweibull(0.99, q, beta)
t
pdweibull(t, q, beta)
#
x <- 0:10
ddweibull(x, q, beta, zero=TRUE)
t <- qdweibull(0.99, q, beta, zero=TRUE)
t
pdweibull(t, q, beta, zero=TRUE)
# Ex.2
q <- 0.4
beta <- 0.7
n <- 100
x <- rdweibull(n, q, beta)
tabulate(x)/sum(tabulate(x))
y <- 1:round(max(x))
# compare with
ddweibull(y, q, beta)
[Package DiscreteWeibull version 1.1 Index]