**3.3 Checking for prior data conflict for Weibull distribution**

Suppose we have a sample that follows a Weibull distribution according to the Eq. (1) and the prior distribution suitable for the scale parameter (θ) is Inverse Gamma because it is a conjugate prior and as in the Eq. (5) [9].

Then we need to update the parameters of the prior distribution so that it is n<sup>0</sup> >1, y0 >0 instead of the parameters (a, b), through two methods we get the prior distribution as shown in the following steps [10]:

**The first method**: It is the Expected Conditional method, as shown in the following steps:

$$\mathbf{E}(\theta/\mathbf{a}, \mathbf{b}) = \mathbf{y}^0 = \frac{\mathbf{b}}{\mathbf{a} - \mathbf{1}} = \frac{\mathbf{b}}{\mathbf{n}^0} \Rightarrow \mathbf{b} = \mathbf{n}^0 \mathbf{y}^0, \mathbf{n}^0 = \mathbf{a} - \mathbf{1} \Rightarrow \mathbf{a} = \mathbf{n}^0 + \mathbf{1}$$

Then the prior distribution with the updated parameters can be written in the following form:

$$\mathbf{f}\left(\mathbf{\theta}/\mathbf{n}^{0}\mathbf{y}^{0}\right)\approx\frac{\left(\mathbf{n}^{0}\mathbf{y}^{0}\right)^{\mathbf{n}^{0}+1}}{\mathbf{r}(\mathbf{n}^{0}+\mathbf{1})}\boldsymbol{\theta}^{-\left(\mathbf{n}^{0}+\mathbf{1}\right)-1}\mathbf{e}^{-\frac{\mathbf{n}^{0}\mathbf{y}^{0}}{\mathbf{0}}}\tag{9}$$

Since:

y0: Pre-guessing the scale parameter.

n0: Pre- guessing the sample size.

**The second method:** In this method, the prior distribution can be determined with parameters n0, y0 � � through the following steps:

**The first step**: writing the model in the form of canonical exponential family and as shown below [10]:

$$\mathbf{f}(\mathbf{x}/\theta) = \mathbf{a}(\mathbf{x}) \exp\left(\boldsymbol{\psi}.\tau(\mathbf{x}) - \mathbf{n} \mathbf{b}(\boldsymbol{\psi})\right) \tag{10}$$

$$\mathbf{f}(\mathbf{t}/\theta, \emptyset) = \mathfrak{P}^{\mathbf{n}} \prod\_{i=1}^{\mathbf{n}} \mathbf{t}\_{\mathbf{i}}^{\theta - 1} \mathbf{e}^{-\sum\_{i=1}^{\mathbf{n}} \mathbf{t}\_{i}^{\theta - 1} - \text{nln}(\theta)}\tag{11}$$

$$\mathbf{f}(\mathbf{t}) = \mathfrak{P}^{\mathbf{n}} \prod\_{i=1}^{\mathbf{n}} \mathbf{t}\_{\mathbf{i}}^{\theta - 1}, \Psi = -\frac{\mathbf{1}}{\theta}, \mathbf{\tau}(\mathbf{t}) = \sum\_{i=1}^{\mathbf{n}} \mathbf{t}\_{\mathbf{i}}^{\theta}, \mathbf{b}(\Psi) = \ln|\Theta|$$

$$\mathbf{f}\left(\mathbf{y}/\mathbf{n}^{0},\mathbf{y}^{0}\right)\mathbf{d}\boldsymbol{\upmu}\propto\exp\left\{\mathbf{n}^{0}\left[\mathbf{y}^{0},\mathbf{y}-\mathbf{b}(\boldsymbol{\upmu})\right]\right\}\mathbf{d}\boldsymbol{\upmu}\tag{12}$$

$$\mathbf{f}\left(\mathbf{w}/\mathbf{n}^{0},\mathbf{y}^{0}\right)\mathbf{d}\boldsymbol{\upmu}\propto\exp\left\{\mathbf{n}^{0}\left[\mathbf{y}^{0}\left(-\frac{1}{\boldsymbol{\Theta}}\right)-\ln\left(\boldsymbol{\uptheta}\right)\right]\right\}\mathbf{d}\boldsymbol{\upmu}$$

