# Weibull Distribution: Formula, Parameters and Examples

The Weibull probability distribution is a continuous distribution used to model time to failure, time between events, and other positive-valued random variables. It is defined by two parameters: a shape parameter $k$ and a scale parameter $\lambda$. This article gives you the formula, explains what each parameter does, and walks through a full probability calculation.

## Quick Answer

- The Weibull probability density function is $f(x) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1} e^{-(x/\lambda)^k}$ for $x \ge 0$, where $k > 0$ is the shape parameter and $\lambda > 0$ is the scale parameter [1].
- The cumulative distribution function is $F(x) = 1 - e^{-(x/\lambda)^k}$, which gives the probability that a value falls at or below $x$ [2].
- The shape parameter $k$ controls the failure pattern. When $k = 1$ the Weibull reduces to the exponential distribution, and when $k = 2$ it becomes the Rayleigh distribution [1].
- The scale parameter $\lambda$ stretches the distribution along the x-axis. It is often called the characteristic life because $F(\lambda) = 1 - e^{-1} \approx 0.632$.
- Probabilities come from the CDF. For $k = 2$ and $\lambda = 1000$, the probability that a unit lasts beyond 1200 hours is 0.2369.

## The Formula

The Weibull probability density function for a variable $x$ is [1]:

$$f(x; \lambda, k) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1} e^{-(x/\lambda)^k}, \quad x \ge 0$$

Each symbol has a specific job:

| Symbol | Name | Meaning |
|---|---|---|
| $x$ | Variable | The value you are evaluating, such as hours, cycles or millimeters |
| $k$ | Shape parameter | Controls the curve's shape and the failure rate pattern |
| $\lambda$ | Scale parameter | Sets the spread along the x-axis, also called characteristic life |
| $e$ | Euler's number | The base of natural logarithms, about 2.71828 |

The cumulative distribution function, which gives the probability that $X \le x$, is [2]:

$$F(x) = 1 - e^{-(x/\lambda)^k}, \quad x \ge 0$$

The survival function is the complement, $S(x) = 1 - F(x) = e^{-(x/\lambda)^k}$ [2]. The hazard function is $h(x) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}$, so the failure rate is proportional to a power of time [1][2].

The shape parameter $k$ tells you how the hazard behaves. When $k < 1$ the hazard decreases over time, which fits early failures. When $k = 1$ the hazard is constant and the model matches the exponential distribution. When $k > 1$ the hazard increases, which fits wear-out failures [1].

## How to Calculate It Step by Step

1. **Identify your parameters.** You need $k$, $\lambda$ and the value $x$ you are evaluating. These come from a fit to data or from prior knowledge.
2. **Standardize the value.** Compute $x/\lambda$. This rescales your value onto the standard Weibull curve.
3. **Raise to the shape power.** Compute $(x/\lambda)^k$.
4. **Get the CDF.** Apply $F(x) = 1 - e^{-(x/\lambda)^k}$ for the probability at or below $x$.
5. **Get the survival probability.** Subtract from 1: $S(x) = 1 - F(x)$.
6. **Get the PDF if you need it.** Apply $f(x) = \frac{k}{\lambda}(x/\lambda)^{k-1} e^{-(x/\lambda)^k}$ for the density at that point.

## Worked Example

Suppose you have the lifetimes in hours of 20 light bulbs, and you want to model them with a Weibull distribution using $k = 2$ and $\lambda = 1000$.

| bulb_id | lifetime_hours | bulb_id | lifetime_hours |
|---|---|---|---|
| 1 | 820 | 11 | 1240 |
| 2 | 910 | 12 | 1280 |
| 3 | 950 | 13 | 1320 |
| 4 | 1010 | 14 | 1360 |
| 5 | 1040 | 15 | 1410 |
| 6 | 1080 | 16 | 1470 |
| 7 | 1120 | 17 | 1530 |
| 8 | 1150 | 18 | 1610 |
| 9 | 1180 | 19 | 1720 |
| 10 | 1210 | 20 | 1890 |

