# Bayesian-Weibull Analysis

## Contents

The Bayesian methods presented next are for the 2-parameter Weibull distribution. Bayesian concepts were introduced in Parameter Estimation. This model considers prior knowledge on the shape ($\beta\,\!$) parameter of the Weibull distribution when it is chosen to be fitted to a given set of data. There are many practical applications for this model, particularly when dealing with small sample sizes and some prior knowledge for the shape parameter is available. For example, when a test is performed, there is often a good understanding about the behavior of the failure mode under investigation, primarily through historical data. At the same time, most reliability tests are performed on a limited number of samples. Under these conditions, it would be very useful to use this prior knowledge with the goal of making more accurate predictions. A common approach for such scenarios is to use the 1-parameter Weibull distribution, but this approach is too deterministic, too absolute you may say (and you would be right). The Bayesian-Weibull model in Weibull++ (which is actually a true "WeiBayes" model, unlike the 1-parameter Weibull that is commonly referred to as such) offers an alternative to the 1-parameter Weibull, by including the variation and uncertainty that might have been observed in the past on the shape parameter. Applying Bayes's rule on the 2-parameter Weibull distribution and assuming the prior distributions of $\beta\,\!$ and $\eta\,\!$ are independent, we obtain the following posterior pdf:

$f(\beta ,\eta |Data)=\dfrac{L(\beta ,\eta )\varphi (\beta )\varphi (\eta )}{ \int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta } \,\!$

In this model, $\eta\,\!$ is assumed to follow a noninformative prior distribution with the density function $\varphi (\eta )=\dfrac{1}{\eta } \,\!$. This is called Jeffrey's prior, and is obtained by performing a logarithmic transformation on $\eta\,\!$. Specifically, since $\eta\,\!$ is always positive, we can assume that ln($\eta\,\!$) follows a uniform distribution, $U( - ∞, + ∞).\,\!$ Applying Jeffrey's rule as given in Gelman et al. [9] which says "in general, an approximate non-informative prior is taken proportional to the square root of Fisher's information," yields $\varphi (\eta )=\dfrac{1}{\eta }\,\!$.

The prior distribution of $\beta\,\!$, denoted as $\varphi (\beta )\,\!$, can be selected from the following distributions: normal, lognormal, exponential and uniform. The procedure of performing a Bayesian-Weibull analysis is as follows:

• Collect the times-to-failure data.
• Specify a prior distribution for $\beta\,\!$ (the prior for $\eta\,\!$ is assumed to be $1/\beta\,\!$).
• Obtain the posterior pdf from the above equation.

In other words, a distribution (the posterior pdf) is obtained, rather than a point estimate as in classical statistics (i.e., as in the parameter estimation methods described previously in this chapter). Therefore, if a point estimate needs to be reported, a point of the posterior pdf needs to be calculated. Typical points of the posterior distribution used are the mean (expected value) or median. In Weibull++, both options are available and can be chosen from the Analysis page, under the Results As area, as shown next.

The expected value of $\beta\,\!$ is obtained by:

$E(\beta )=\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }\beta \cdot f(\beta ,\eta |Data)d\beta d\eta \,\!$

Similarly, the expected value of $\eta\,\!$ is obtained by:

$E(\eta )=\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }\eta \cdot f(\beta ,\eta |Data)d\beta d\eta \,\!$

The median points are obtained by solving the following equations for $\breve{\beta} \,\!$ and $\breve{\eta} \,\!$ respectively:

$\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\breve{\beta}}f(\beta ,\eta |Data)d\beta d\eta =0.5 \,\!$

and:

$\int\nolimits_{0}^{\breve{\eta}}\int\nolimits_{0}^{\infty }f(\beta ,\eta |Data)d\beta d\eta =0.5 \,\!$

Of course, other points of the posterior distribution can be calculated as well. For example, one may want to calculate the 10th percentile of the joint posterior distribution (w.r.t. one of the parameters). The procedure for obtaining other points of the posterior distribution is similar to the one for obtaining the median values, where instead of 0.5 the percentage of interest is given. This procedure actually provides the confidence bounds on the parameters, which in the Bayesian framework are called ‘‘Credible Bounds.‘‘ However, since the engineering interpretation is the same, and to avoid confusion, we refer to them as confidence bounds in this reference and in Weibull++.

