1.5.2 Bayesian estimation using WinBUGS or OpenBUGS

As we have seen the BayesianModeling generates two files, one that contains the model of binary regression with the link selected and another that contains the data set. Both files with txt format have to be opened in the WinBUGS or OpenBUGS program to make the correspondent analysis of inference. Here we detail the steps that must be followed to perform the Bayesian inference in WinBUGS. For details, see Chapter 4 of Nzoufras (2009)

1. Open the files with the syntax of the model and the previous generated data by the BayesianModeling in WinBUGS or OpenBUGS.

2. Click in Model > Specification having active the window of the file Skew Logit Model.txt.

3. This will open the dialogue box Specification Tool.

4. Select the word model highlighting it with the cursor and do click in check model. In the below left corner has to appear model is syntactically correct that indicates the syntax of the model is properly formulated.

5. Select in the file of the model the line under Data, list and do click in load data. In the below left corner appears data loaded indicating that the data have been read.

6. In the data file Binary Regression Data.txt select the names of the variables x and y and do click in load data.

7. The dialogue box Specification tool specifies the number of chains that want to generate in the box of text num of chains. Once specified the number of chains to generate (in this example 1 chain) do click in compile. In the left corner below has to appear model compiled.

8. Select the line under Inits in the file of the model and do click in load inits. Then do click in gen inits. This generates the initial values for the Bayesian Estimation. In the left corner below has to appear initial values generated, model initialized

9. Do click in Model > Update

10. This will open the dialogue box Update tool. In the text box Update Tool type the number of iterations that are required and afterwards does click in update

11. Then, you must to specify the parameters to be monitored, for this go to Inference > Samples, which will open the dialogue box Sample monitor tool. In the text box node type the name of the parameters and then do click in set, this has to be done for each parameter. In the example is beta and delta.

12. Repeat the step 10 as necessary to generate more iterations. In addition, by considering the dialogue box Sample Monitor Tool, you can: calculate posterior statistics of the parameters doing click in stats button, obtain a trace plots of the chains doing click in history button, an estimation of the posterior density doing click in density button and other more statistics of the chains can be calculated using this dialogue box. If you want to save the actual values for further analysis, click on "coda" on the Sample Monitor Tool.