The sample size is 20. The sample mean lifetime is 1265.0000 hours and the sample standard deviation is 279.1434 hours.

Now compute the probability that a bulb lasts beyond 1200 hours.

**Step 1. Standardize.** $x/\lambda = 1200/1000 = 1.2$.

**Step 2. Raise to the shape power.** $(1.2)^2 = 1.44$.

**Step 3. Apply the CDF.** $F(1200) = 1 - e^{-1.44} = 0.7631$.

**Step 4. Get the survival probability.** $P(X > 1200) = 1 - 0.7631 = 0.2369$.

**Step 5. Get the PDF.** $f(1200) = (2.0/1000.0)(1200.0/1000.0)^1 e^{-(1200.0/1000.0)^2} = 0.0006$.

For reference, the theoretical Weibull mean is $\lambda \cdot \Gamma(1 + 1/k) = 1000.0 \cdot \Gamma(1.5) = 886.2269$ hours, and the theoretical standard deviation is 463.2514 hours.

## How to Interpret the Result

The CDF value of 0.7631 means about 76.31% of bulbs are expected to fail at or before 1200 hours under this model. The survival value of 0.2369 means about 23.69% are expected to last beyond 1200 hours.

The PDF value of 0.0006 is a density, not a probability. It describes how concentrated the distribution is near 1200 hours. You cannot read it as "0.06% chance of exactly 1200 hours" because the probability of any single exact value is zero for a continuous distribution. For background on that distinction, see the guide to the [probability density function](/blog/data-analysis/probability-density-function-definition-formula).

Notice the gap between the theoretical mean of 886.2269 hours and the sample mean of 1265.0000 hours. That gap tells you the assumed parameters do not match this dataset well. The sample mean is far higher than the model's mean, so the fitted parameters would need to change before you trust these probabilities. This is a normal check to run before reporting any Weibull result.

## Doing It in Software

**Excel.** Excel has a built-in Weibull function. The CDF call is `=WEIBULL.DIST(1200,2,1000,TRUE)` and it returns 0.7631. The PDF call is `=WEIBULL.DIST(1200,2,1000,FALSE)` and it returns 0.0006. The arguments are the value, the shape parameter, the scale parameter, and a TRUE/FALSE flag for cumulative or density.

**Python.** SciPy provides `weibull_min`, where the shape argument is `c` and the scale is passed through the `scale` keyword [3]. The survival function gives the tail probability directly.

```python
from scipy.stats import weibull_min
k, lam, x = 2, 1000, 1200
p = weibull_min.sf(x, k, scale=lam)
print(f"{p:.4f}")  # 0.2369
```

Output:

```
0.2369
```

SciPy also exposes `pdf`, `cdf`, `ppf` and `isf` on the same object, so you can get densities, cumulative probabilities and percentiles from one place [3]. If you are working with count data instead of lifetimes, the [Poisson distribution calculator](/tools/poisson-distribution-calculator) covers that case.

## Common Mistakes

- **Treating the PDF value as a probability.** The density at a point is not the chance of that exact value. Use the CDF or survival function for probabilities. The [probability density function guide](/blog/data-analysis/probability-density-function-definition-formula) explains why.
- **Confusing the shape and scale parameters.** Swapping them changes the model completely. The shape parameter $k$ controls the failure pattern and the scale parameter $\lambda$ controls the spread. Check which one your software expects first.
- **Assuming $k = 1$ by default.** That forces the exponential distribution and removes the flexibility that makes the Weibull useful [1]. Estimate $k$ from data unless you have a reason to fix it.
- **Ignoring the mean check.** Compare the theoretical mean $\lambda \cdot \Gamma(1 + 1/k)$ against your sample mean. A large gap means the parameters do not fit, as in the worked example above.
- **Forgetting the domain.** The two-parameter Weibull is defined for $x \ge 0$ [1]. Negative values need a shifted three-parameter version, which adds a location parameter [2].
- **Fitting to censored data as if it were complete.** Units still running at the end of a test carry information. Dropping them biases the estimate. The NIST handbook shows a maximum likelihood approach that handles censoring properly [4].