$$\left|\frac{\mathbf{d}\boldsymbol{\upmu}}{\mathbf{d}\boldsymbol{\uptheta}}\right|=\frac{1}{\boldsymbol{\Theta}^{2}}$$

$$\mathbf{f}\left(\boldsymbol{\uptheta}/\mathbf{n}^{0},\mathbf{y}^{0}\right)\mathbf{d}\boldsymbol{\uptheta}=\mathbf{f}\left(\mathbf{y}/\mathbf{n}^{0},\mathbf{y}^{0}\right)\left|\frac{\mathbf{d}\boldsymbol{\uptheta}}{\mathbf{d}\boldsymbol{\uptheta}}\right|\mathbf{d}\boldsymbol{\uptheta}\times\exp\left\{-\frac{\mathbf{n}^{0}\mathbf{y}^{0}}{\boldsymbol{\uptheta}}-\mathbf{n}^{0}\ln\boldsymbol{\uptheta}\right\}\frac{1}{\boldsymbol{\Theta}^{2}}$$

$$\mathbf{f}\left(\boldsymbol{\uptheta}/\mathbf{n}^{0},\mathbf{y}^{0}\right)\propto\boldsymbol{\uptheta}^{-\left(\mathbf{n}^{0}+1\right)-1}\mathbf{e}^{-\frac{\mathbf{n}^{0}\mathbf{y}^{0}}{\boldsymbol{\uptheta}}}\tag{13}$$

$$\mathbf{M}\_{\mathbf{r}} = \int\_{0}^{\infty} \boldsymbol{\theta}^{\mathbf{r}} \mathbf{f} \left( \boldsymbol{\theta} / \mathbf{n}^{0}, \mathbf{y}^{0} \right) d\boldsymbol{\theta}$$

$$\mathbf{M}\_{\mathbf{r}} = \frac{\left( \mathbf{n}^{0} \mathbf{y}^{0} \right)^{\mathbf{n}^{0} + 1}}{\mathbf{r} \left( \mathbf{n}^{0} + \mathbf{1} \right)} \int\_{0}^{\infty} \boldsymbol{\Theta}^{-\left( \mathbf{n}^{0} + \mathbf{1} \right) - 1 + \mathbf{r}} \mathbf{e}^{-\frac{\mathbf{n}^{0} \mathbf{y}^{0}}{\mathbf{0}}} d\boldsymbol{\theta}$$

$$\text{let } \mathbf{z} = \frac{\mathbf{n}^0 \mathbf{y}^0}{\Theta} \Rightarrow \theta = \frac{\mathbf{n}^0 \mathbf{y}^0}{\mathbf{z}}, |\mathbf{J}| = \frac{\mathbf{n}^0 \mathbf{y}^0}{\mathbf{z}^2}$$

$$\mathbf{M\_r} = \frac{\left(\mathbf{n}^0 \mathbf{y}^0\right)^{\mathbf{n}^0 + 1}}{\mathbf{r}(\mathbf{n}^0 + \mathbf{1})} \int\_0^\infty \left(\frac{\mathbf{n}^0 \mathbf{y}^0}{\mathbf{z}}\right)^{-\mathbf{n}^0 - 1 - \mathbf{1} + \mathbf{r}} \mathbf{e}^{-\mathbf{z}} \frac{\mathbf{n}^0 \mathbf{y}^0}{\mathbf{z}^2} \,\mathrm{d}\mathbf{z}$$

$$\mathbf{M\_r} = \frac{\left(\mathbf{n}^0 \mathbf{y}^0\right)^{\mathbf{n}^0 + 1 - \mathbf{n}^0 - 2 + r + 1}}{\mathbf{r}(\mathbf{n}^0 + \mathbf{1})} \int\_0^\infty \mathbf{z}^{\mathbf{n}^0 + 2 - r - 2} \mathbf{e}^{-\mathbf{z}} \,\mathrm{d}\mathbf{z}$$

$$\mathbf{M\_r} = \frac{(\mathbf{n}^0 \mathbf{y}^0)^\mathbf{r}}{\mathbf{r}(\mathbf{n}^0 + \mathbf{1})} \,\mathrm{r}(\mathbf{n}^0 - \mathbf{r} + \mathbf{1})\tag{14}$$

*Robust Bayesian Estimation DOI: http://dx.doi.org/10.5772/intechopen.104090*

fð Þ¼ θnt n0y0 ð Þ<sup>n</sup>0þ<sup>1</sup> <sup>г</sup>ð Þ n0þ<sup>1</sup> <sup>θ</sup>� <sup>n</sup>ð Þ <sup>0</sup>þ<sup>1</sup> �<sup>1</sup> <sup>e</sup>�*n*0*y*<sup>0</sup> <sup>θ</sup> β θ � �nQ<sup>n</sup> <sup>i</sup>¼1<sup>t</sup> β�1 <sup>i</sup> <sup>e</sup>�τð Þ<sup>t</sup> θ ∞ð 0 <sup>n</sup>0y0 � �n0þ<sup>1</sup> г nð Þ <sup>0</sup> þ 1 θ� <sup>n</sup>ð Þ <sup>0</sup>þ<sup>1</sup> �<sup>1</sup> e�*n*0*y*<sup>0</sup> θ β θ � �nY<sup>n</sup> i¼1 t β�1 <sup>i</sup> <sup>e</sup>�τð Þ<sup>t</sup> <sup>θ</sup> dθ ¼ n0y0 ð Þn0þ<sup>1</sup> <sup>г</sup> <sup>n</sup>ð Þ <sup>0</sup>þ<sup>1</sup> <sup>β</sup>nQ<sup>n</sup> <sup>i</sup>¼1<sup>t</sup> β�1 <sup>i</sup> <sup>θ</sup>� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� <sup>n</sup>0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> θ n0y0 ð Þn0þ<sup>1</sup> <sup>г</sup> <sup>n</sup>ð Þ <sup>0</sup>þ<sup>1</sup> <sup>β</sup>nQ<sup>n</sup> <sup>i</sup>¼1<sup>t</sup> β�1 i ð ∞ 0 θ� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� <sup>n</sup>0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> <sup>θ</sup> dθ <sup>¼</sup> <sup>θ</sup>� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� <sup>n</sup>0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> θ ∞ð 0 θ� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� <sup>n</sup>0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> <sup>θ</sup> dθ <sup>¼</sup> <sup>θ</sup>� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� n0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> θ г nð Þ <sup>0</sup>þnþ1 n0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> n0þnþ<sup>1</sup> ∞ð 0 <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �n0þnþ<sup>1</sup> г nð Þ <sup>0</sup> þ n þ 1 θ� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� <sup>n</sup>0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> <sup>θ</sup> dθ <sup>¼</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �<sup>n</sup>0þnþ<sup>1</sup> г nð Þ <sup>0</sup> þ n þ 1 θ� <sup>n</sup>ð Þ <sup>0</sup>þnþ<sup>1</sup> �<sup>1</sup> <sup>e</sup>� n0y ð Þ <sup>0</sup>þτð Þ<sup>t</sup> <sup>θ</sup> (15) <sup>f</sup>ð Þ� <sup>θ</sup>n<sup>t</sup> IG n0 <sup>þ</sup> <sup>n</sup> <sup>þ</sup> 1, n0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �

After we get the posterior distribution and according to the above equation, we extract the standard deviation, as in the following steps:

$$\mathbf{M}\_{\mathbf{r}} = \frac{\left(\mathbf{n}^{0}\mathbf{y}^{0} + \boldsymbol{\pi}(\mathbf{t})\right)^{\mathbf{n}^{0} + \mathbf{n} + 1}}{\mathbf{r}(\mathbf{n}^{0} + \mathbf{n} + \mathbf{1})} \int\_{0}^{\mathbf{e}} \boldsymbol{\Theta}^{-\left(\mathbf{n}^{0} + \mathbf{n} + \mathbf{1}\right) - \mathbf{1} + \mathbf{r}} \mathbf{e}^{-\frac{\left(\mathbf{n}^{0}\mathbf{y}^{0} + \boldsymbol{\pi}(\mathbf{t})\right)}{\mathbf{0}}} \,\mathrm{d}\boldsymbol{\Theta}$$

By using the transformation:

let z <sup>¼</sup> n0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � � <sup>θ</sup> ) <sup>θ</sup> <sup>¼</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � � z , Jjj¼ n0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � � z2 Mr <sup>¼</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �<sup>n</sup>0þnþ<sup>1</sup> гð Þ n0 þ n þ 1 ∞ð 0 <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> z � ��n0�n�2þ<sup>r</sup> <sup>e</sup>�<sup>z</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � � z2 dz Mr <sup>¼</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �<sup>n</sup>0þnþ1�n0�n�2þrþ<sup>1</sup> гð Þ n0 þ n þ 1 ∞ð 0 ð Þ<sup>z</sup> n0þn�<sup>r</sup> e�<sup>z</sup> dz Mr <sup>¼</sup> <sup>n</sup>0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �<sup>r</sup> <sup>г</sup> <sup>n</sup>ð Þ <sup>0</sup> <sup>þ</sup> <sup>n</sup> <sup>þ</sup> <sup>1</sup> <sup>г</sup> n0 <sup>þ</sup> <sup>n</sup> � <sup>r</sup> <sup>þ</sup> <sup>1</sup> � � (16) s*:*d posterior ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi n0y0 <sup>þ</sup> <sup>τ</sup>ð Þ<sup>t</sup> � �<sup>2</sup> nð Þ <sup>0</sup> þ n 2 nð Þ <sup>0</sup> þ n � 1 vuut (17)

The above equation represents the standard deviation of the posterior distribution, after that the comparison is made between the value of the standard deviation of the

prior distribution with the standard deviation of the posterior distribution. If the value of the standard deviation of the prior distribution is greater than the value of the standard deviation of the posterior distribution, this means that there is a problem of prior data conflict.

A second way to get the standard deviation of the posterior distribution is through the following steps:

Through the following form which represents the posterior distribution:

$$\mathbf{f}(\boldsymbol{\theta}/\mathbf{t}) = \frac{\left(\mathbf{n}^{0}\mathbf{y}^{0} + \boldsymbol{\tau}(\mathbf{t})\right)^{\mathbf{n}^{0} + \mathbf{n} + \mathbf{1}}}{\mathbf{r}(\mathbf{n}^{0} + \mathbf{n} + \mathbf{1})} \boldsymbol{\Theta}^{-\left(\mathbf{n}^{0} + \mathbf{n} + \mathbf{1}\right) - 1} \mathbf{e}^{-\frac{\left(\mathbf{n}^{0}\mathbf{y}^{0} + \boldsymbol{\tau}(\mathbf{t})\right)}{\vartheta}}$$

Compensation for:

$$\mathbf{y}^{\mathbf{n}} = \frac{\mathbf{n}^0 \mathbf{y}^0 + \mathbf{r}(\mathbf{t})}{\mathbf{n}^0 + \mathbf{n}}, \mathbf{n}^{\mathbf{n}} = \mathbf{n}^0 + \mathbf{n}$$

The posterior distribution becomes as follows:

$$\mathbf{f}\left(\theta/\mathbf{n}^{\mathbf{n}}\mathbf{y}^{\mathbf{n}}\right) = \frac{\left(\mathbf{n}^{\mathbf{n}}\mathbf{y}^{\mathbf{n}}\right)^{\mathbf{n}^{\mathbf{n}}+1}}{\mathbf{r}(\mathbf{n}^{\mathbf{n}}+\mathbf{1})}\theta^{-(\mathbf{n}^{\mathbf{n}}+\mathbf{1})-1}\mathbf{e}^{-\frac{\mathbf{n}^{\mathbf{n}}\mathbf{y}^{\mathbf{n}}}{\mathbf{0}}}\tag{18}$$

From the above, we conclude that fð Þ¼ <sup>θ</sup>*=*<sup>t</sup> <sup>f</sup> <sup>θ</sup>*=*nnyn � � this means that the standard deviation of the prior distribution and the standard deviation of the posterior distribution will be according to the following formula:

$$\text{s.d prior} = \sqrt{\frac{\left(\mathbf{y}^0\right)^2}{\mathbf{n}^0 - \mathbf{1}}} \tag{19}$$

$$\text{s.d. posterior} = \sqrt{\frac{\left(\mathbf{y}^{\text{n}}\right)^{2}}{\mathbf{n}^{\text{n}} - \mathbf{1}}} \tag{20}$$
