## 4 Bayesian Analysis of Weibull Mixture Distribution Using NG-RJMCMC Algorithm
### Determine the Appropriate Priors
#### 4.2.2 Priors and Posteriors
\begin{array}{rl}f(\mu_{j}|\cdots)&\propto\prod\limits_{j=1}^{k}f(\mu_{j}| \varepsilon,\zeta^{2})\,f(\sigma_{j}|\theta,\omega)\prod\limits_{i=1}^{n}f(y_ {i}|\theta_{z_{i}})\\ &\propto f\big{(}\mu_{j}|\varepsilon,\zeta^{2}\big{)}\prod\limits_{i=1}^{n}f( y_{i}|\theta_{z_{i}})\\ &\propto\left[\frac{1}{\sqrt{2\pi\zeta_{2}^{2}}}\exp\!\left\{-\frac{1}{2} \Big{(}\frac{\mu_{j}-\mu_{i}}{\zeta}\Big{)}^{2}\right\}\right]\times\prod \limits_{i=1}^{n}\frac{1}{\sigma_{j}}\exp\!\left\{\Big{(}\frac{y_{i}-\mu_{j}}{ \sigma_{j}}\Big{)}-\exp\!\Big{(}\frac{y_{i}-\mu_{j}}{\sigma_{j}}\Big{)}\right\} \\ &\propto\left[\frac{1}{\sqrt{2\pi\zeta_{2}^{2}}}\exp\!\left\{-\frac{1}{2} \Big{(}\frac{y_{i}-\epsilon}{\zeta}\Big{)}^{2}\right\}\right]\times\left( \frac{1}{\sigma_{j}}\right)^{n_{j}}\prod\limits_{z_{i}=j}\exp\!\left\{\Big{(} \frac{y_{i}-\mu_{j}}{\sigma_{j}}\Big{)}-\exp\!\Big{(}\frac{y_{i}-\mu_{j}}{ \sigma_{j}}\Big{)}\right\}\\ &\text{and}\\ f(\sigma_{j}|\cdots)&\propto\prod\limits_{j=1}^{k}f(y_{j}|\varepsilon,\zeta^ {2})\,f(\sigma_{j}|\theta,\omega)\prod\limits_{i=1}^{n}f(y_{i}|\theta_{z_{i}}) \\ &\propto f\big{(}\sigma_{j}|\theta,\omega\big{)}\prod\limits_{i=1}^{n}f(y_{i}| \theta_{z_{i}})\\ &\propto\left[\frac{\omega^{\theta}\exp\left(-\frac{\omega}{\sigma_{j}} \right)}{\Gamma(\theta)\sigma_{j}^{\theta_{j}+1}}\right]\times\prod\limits_{i =1}^{n}\frac{1}{\sigma_{j}}\exp\!\left\{\Big{(}\frac{y_{i}-\mu_{j}}{\sigma_{j }}\Big{)}-\exp\!\Big{(}\frac{y_{i}-\mu_{j}}{\sigma_{j}}\Big{)}\right\}\\ &\propto\left[\frac{\omega^{\theta}\exp\left(-\frac{\omega}{\sigma_{j}} \right)}{\Gamma(\theta)\sigma_{j}^{\theta_{j}+1}}\right]\times\Big{(}\frac{1}{ \sigma_{j}}\Big{)}^{n_{j}}\prod\limits_{z_{i}=j}\exp\!\left\{\Big{(}\frac{y_{ i}-\mu_{j}}{\sigma_{j}}\Big{)}-\exp\!\Big{(}\frac{y_{i}-\mu_{j}}{\sigma_{j}}\Big{)} \right\},\end{array}  \tag{22}\]  
where \(n_{j}=\#\{i:z_{i}=j\}\) represents the number of vectors in the cluster \(j\), and we use '\(|\cdots\)' to designate conditioning on all other variables. As we know that the weights of components \(w=\big{(}w_{j}\big{)}_{j=1,2,\cdots,k}\) are defined on the simplex \(\left\{(w_{1},w_{2},\cdots,w_{k}):\sum\limits_{j=1}^{k-1}w_{j}<1\right\}\), the appropriate prior for the weights of components is a Dirichlet distribution with parameters \(\delta=(\delta_{1},\delta_{2},\cdots,\delta_{k})\)[72], with the p.d.f. as in Equation (23):  
\[ \begin{array}{rl}f(w|k,\delta)&=\frac{1}{B(\delta)}\prod\limits_{j=1}^{k}w_{j }^{\delta_{j}-1}\\ &=\frac{\Gamma\Big{(}\sum\limits_{j=1}^{k}\delta_{j}\Big{)}}{\prod\limits_{j=1}^ {k}\Gamma(\delta_{j})}\prod\limits_{j=1}^{k}w_{j}^{\delta_{j}-1},\end{array}  \tag{23}\]  
where \(B(\delta)=\frac{\prod\limits_{j=1}^{k}\Gamma(\delta_{j})}{\Gamma\Big{(}\sum \limits_{j=1}^{k}\delta_{j}\Big{)}}\). According to Equation (2), we also have  
\[f(z|w,k)=\prod\limits_{j=1}^{k}w_{j}^{\eta_{j}}. \tag{24}\]  
Using Equations (23) and (24), and our joint distribution from Equation (17), we obtained  
\[ \begin{array}{rl}f(w|\cdots)&\propto f(w|k,\delta)f(z|w,k)\\ &\propto\left[\frac{\Gamma\Big{(}\sum\limits_{j=1}^{k}\delta_{j}\Big{)}}{\prod \limits_{j=1}^{k}\Gamma(\delta_{j})}\prod\limits_{j=1}^{k}w_{j}^{\delta_{j}-1} \right]\left[\prod\limits_{j=1}^{k}w_{j}^{n_{j}}\right]\\ &\propto\prod\limits_{j=1}^{k}w_{j}^{n_{j}+\delta_{j}-1},\end{array}  \tag{25}\]where \(\frac{\Gamma\left(\sum\limits_{j=1}^{k}\delta_{j}\right)}{\prod\limits_{j=1}^{k} \Gamma\left(\delta_{j}\right)}\) is a constant. This is in fact proportional to a Dirichlet distribution with parameters \((\delta_{1}+n_{1},\delta_{2}+n_{2},\cdots,\delta_{k}+n_{k})\). Using Equations (2) and (17), we get the posterior for the allocation variables  
\[f(z_{i}=j|\cdots)\propto w_{j}\frac{1}{\sigma_{j}}\exp\left[\left(\frac{y_{i} -\mu_{j}}{\sigma_{j}}\right)-\exp\left(\frac{y_{i}-\mu_{j}}{\sigma_{j}}\right) \right]. \tag{26}\]  
The last, proper prior for \(k\) is the Poisson distribution with hyperparameter \(\gamma\)[16], then the p.d.f.