Weibull distribution
Weibull distribution: the lifetime of things that wear out, or fail early. With the default parameters (shape k = 1.5, scale λ = 1) its mean is 0.90275 and its standard deviation 0.61294. Use the simulator below to draw samples and see it take shape.
Simulate it
Change the parameters, then draw random samples. The bars are the samples; the line is the exact density. With more samples the bars settle onto it.
Samples to draw
What is the Weibull distribution?
The Weibull distribution models how long something lasts. Its shape parameter k lets the failure rate rise, stay flat or fall as the item ages: k > 1 means wear-out (the older the part, the more likely it fails), k = 1 means a constant failure rate (the exponential distribution), and k < 1 means 'infant mortality' (failures concentrated early).
That flexibility makes it the standard model in reliability engineering and survival analysis, and also in wind-speed studies, where it describes how often each wind speed occurs.
Where it is used
- Time to failure of bearings, batteries and other components.
- Reliability and warranty analysis.
- Survival times in medical studies.
- Wind-speed distribution for wind-energy planning.
- Time until a repair or a delivery is completed.
Shape and parameters
For k < 1 the density falls steeply from zero; for k = 1 it is the exponential; for k > 1 it rises to a peak and then falls, becoming more symmetric as k approaches 3 or 4. The scale λ is the 'characteristic life': about 63% of items have failed by time λ whatever the shape.
What it assumes
- Positive values (times).
- A failure rate that changes as a power of time.
How it relates to other distributions
- Exponential distribution: A Weibull with shape 1.
- Gamma distribution: Another flexible family for positive values.
- Log-normal distribution: Another standard lifetime model.
Common mistakes
- Assuming a constant failure rate (exponential) when parts clearly wear out.
- Mixing up the shape and scale parameters.
- Fitting a Weibull to data from a mix of failure causes without checking.
How to work it out
- 1
The probability density function (the formula that gives the shape):
- 2
Its mean (the long-run average) and variance (the spread):
- 3
Worked example with the default parameters (shape k = 1.5, scale λ = 1): With shape 1.5 and scale 1, what is the probability of failure before time 0.5?
LaTeX source of the formulas on this page
\[ f(x)=\frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-(x/\lambda)^{k}},\quad x\ge 0 \]
\[ \mu = \lambda\,\Gamma\!\left(1+\frac{1}{k}\right),\qquad \sigma^2 = \lambda^2\left[\Gamma\!\left(1+\frac{2}{k}\right)-\Gamma\!\left(1+\frac{1}{k}\right)^2\right] \]
\[ \text{answer} = 0.2978 \]At a glance
| Property | Value |
|---|---|
| Type | Continuous (measurements) |
| Parameters | shape k; scale λ |
| Possible values | 0 to ∞ |
| Mean | 0.90275 |
| Variance | 0.37569 |
| Standard deviation | 0.61294 |
| Example (shape k = 1.5, scale λ = 1) | With shape 1.5 and scale 1, what is the probability of failure before time 0.5? Answer: 0.2978. |
How to compute it in Excel, Python and R
| Tool | Function |
|---|---|
| Excel / Google Sheets | =WEIBULL.DIST(x, k, λ, TRUE) |
| Python (SciPy) | scipy.stats.weibull_min.cdf(x, c=k, scale=lam) |
| R | pweibull(x, shape = k, scale = lambda) |
Questions
What is the Weibull distribution used for?
The lifetime of things that wear out, or fail early. Typical uses: Time to failure of bearings, batteries and other components. Reliability and warranty analysis. Survival times in medical studies.
What are the mean and variance of the Weibull distribution?
Mean: μ = λΓ(1+(1)/(k)). Variance: σ² = λ²[Γ(1+(2)/(k))-Γ(1+(1)/(k))²].
What does the Weibull distribution assume?
Positive values (times). A failure rate that changes as a power of time.
How do I calculate it in Excel?
=WEIBULL.DIST(x, k, λ, TRUE)
How is the Weibull distribution related to other distributions?
Exponential distribution: A Weibull with shape 1. Gamma distribution: Another flexible family for positive values. Log-normal distribution: Another standard lifetime model.