### Posterior Distributions for Functions of Parameters

As explained in Parameter Estimation, in Bayesian analysis, all the functions of the parameters are distributed. In other words, a posterior distribution is obtained for functions such as reliability and failure rate, instead of point estimate as in classical statistics. Therefore, in order to obtain a point estimate for these functions, a point on the posterior distributions needs to be calculated. Again, the expected value (mean) or median value are used. It is important to note that the Median value is preferable and is the default in Weibull++. This is because the Median value always corresponds to the 50th percentile of the distribution. On the other hand, the Mean is not a fixed point on the distribution, which could cause issues, especially when comparing results across different data sets.

pdf of the Times-to-Failure

The posterior distribution of the failure time $t\,\!$ is given by:

$f(T|Data)=\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }f(T,\beta ,\eta )f(\beta ,\eta |Data)d\eta d\beta \,\!$

where:

$f(T,\beta ,\eta )=\dfrac{\beta }{\eta }\left( \dfrac{T}{\eta }\right) ^{\beta -1}e^{-\left( \dfrac{T}{\eta }\right) ^{\beta }} \,\!$

For the pdf of the times-to-failure, only the expected value is calculated and reported in Weibull++.

Reliability

In order to calculate the median value of the reliability function, we first need to obtain posterior pdf of the reliability. Since $R(T)\,\!$ is a function of $\beta\,\!$, the density functions of $\beta\,\!$ and $R(T)\,\!$ have the following relationship:

\begin{align} f(R|Data,T)dR = & f(\beta |Data)d\beta)\\ = & (\int\nolimits_{0}^{\infty }f(\beta ,\eta |Data)d{\eta}) d{\beta} \\ =& \dfrac{\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }d\beta \end{align}\,\!

The median value of the reliability is obtained by solving the following equation w.r.t. $\breve{R}: \,\!$

$\int\nolimits_{0}^{\breve{R}}f(R|Data,T)dR=0.5 \,\!$

The expected value of the reliability at time $t\,\!$ is given by:

$R(T|Data)=\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }R(T,\beta ,\eta )f(\beta ,\eta |Data)d\eta d\beta \,\!$

where:

$R(T,\beta ,\eta )=e^{-\left( \dfrac{T}{\eta }\right) ^{^{\beta }}} \,\!$

Failure Rate

The failure rate at time is given by:

$\lambda (T|Data)=\dfrac{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }\lambda (T,\beta ,\eta )L(\beta ,\eta )\varphi (\eta )\varphi (\beta )d\eta d\beta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\eta )\varphi (\beta )d\eta d\beta } \,\!$

where:

$\lambda (T,\beta ,\eta )=\dfrac{\beta }{\eta }\left( \dfrac{T}{\eta }\right) ^{\beta -1} \,\!$

### Bounds on Reliability for Bayesian-Weibull

The confidence bounds calculation under the Bayesian-Weibull analysis is very similar to the Bayesian Confidence Bounds method described in the previous section, with the exception that in the case of the Bayesian-Weibull Analysis the specified prior of $\beta\,\!$ is considered instead of an non-informative prior. The Bayesian one-sided upper bound estimate for $R(T)\,\!$ is given by:

$\int\nolimits_{0}^{R_{U}(T)}f(R|Data,t)dR=CL \,\!$

Using the posterior distribution, the following is obtained:

$\dfrac{\int\nolimits_{0}^{\infty }\int\nolimits_{t\exp (-\dfrac{\ln (-\ln R_{U})}{\beta })}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }=CL \,\!$

The above equation can be solved for ${{R}_{U}}(t)\,\!$. The Bayesian one-sided lower bound estimate for $\ R(t) \,\!$ is given by:

$\int\nolimits_{0}^{R_{L}(t)}f(R|Data,t)dR=1-CL \,\!$

Using the posterior distribution, the following is obtained:

$\dfrac{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{T\exp (-\dfrac{\ln (-\ln R_{L})}{\beta })}L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }=1-CL \,\!$

The above equation can be solved for ${{R}_{L}}(t)\,\!$. The Bayesian two-sided bounds estimate for $R(t)\,\!$ is given by:

$\int\nolimits_{R_{L}(t)}^{R_{U}(t)}f(R|Data,t)dR=CL \,\!$ which is equivalent to:
$\int\nolimits_{0}^{R_{U}(t)}f(R|Data,t)dR=(1+CL)/2 \,\!$

