The discrete Weibull distribution extends the familiar continuous Weibull to a lattice of integer values. Its survival function is a stretched exponential,
\[
S(x)=q^{\,x^{k}},\qquad x=0,1,2,\ldots,\; 00,
\]
which yields the probability mass function
\[
P(X=x)=q^{\,x^{k}}-q^{\,(x+1)^{k}}\; .
\]
Because the hazard (failure rate) can be increasing, decreasing or constant, the distribution is particularly useful in reliability, survival analysis and over‑dispersed count data. Below is a self‑contained, web‑ready summary of the model, its theory, estimation, and applications.
Mathematical Properties
Probability Mass Function & Survival Function
From the survival function above, the probability mass at an integer point is obtained by finite differencing. The pmf is always non‑negative and sums to one over the support \(\{0,1,2,\dots\}\). For \(k=1\) the pmf reduces to the geometric distribution \(P(X=x)=q(1-q)^{x}\). As \(k\) grows the mass concentrates near the origin, while \(k
Mean and Variance (General Form)
In general the moments are not available in closed form. They can be expressed through the Lerch transcendent or numerically. For the special case \(k=1\) we recover the familiar geometric mean \[ \mathbb{E}[X]=\frac{q}{1-q} \] and variance \(\mathbb{V}[X]=\frac{q}{(1-q)^{2}}\). For \(k>1\) the variance is typically smaller than the mean, indicating a clustering effect; for \(k
Hazard Function
The discrete hazard (conditional probability of an event at time \(x\) given survival to \(x-1\)) is \[ h(x)=\frac{q^{\,x^{k}}-q^{\,(x+1)^{k}}}{q^{\,x^{k}}}=1-q^{(x+1)^{k}-x^{k}}, \] which is monotone in \(x\). This permits three distinct shapes:
- Increasing hazard for \(k>1\) (wear‑out failure).
- Decreasing hazard for \(k
- Constant hazard for \(k=1\) (geometric).
Parameter Estimation
Maximum Likelihood
Given independent observations \(x_{1},\dots,x_{n}\), the likelihood is
\[
L(q,k)=\prod_{i=1}^{n}\bigl(q^{x_{i}^{k}}-q^{(x_{i}+1)^{k}}\bigr),
\]
and the log‑likelihood is differentiated numerically. Standard routines such as optim (R) or scipy.optimize.minimize (Python) provide robust solutions even when the objective surface is non‑linear. Convergence is usually achieved within 10–20 iterations for well‑behaved data.
Bayesian Inference
Conjugate priors do not exist for \((q,k)\). A common strategy is to use vague beta and gamma priors for \(q\) and \(k\) and sample from the posterior with Markov chain Monte Carlo. Gibbs sampling is infeasible; instead Hamiltonian Monte Carlo (e.g., Stan) or slice sampling are preferred because they efficiently handle the two parameters. Empirical Bayes (plug‑in maximum likelihood estimates for hyper‑parameters) is also a viable shortcut.
Random Variate Generation
The inverse CDF method is most convenient. Generate a uniform \(U\in(0,1)\) and compute \[ X=\Bigl\lfloor \Bigl(\frac{\log U}{\log q}\Bigr)^{1/k}\Bigr\rfloor , \] where \(\lfloor\cdot\rfloor\) denotes the floor operation. This produces exact samples without rejection.
Zero‑Inflated and Generalized Variants
Real data often contain excess zeros. The zero‑inflated discrete Weibull (ZI‑DW) adds a point mass at zero: \[ P(X=0)=\pi+(1-\pi)(q^{\,0}-q^{\,1})=\pi+(1-\pi)(1-q), \] where \(\pi\) is the extra zero probability. The rest of the distribution follows the ordinary pmf. ZI‑DW is especially useful in reliability studies where some units are inherently failure‑free.
Applications
- Reliability Engineering: The stretched‑exponential survival function captures wear‑out, early‑life and random failure mechanisms in electronic components and mechanical systems.
- Survival Analysis: In discrete time models for time‑to‑event data (e.g., annual disease incidence), the DW hazard allows flexible modelling of age or dose dependence.
- Queueing & Operational Research: The DW can model inter‑arrival or service‑time distributions that are over‑dispersed compared to the exponential, improving performance estimates for systems with bursty traffic.
- Data Science & Machine Learning: As a baseline for over‑dispersed counts, it provides a benchmark against Poisson, negative binomial and zero‑inflated Poisson models.
Software Implementation
Most statistical libraries provide the continuous Weibull; discrete versions can be coded quickly. Sample R code for maximum likelihood:
pmf_dw method="L-BFGS-B", lower=c(1e-6,1e-6), upper=c(0.999,10))
Python users can use scipy.optimize.minimize in a similar fashion. For Bayesian sampling, Stan or PyMC3 can be employed by defining the pmf explicitly and specifying beta/gamma priors for \(q\) and \(k\).
Conclusion
The discrete Weibull distribution occupies a unique niche among count models: it provides a smooth bridge between the geometric and heavy‑tailed behaviours, a monotonic hazard suitable for many engineering contexts, and sufficient flexibility to capture over‑dispersion. While analytic expressions for moments are limited to special cases, modern computational tools make estimation straightforward. Its adaptability across disciplines makes it a valuable addition to any data scientist’s toolbox.
No comments yet. Be the first to comment!