Formulae for the mean and variance of the Weibull distribution are given below.

Mean and variance of Weibull distribution

If a random variable \(X\) has a Weibull distribution with probability density function

\[ f(x) \;\;=\;\; \begin{cases} \alpha \lambda^{\alpha} x^{\alpha - 1} e^{-(\lambda x)^{\alpha}} & x \gt 0 \\[0.4em] 0 & \text{otherwise} \end{cases} \]

then its mean and variance are

\[ E[X] \;=\; \frac 1 {\lambda} \Gamma\left(1 + \frac 1 {\alpha}\right) \spaced{and} \Var(X) \;=\; \frac 1 {\lambda^2} \left( \Gamma\left(1 + \frac 2 {\alpha}\right) - \Gamma\left(1 + \frac 1 {\alpha}\right)^2\right) \]

We first find a formula for the expected value of \(X^k\) for an arbitrary constant \(k\).

\[ E[X^k] \;=\; \int_0^{\infty} x^k f(x) \; dx \;=\; \int_0^{\infty} {\alpha \lambda^{\alpha} x^{\alpha + k - 1} e^{-(\lambda x)^{\alpha}}} \; dx \]

Again using a change of variable to evaluate this integral,

\[ u = (\lambda x)^{\alpha} \quad\quad \text{and} \quad\quad du = \alpha \lambda(\lambda x)^{\alpha - 1} \;dx\]

we get

\[ E[X^k] \;=\; \frac 1 {\lambda^k} \int_0^{\infty} u^{\frac k {\alpha}} e^{-u} \; du \;=\; \frac 1 {\lambda^k}\Gamma\left(1 + \frac k{\alpha}\right) \]

Setting \(k = 1\) gives the mean. The variance can be found from

\[ \Var(X) \;=\; E[X^2] - \left(E[X]\right)^2 \]

We now show how the shape of the Weibull distribution is affected by its two parameters.

Shape of the Weibull distribution

The diagram below initially shows a Weibull distribution with \(\alpha = 1\). This has a constant hazard rate and is therefore an exponential distribution. Use the slider on the right to change the mean of the distribution, and hence the parameter \(\lambda\).

Use the slider on the left to reduce the shape parameter of the distribution, \(\alpha\), to 0.5. The hazard function is now

\[ h(x) \;\;\propto\;\; x^{\alpha - 1} \;\;=\;\; \frac 1{\sqrt{x}}\]

When \(x\) is near zero, the hazard rate is extremely high, making the item very likely to fail near the start of its life. However the hazard rate drops as the item gets older (as \(x\) increases) so as the item survives longer, it becomes less likely to fail — some items survive very long times, well beyond the upper end of the axis in the diagram.

Now increase \(\alpha\) to 2.0. (You can use the arrow keys on your keyboard to fine-tune its value.) The hazard rate is now proportional to \(x\) and is therefore zero for a new item and increases as the item ages. The pdf of the lifetime is therefore zero at time \(x = 0\), increases to a peak, then drops to zero fairly sharply.