and:

$\int\nolimits_{0}^{R_{L}(t)}f(R|Data,T)dR=(1-CL)/2 \,\!$

Using the same method for one-sided bounds, ${{R}_{U}}(t)\,\!$ and ${{R}_{L}}(t)\,\!$ can be computed.

### Bounds on Time for Bayesian-Weibull

Following the same procedure described for bounds on Reliability, the bounds of time $t\,\!$ can be calculated, given $R\,\!$. The Bayesian one-sided upper bound estimate for $t(R)\,\!$ is given by:

$\int\nolimits_{0}^{T_{U}(R)}f(T|Data,R)dT=CL \,\!$

Using the posterior distribution, the following is obtained:

$\dfrac{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{T_{U}\exp (-\dfrac{\ln (-\ln R)}{\beta })}L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }=CL \,\!$

The above equation can be solved for ${{T}_{U}}(R)\,\!$. The Bayesian one-sided lower bound estimate for $T(R)\,\!$ is given by:

$\int\nolimits_{0}^{T_{L}(R)}f(T|Data,R)dT=1-CL \,\!$

or:

$\dfrac{\int\nolimits_{0}^{\infty }\int\nolimits_{T_{L}\exp (\dfrac{-\ln (-\ln R)}{\beta })}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }{\int\nolimits_{0}^{\infty }\int\nolimits_{0}^{\infty }L(\beta ,\eta )\varphi (\beta )\varphi (\eta )d\eta d\beta }=CL \,\!$

The above equation can be solved for ${{T}_{L}}(R)\,\!$. The Bayesian two-sided lower bounds estimate for $T(R)\,\!$ is:

$\int\nolimits_{T_{L}(R)}^{T_{U}(R)}f(T|Data,R)dT=CL \,\!$

which is equivalent to:

$\int\nolimits_{0}^{T_{U}(R)}f(T|Data,R)dT=(1+CL)/2 \,\!$

and:

$\int\nolimits_{0}^{T_{L}(R)}f(T|Data,R)dT=(1-CL)/2 \,\!$

### Bayesian-Weibull Example

A manufacturer has tested prototypes of a modified product. The test was terminated at 2,000 hours, with only 2 failures observed from a sample size of 18. The following table shows the data.

Number of State State of F or S State End Time
1 F 1180
1 F 1842
16 S 2000

Because of the lack of failure data in the prototype testing, the manufacturer decided to use information gathered from prior tests on this product to increase the confidence in the results of the prototype testing. This decision was made because failure analysis indicated that the failure mode of the two failures is the same as the one that was observed in previous tests. In other words, it is expected that the shape of the distribution (beta) hasn't changed, but hopefully the scale (eta) has, indicating longer life. The 2-parameter Weibull distribution was used to model all prior tests results. The estimated beta ($\beta\,\!$) parameters of the prior test results are as follows:

Betas Obtained for Similar Mode
1.7
2.1
2.4
3.1
3.5

Solution

First, in order to fit the data to a Bayesian-Weibull model, a prior distribution for beta needs to be determined. Based on the beta values in the prior tests, the prior distribution for beta is found to be a lognormal distribution with $\mu = 0.9064\,\!$, $\sigma = 0.3325\,\!$. (The values of the parameters can be obtained by entering the beta values into a Weibull++ standard folio and analyzing it using the lognormal distribution and the RRX analysis method.)

Next, enter the data from the prototype testing into a standard folio. On the control panel, choose the Bayesian-Weibull > B-W Lognormal Prior distribution. Click Calculate and enter the parameters of the lognormal distribution, as shown next.

Click OK. The result is Beta (Median) = 2.361219 and Eta (Median) = 5321.631912 (by default Weibull++ returns the median values of the posterior distribution). Suppose that the reliability at 3,000 hours is the metric of interest in this example. Using the QCP, the reliability is calculated to be 76.97% at 3,000 hours. The following picture depicts the posterior pdf plot of the reliability at 3,000, with the corresponding median value as well as the 10th percentile value. The 10th percentile constitutes the 90% lower 1-sided bound on the reliability at 3,000 hours, which is calculated to be 50.77%.

The pdf of the times-to-failure data can be plotted in Weibull++, as shown next: