Why Weibull Moments Matter
A Weibull model can describe positive quantities such as a hypothetical device's operating lifetime or the time until a component fails. Its shape parameter controls how the hazard changes with time, while its scale parameter sets the time scale. Moments summarize the model in units that are useful for analysis: the mean is the expected value, and the variance describes spread around that mean.
The key calculation connects the Weibull density to the gamma function. Once the raw moments are known, the mean and variance follow directly. The shape-one case also gives a useful check on the parameterization: it is an exponential distribution, but the Weibull scale is then the reciprocal of the exponential rate.
Weibull Model and Gamma Function
Use the shape-scale parameterization \(X\sim\operatorname{Weibull}(k,\lambda)\), where \(k>0\) is the shape and \(\lambda>0\) is the scale. The variable \(X\) is nonnegative, and its density is
The density is zero for \(x<0\). The scale \(\lambda\) has the same units as \(X\); the shape \(k\) is dimensionless. This parameterization is important because other sources may use different symbols or a rate-based parameterization.
A raw moment of order \(r\) is \(E[X^r]\), calculated before centering the variable around its mean. For the mean and variance, the moments needed are \(E[X]\) and \(E[X^2]\). The variance is obtained from \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\).
Deriving the Weibull Raw Moments
The density contains the term \((x/\lambda)^k\). Substituting that term for a new integration variable turns the moment integral into the defining gamma integral.
For a real \(r\), write \(E[X^r]=\int_0^\infty x^r f_X(x)\,dx\). The integral is finite when \(r>-k\).
Set \(y=(x/\lambda)^k\), so \(x=\lambda y^{1/k}\) and \(dx=(\lambda/k)y^{1/k-1}\,dy\).
Substitute the density and the expressions for \(x\) and \(dx\). The powers of \(y\) combine to \(y^{r/k}\), and the scale factors combine to \(\lambda^r\).
The resulting integral is \(\int_0^\infty y^{r/k}e^{-y}\,dy=\Gamma(1+r/k)\), provided \(1+r/k>0\).
In equation form, the substitution gives the complete derivation:
The condition \(r>-k\) ensures the gamma integral is finite at zero; the exponential factor ensures convergence at infinity. For ordinary positive integer raw moments, \(r=1,2,3,\ldots\), the condition holds for every \(k>0\).
Worked Moments for General Shape
The formula often leaves gamma-function values in the answer. Use the recurrence and special values of \(\Gamma\) when they apply. Keep the scale factor attached to each moment: an order-\(r\) moment has units equal to the \(r\)th power of the units of \(X\).
Worked Example: Mean and Variance for Shape Two
A hypothetical sensor's lifetime \(X\), measured in years, follows a Weibull model with \(k=2\) and \(\lambda=3\) years. Find its mean and variance. Use \(\Gamma(1/2)=\sqrt{\pi}\) and round final numerical values to four decimal places.
Method. Apply the raw-moment formula for \(r=1\) and \(r=2\), simplify the gamma values, and then subtract the squared mean from the second raw moment.
For the mean, $$ E[X]=3\Gamma\left(1+\frac{1}{2}\right) =3\Gamma\left(\frac{3}{2}\right) =3\left(\frac{1}{2}\Gamma\left(\frac{1}{2}\right)\right) =\frac{3\sqrt{\pi}}{2} \approx 2.6587\text{ years}. $$
For the second raw moment, $$ E[X^2]=3^2\Gamma\left(1+\frac{2}{2}\right) =9\Gamma(2)=9(1)=9\text{ years}^2. $$
Therefore, $$ \operatorname{Var}(X)=9-\left(\frac{3\sqrt{\pi}}{2}\right)^2 =9-\frac{9\pi}{4} \approx 1.9314\text{ years}^2. $$
Check. The variance is positive because \(9\pi/4\approx 7.0686<9\). The scale is 3 years, while the mean is about 2.6587 years; the scale is not itself the mean. A common mistake is to report \(3\) as the mean merely because it is the scale parameter. The formula shows that the mean also depends on the shape.
Shape One Is Exponential
Set \(k=1\) in the Weibull density. The power term becomes one, leaving a constant hazard and the familiar exponential density. If the exponential distribution is written with rate \(\theta>0\), its density is \(\theta e^{-\theta x}\) for \(x\geq 0\). Comparing densities identifies \(\theta=1/\lambda\), not \(\lambda\).
The Weibull moment formula confirms the exponential moments. When \(k=1\), \(E[X^r]=\lambda^r\Gamma(1+r)\). For a nonnegative integer \(r\), this is \(r!\lambda^r\). In particular, the mean is \(\lambda\) and the variance is \(\lambda^2\). In rate notation these are \(1/\theta\) and \(1/\theta^2\).
Worked Example: Finding Exponential Moments From Weibull Parameters
A hypothetical backup unit has lifetime \(X\) in years with Weibull shape \(k=1\) and scale \(\lambda=5\) years. Identify its exponential rate, then find \(E[X]\), \(E[X^2]\), \(E[X^3]\), and \(\operatorname{Var}(X)\). Give the rate to four significant figures and the moments exactly.
Method. First set \(k=1\) in the density to identify the exponential rate. Then apply the Weibull raw-moment formula and use \(\Gamma(n)=(n-1)!\).
The density is $$ f_X(x)=\frac{1}{5}e^{-x/5} =0.2e^{-0.2x},\qquad x\geq 0. $$ Thus the exponential rate is \(\theta=1/5=0.2000\) per year.
The first three raw moments are $$ \begin{aligned} E[X]&=5\Gamma(2)=5(1!)=5\text{ years},\\ E[X^2]&=5^2\Gamma(3)=25(2!)=50\text{ years}^2,\\ E[X^3]&=5^3\Gamma(4)=125(3!)=750\text{ years}^3. \end{aligned} $$
The variance is $$ \operatorname{Var}(X)=E[X^2]-(E[X])^2=50-5^2=25\text{ years}^2. $$
Check. The exponential rate \(0.2\) is the reciprocal of the 5-year scale, and the variance \(25\) equals the scale squared. A common mistake is to use \(5\) as the exponential rate; that would incorrectly put a rate of 5 per year into the density instead of \(0.2\) per year.
Gamma Values Need Not Be Integers
For shapes other than one, the arguments of the gamma function may be nonintegers. The moments are still exact in gamma notation, and numerical gamma-function values can be used when a decimal answer is required. Do not replace a noninteger gamma value with a factorial: the identity \(\Gamma(n)=(n-1)!\) applies when \(n\) is a positive integer.
Worked Example: Noninteger Gamma Values for Shape Three
A hypothetical component lifetime \(X\), measured in months, follows a Weibull model with \(k=3\) and \(\lambda=2\) months. Find its mean and variance. Use \(\Gamma(4/3)\approx0.8929795\) and \(\Gamma(5/3)\approx0.9027453\), and round final numerical values to four decimal places.
Method. Calculate the first two raw moments using the gamma formula, then apply the variance identity. Keep the squared scale factor in the second moment.
The mean is $$ E[X]=2\Gamma\left(1+\frac{1}{3}\right) =2\Gamma\left(\frac{4}{3}\right) \approx 2(0.8929795)=1.7859590\text{ months}. $$
The second raw moment is $$ E[X^2]=2^2\Gamma\left(1+\frac{2}{3}\right) =4\Gamma\left(\frac{5}{3}\right) \approx4(0.9027453)=3.6109812\text{ months}^2. $$
Squaring the unrounded mean gives \((1.7859590)^2\approx3.1896496\). Hence $$ \operatorname{Var}(X)\approx3.6109812-3.1896496 =0.4213316\text{ months}^2 \approx0.4213\text{ months}^2. $$ The mean is \(1.7860\) months to four decimal places.
Check. The variance is positive, as required. The scale is 2 months, but the shape-three mean is smaller than that scale. A common error is to square the scale for \(E[X^2]\) but omit its gamma factor; here \(E[X^2]=4\Gamma(5/3)\), not simply \(4\).
Common Traps and Practical Checks
Moment calculations are short once the model is parameterized correctly, but a small notation error can change every answer. Before substituting values, confirm that the stated scale and shape match the density used above.
- Confusing scale and rate. The Weibull scale is \(\lambda\). In the exponential special case, the rate is \(1/\lambda\). They have reciprocal units.
- Using the wrong gamma argument. For order \(r\), the argument is \(1+r/k\). For example, \(E[X^2]\) uses \(1+2/k\), not \(1+1/k\).
- Forgetting powers of scale. The order-\(r\) moment includes \(\lambda^r\); the second raw moment includes \(\lambda^2\).
- Confusing raw and central moments. \(E[X^2]\) is not the variance. The correct calculation is \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\).
- Applying the factorial rule too broadly. Use \(\Gamma(n)=(n-1)!\) for positive integers \(n\); retain gamma notation or use a gamma value for noninteger arguments.
Check Your Understanding
For each problem, state the relevant Weibull moments before calculating. Round decimal answers to four decimal places unless an exact answer is requested.
- A hypothetical relay lifetime has Weibull shape \(k=2\) and scale \(\lambda=4\) years. Find its mean and variance. (Answer: mean \(2\sqrt{\pi}\approx3.5449\) years; variance \(16-4\pi\approx3.4336\) years\(^2\).)
- A hypothetical sensor lifetime has Weibull shape \(k=1\) and scale \(\lambda=2.5\) hours. Give the equivalent exponential rate and find \(E[X^3]\) and \(\operatorname{Var}(X)\). (Answer: rate \(0.4\) per hour; \(E[X^3]=93.75\) hours\(^3\); variance \(6.25\) hours\(^2\).)
- A hypothetical pump lifetime has Weibull shape \(k=4\) and scale \(\lambda=3\) years. Find its mean and variance using \(\Gamma(5/4)\approx0.9064025\) and \(\Gamma(3/2)\approx0.8862269\). (Answer: mean \(3\Gamma(5/4)\approx2.7192\) years; variance \(9\Gamma(3/2)-[3\Gamma(5/4)]^2\approx0.5820\) years\(^2\).)
- A hypothetical battery lifetime \(X\) has Weibull shape \(k=3\) and scale \(\lambda=1\) year. Express its fourth raw moment exactly and give its approximate value using \(\Gamma(7/3)\approx1.190639\). (Answer: \(E[X^4]=\Gamma(7/3)\approx1.1906\) years\(^4\).)
- A hypothetical valve lifetime has Weibull shape \(k=2\) and scale \(\lambda=6\) months. Find its second raw moment and variance exactly. (Answer: \(E[X^2]=36\) months\(^2\); variance \(36-9\pi\approx7.7257\) months\(^2\).)