# 5-8. Weibull Distribution (\*)

## 1. What is the Weibull Distribution?

The Weibull distribution is a [continuous probability distribution](https://www.statisticshowto.datasciencecentral.com/continuous-probability-distribution/) named after Swedish mathematician _Waloddi Weibull_. He originally proposed the distribution as a model for material breaking strength, but recognized the potential of the distribution in his 1951 paper _A Statistical Distribution Function of Wide Applicability_.&#x20;

Today, **it’s commonly used to** [**assess product reliability**](http://www.itl.nist.gov/div898/handbook/apr/apr.htm)**,** [**analyze life data**](http://wildeanalysis.co.uk/reliability/applications/life-data-analysis) **and model failure times.** The Weibull can also fit a wide range of data from many other fields, including: biology, economics, engineering sciences, and hydrology (Rinne, 2008).

Although it’s extremely useful in most cases, the Weibull isn’t an appropriate model for every situation. For example, chemical reactions and corrosion failures are usually modeled with the [lognormal distribution](https://www.statisticshowto.datasciencecentral.com/lognormal-distribution/).

## 2. Weibull Distribution PDFs

Two versions of the Weibull [probability density function (pdf)](https://www.statisticshowto.datasciencecentral.com/probability-density-function/) are in common use: the _two parameter pdf_ and the _three parameter pdf_.&#x20;

**Different authors use different notation, which makes the notation a little confusing if you’re looking at different texts.** For example, The Engineering Statistics Handbook uses gamma(γ) to represent the [shape parameter](https://www.statisticshowto.datasciencecentral.com/shape-parameter/), while other authors (e.g. Fritz Scholz, writing for Boeing) use beta (β).&#x20;

For clarity, I’m staying with the same notation for all formulas: $$\alpha$$ for the shape parameter, $$x$$ as the variable,  $$\theta$$ as scale parameter and $$μ$$ for the location parameter.

### 2.1 Three parameter Weibull

> &#x20;The formula for the [probability density function](https://www.statisticshowto.datasciencecentral.com/probability-density-function/) of the **three parameter general Weibull distribution** is:
>
> $$f(x) = \left ( \frac{\alpha}{\theta}  \right  ) \left ( \frac{x - \mu}{\theta}  \right  ) ^{\alpha -1}exp\left [ - \left ( \frac{x-\mu}{\theta} \right )^\alpha \right ],$$     $$x \ge \mu;$$   $$\alpha>0,$$  $$\theta>0.$$&#x20;
>
> Where,&#x20;
>
> * $$\alpha$$ is the [**shape parameter**](https://www.statisticshowto.datasciencecentral.com/shape-parameter/) (also known as the _Weibull slope_ or _the threshold parameter_). _Note_: some authors use β, _m_, or _k_.
> * $$\theta$$ is the [**scale parameter**](https://www.statisticshowto.datasciencecentral.com/scale-parameter/), also called the _characteristic life parameter_. _Note_: some authors use c, ν or η instead. I found a single text (Glantz & Kissell, 2013) using γ.
> * $$μ$$ is the [**location parameter**](https://www.statisticshowto.datasciencecentral.com/location-parameter/), also called the _waiting time parameter_ or sometimes the _shift parameter_. _Note_: μ the time to failure, is not included in the two parameter version.
>
> When $$μ = 0$$ and $$\theta = 1$$ , the formula for the pdf reduces to:
>
> $$f(x) =  \alpha  x^{\alpha -1}exp^{-x^\alpha},$$  $$x > 0;$$  $$\alpha > 0.$$&#x20;
>
> &#x20;which is the **standard Weibull distribution**.



### 2.2 Two parameter Weibull



> The formula is practically identical to the three parameter Weibull, except that $$μ$$ isn’t included:
>
> $$f(x) = \left ( \frac{\alpha}{\theta}  \right  ) \left ( \frac{x}{\theta}  \right  ) ^{\alpha -1}exp\left [ - \left ( \frac{x}{\theta} \right )^\alpha \right ],$$   $$x \ge 0,$$  $$\alpha>0,$$  $$\theta>0.$$&#x20;



The two parameter Weibull is often used in **failure analysis**, because no failure can happen before time zero. If you know $$μ$$ , the time where the failure happens, you can subtract it from $$x$$ (i.e. time $$t$$ ). Therefore, when you move from the two-parameter to the three-parameter version, all you have to do is replace each instance of $$x$$ with $$(x – μ)$$ .



### 2.3 Expected Value and Variance

> $$E(X) = \theta\Gamma(1+\frac{1}{\alpha}),$$   $$Var(X) =  \theta^2  [  \Gamma(1+\frac{2} {\alpha}) - \{ \Gamma(1+\frac{1} {\alpha}) \}^2  ]$$&#x20;



### 2.4  **Cumulative distribution function**

> $$F(x) = 1 - e^{-(x/\theta)^\alpha}$$



### 2.5 Reliability Function and Failure Rate Function

#### 1) Reliability Function

확률변수 $$X$$가 수명(lifetime)인 경우로 한정하면, $$P(X>x)$$ 는 수명이 $$x$$보다 클 확률이므로 이를 **신뢰함수(Reliability Function)**  $$R(x)$$ 라 한다.

> $$P(X>x) =R(x) = 1-F(x) = e^{-(x/\theta)^\alpha}.$$&#x20;



#### &#x20;2) Failure Rate Function

또한, **고장률함수(failure rate function)**&#xB294; $$\lambda (x) \equiv f(x)/R(x)$$ 로 정의되는데, 와이블분포의 고장률함수는 다음과 같이 멱함수(power function) 형태이므로 사용하기 편리하다.

> $$\lambda (x) \equiv \frac{f(x)}{R(x)} = \left ( \frac{\alpha}{\theta}  \right  ) \left ( \frac{x}{\theta}  \right  ) ^{\alpha -1},$$      $$x >0;$$    $$\alpha >0,$$    $$\theta>0.$$&#x20;



#### 3) Alpha and Failure Rates

**The value for the shape parameter (** $$\alpha$$ **) determines the&#x20;**_**failure rates**_**:**

* If $$\alpha$$ is less than 1, then the **failure rate decreases with time** (i.e. the process has a large number of infantile or early-life failures and fewer failures as time passes).
* For $$\alpha = 1$$ : the **failure rate is constant**, which means it’s indicative of useful life or random failures.
* If $$\alpha > 1$$ : the **failure rate increases with time** (i.e. the distribution models wear-out failures, which tend to happen after some time has passed).



**EXAMPLE 36.** $$\theta=1$$일 때,  $$\alpha = 0.5, 1,2,3$$ 인 와이블 분포의 확률밀도함수와 누적분포함수 그래프를 작성하시오.

**\[ Solution ]**

{% tabs %}
{% tab title="R Source" %}
```
library(Rstat)

# set the parameter, run the function
th <- 1; alp <- c(0.5, 1:3)
cont.mpdf("weibull", 0, 5, para=alp, para2=th, ymax=1.2)
```
{% endtab %}

{% tab title="Plot" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LtD4z7wEBenePErHl8O%2F-LtD69LQ1Vv3oIzKBaQY%2Fimage.png?alt=media\&token=6687b2b9-65e7-4f3d-9c75-cf23850a801c)
{% endtab %}
{% endtabs %}



**EXAMPLE 37.**  어떤 전동 안마기의 수명이 $$\alpha = 2,$$ $$\theta=5$$인 와이블분포를 따를 때, 아래의 확률을 구하시오.

1. 이 전동안마기가 3년간 고장 없이 작동할 확률
2. 5년간 고장이 없었을 때, 앞으로 3년 더 고장없이 작동할 확률

**\[ Solution ]**

1. $$P(X>3) = e^{-(3/5)^2} = e^{-0.36} \approx 0.6977.$$&#x20;
2.  $$P(X>5+3 | X>5) = \frac{P(X>8)}{P(X>5)}.$$ \
    &#x20;      $$P(X>8) = = e^{-(8/5)^2} = e^{-2.56} \approx 0.0773$$&#x20;

    &#x20;      $$P(X>5) = = e^{-(5/5)^2} = e^{-1} \approx 0.3679.$$\
    &#x20;$$\therefore$$ $$P(X>5+3 | X>5) = \frac{P(X>8)}{P(X>5)} = \frac{0.0773}{0.3679} \approx 0.2101$$

{% tabs %}
{% tab title="R Source" %}
```
library(Rstat)

alp <- 2; th <- 5

# 1. P(X>3)
pweibull(3, alp, th, lower=FALSE)

# 2. P(X>5+3 | X>5) 
pweibull(8, alp, th, lower=FALSE) / pweibull(5, alp, th, lower=FALSE)
```
{% endtab %}

{% tab title="1. P(X>3)" %}
```
> # 1. P(X>3)
> pweibull(3, alp, th, lower=FALSE)
## [1] 0.6976763
```
{% endtab %}

{% tab title="2. P(X>5+3 | X>5)" %}
```
> # 2. P(X>5+3 | X>5) 
> pweibull(8, alp, th, lower=FALSE) / pweibull(5, alp, th, lower=FALSE)
## [1] 0.2101361
```
{% endtab %}
{% endtabs %}



## 3. The Weibull Family

### 3.1 Changing the Shape Parameter

The Weibull distribution is a family of distributions that can take on many shapes, depending on what parameters you choose.

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LtD4z7wEBenePErHl8O%2F-LtD7_VfEDWSWTjbXuA9%2Fimage.png?alt=media\&token=0568ada5-01ea-40ef-99b3-09f1093a3667)

\
\
\
The Weibull distributions above include two [exponential distributions](https://www.statisticshowto.datasciencecentral.com/exponential-distribution/) (when $$\alpha = 0.5 , \alpha=1$$ ), a [right-skewed distribution](https://www.statisticshowto.datasciencecentral.com/probability-and-statistics/skewed-distribution/#SkewRight) (when $$\alpha=2$$ ) and a [symmetric distribution](https://www.statisticshowto.datasciencecentral.com/symmetric-distribution-2/) (when $$\alpha = 3$$ ).&#x20;

The exponential distribution is a special case of the Weibull distribution, which happens when the Weibull shape parameter equals 1.



### 3.2 Changing the Scale Parameter

Changing the Weibull parameters also changes the shape of the distribution.

Changing $$\theta$$, the [scale parameter](https://www.statisticshowto.datasciencecentral.com/scale-parameter/), does not change the type of shape, but it does stretch out the existing shape. If the other two parameters are kept the same:

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LtD4z7wEBenePErHl8O%2F-LtDDdMKLnipzB5OM6Ka%2Fimage.png?alt=media\&token=51b58c02-61a9-4b9f-8d72-abf3a18ef875)



* Increasing $$\theta$$ results in the graph being stretched to the right. The height will decrease.
* Decreasing $$\theta$$ results in the graph being shrunk to the left (towards zero). The height will increase.

## 4. Weibull Analysis

Weibull analysis involves using the Weibull distribution (and sometimes, the [lognormal](https://www.statisticshowto.datasciencecentral.com/lognormal-distribution/)) to study _life data analysis_ — **the analysis of time to failure**.&#x20;

For example, Weibull analysis can be used to study:

* Lifetimes of medical and dental implants,
* Components produced in a factory (like bearings, capacitors, or dialetrics),
* Warranty analysis,
* Utility services,
* Other areas where time-to-failure is important.

The analysis isn’t limited to production; it is applicable to the design stage and in-service time as well.

In the past, the techniques to perform Weibull analysis by hand were tedious and lengthy. The process has now been replaced by statistical software programs and is today the most widely used technique for analyzing lifetimes data in the world.

The major advantages to using Weibull analysis is that it can be used for analyzing lifetimes with very small samples. It also produces an easy-to-understand plot.

The horizontal axis on a Weibull plot shows lifetimes or aging parameters like mileage, operating times, or cycles of use. The vertical axis shows cumulative (additive total) percentage failures.

![weibull analysis](https://www.statisticshowto.datasciencecentral.com/wp-content/uploads/2014/03/weibull-plot.png)

The analysis includes:

* Forecasting when spare parts will be needed.
* Implementing a plan for corrective action.
* Planning maintenance and cost effective replacement strategies.
* Plotting and interpreting data.
* Predicting failures.
