# Stochastic Extreme Wind Speed Modeling and Bayes Estimation under the Inverse Rayleigh Distribution
## 4 A Bayes Method of Inference for the Risk Index Based upon the IRD Model
### The Case of a Gamma Prior PDF on the IRD Parameter \(\alpha\)--Posterior Analysis  
Obviously, the basic purpose of Bayes inference is to obtain, once the sample data are observed, the posterior estimates and, also, the probability distributions describing our uncertainty about their values. This can be performed in a relatively straightforward way, which can take advantage of the numerical tools shown in the course of the prior analysis illustrated above. Here, a simple example of how the posterior analysis can be accomplished is illustrated, based upon a small data set produced by simulation from an IRD model, according to the relation (see Appendix F):  
\[X=\left[-\frac{\alpha}{\log U}\right]^{\frac{1}{2}} \tag{58}\]  
which yields an IRD RV if \(U\) is a uniform RV in (0,1). Of course, the posterior analysis requires first that the relevant parameters are generated according their prior distributions; then, that their PDFs are updated in view of the above EWS sample; and then, that the BE of the RI is obtained. This is briefly illustrated here, while the performances of such a BE and their comparison with the one obtained by classical methods are examined in the following sections. Reference is still made to the above case C11, so that  
* \(\alpha\) has a gamma prior PDF with \(\text{E}[\alpha]=90\), \(\text{CV}[\alpha]=0.05\), implying parameters \(\
u_{0}=400\) and \(\delta_{0}=0.2250\);
* \(\phi\) has a gamma prior PDF with \(\text{E}[\phi]=10\)\(\text{CV}[\phi]=0.05\), implying parameters \(p_{0}=400\) and \(\theta_{0}=0.02250\). In order to illustrate a simple and easily reproducible numerical example and to highlight how the Bayes inference allows a significant update of information also with very few data, a small sample of only 3 EWS values is produced by a single simulation exemplified here as follows:  
* a value of \(\alpha\) is generated by its gamma prior PDF; its value is 88.00. * a value of \(\phi\) is generated by its gamma prior PDF; its value is 10.00. The corresponding \"true\" value of the RI to be estimated is as follows:  
\[R=1-e^{-\varphi t[1-e^{-(\alpha/2)}]}=1-e^{-10[1-e^{-(88/22)}]}=0.8103\]  
A sample of three EWS values obtained from three uniform variates according to Equation (59), and the above generated value of \(\alpha\) is obtained through simulation, resulting in the following sample:  
\[\mathbf{x}=(12.07,45.01,49.62).\]  
To such a sample, the following observed number of exceedances M is M = 2 (the number of EWS values exceeding the threshold 22), and the Statistics n (sample size) and \(\Sigma\) of Equation (15) and (A31)in Appendix F for evaluating the MLE and the BE for n equals to 3 is 0.0078 and for M equals to 2 is \(\Sigma=\sum\limits_{j=1}^{n}\frac{1}{\frac{\alpha^{2}}{\alpha^{2}_{j}}}=0.0078\), respectively, so that  
* the MLE of W = \(\varphi t\) and \(\alpha\) are \[\text{W }^{*}=\text{M}=2;\,\alpha^{*}=\text{n}/\Sigma=384\]
* the posterior PDF of \(\alpha\) and W, and gamma PDF (A32 in the Appendix F) are described by the following equations respectively: \[q(\alpha|\textbf{D})=Gampdf(\alpha;\
u_{1},\delta_{1})\] (59) for \(\alpha\), with updated parameters \[\left\{ \begin{array}{l}v_{1}=v_{0}+n=403;\\ \delta_{1}=\frac{\delta_{0}}{1+\delta_{0}\Sigma}=0.2246\end{array} \right.\] and \[q(\text{W}|\textbf{D})=Gampdf(\text{W};\rho_{1},\theta_{1})\] (60) for W, with updated parameters \[\rho_{1}=\rho_{0}+M=402\,;\,\theta_{1}=\frac{\theta_{0}}{1+\theta_{0}}=0.0220\]  
The BE, i.e., the posterior mean estimates of (\(\alpha\), W) are respectively  
\[\phi^{\circ}=\text{E}\Big{[}\phi|\textbf{D}\Big{]}=\
u_{1}\delta_{1}=90.52;\, \,\,W^{\circ}=\text{E}[\,W|\textbf{D}\big{]}=\rho_{1}\theta_{1}=9.805\]  
Finally, following the same steps as in the prior assessment, the following computations are performed to evaluate the posterior mean estimate of the RI, R. First, the posterior parameters and PDF of the RV V = WS are computed. Since the numerical computations are very simple, as already noticed, the analytical approximation is shown.