## Limitations

The Weibull distribution assumes a single failure mode with a hazard that follows a power of time. Real systems often have several competing failure modes, and a single Weibull curve can hide that structure. If your data show a bend in a Weibull probability plot instead of a straight line, one Weibull is probably not enough [5].

The model also says nothing about causes. A good fit does not prove that wear-out is the mechanism, and a poor fit does not rule out a Weibull process in a subpopulation. Treat the parameters as a description of the data you have, not as a physical law. For a broader view of where this distribution sits among alternatives, see [probability distributions explained](/blog/data-analysis/probability-distributions-explained) and the [exponential distribution](/blog/data-analysis/exponential-distribution), which is the special case $k = 1$.

## Frequently Asked Questions

### What is the difference between the Weibull and exponential distribution?

The exponential distribution is the Weibull distribution with the shape parameter set to 1 [1][6]. That special case has a constant hazard rate, meaning the chance of failure does not change with age. The Weibull adds the shape parameter so the hazard can rise or fall over time, which covers wear-out and early-failure patterns.

### What does the scale parameter mean in plain language?

The scale parameter $\lambda$ is the value at which the CDF equals $1 - e^{-1}$, about 0.632. In reliability work it is called the characteristic life because roughly 63.2% of units are expected to fail by that time. Larger values stretch the distribution to the right.

### Can the Weibull distribution have three parameters?

Yes. The three-parameter version adds a location or shift parameter, usually written $\mu$, which moves the curve along the x-axis [2]. The general form uses $(x - \mu)/\alpha$ in place of $x/\lambda$ [2]. Use it when failures cannot occur before some threshold time.

### How do I estimate the parameters from data?

Maximum likelihood estimation is the standard approach. The NIST handbook walks through a censored-data example where the fitted scale parameter is 606.5280 and the shape parameter is reported alongside a log-likelihood of -75.135 and an AIC of 154.27 [4]. You can also fit by regression on a Weibull probability plot, where well-behaved data fall close to a straight line [5].

### Is the Weibull distribution the same as the Rayleigh distribution?

No, but they are related. The Rayleigh distribution is the Weibull distribution with shape parameter $k = 2$ and a specific scale relationship [1][5]. It arises as the model for the magnitude of a two-dimensional vector whose coordinates are independent normal variables with zero mean and equal standard deviation [5].

## References

1. [Weibull distribution - Wikipedia](https://en.wikipedia.org/wiki/Weibull_distribution)
2. [1.3.6.6.8. Weibull Distribution](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3668.htm)
3. [scipy.stats.weibull_min, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.weibull_min.html)
4. [8.4.1.3. A Weibull maximum likelihood estimation example](https://www.itl.nist.gov/div898/handbook/apr/section4/apr413.htm)
5. [8.1.6.2. Weibull](https://www.itl.nist.gov/div898/handbook/apr/section1/apr162.htm?utm_)
6. [Weibull Distribution - MATLAB & Simulink](https://www.mathworks.com/help/stats/weibull-distribution.html)

## Further Reading

- [scipy.stats.weibull_max, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.weibull_max.html)

## Related Articles

- [Probability Distributions: Definition, Types and Examples](/blog/data-analysis/probability-distributions-explained)
- [Bernoulli Distribution: Definition, Formula and Examples](/blog/data-analysis/bernoulli-distribution)
- [Student's t-Distribution: Definition, Formula and Examples](/blog/data-analysis/students-t-distribution-definition-formula)
- [Exponential Distribution: Definition, Formula and Examples](/blog/data-analysis/exponential-distribution)
- [Generalized Extreme Value Distribution: Definition and Examples](/blog/data-analysis/generalized-extreme-value-distribution)
- [Poisson Distribution: Formula and Examples](/blog/research-skills/poisson-distribution-formula-and-examples)
- [Introduction To Statistical Learning](/blog/guides/introduction-to-statistical-learning)
- [Fundamental Statistics: Core Concepts Explained](/blog/research-skills/fundamental-statistics-core-concepts-explained)