next up previous contents index
Next: Raftery & Lewis Up: Gelman & Rubin Previous: Gelman & Rubin

Plotting Gelman & Rubin's diagnostic

 

You will then be given the option of producing plots to illustrate these diagnostics:

Gelman & Rubin Plots Menu
*************************

1: Trace Plots
2: Shrink Factor Plots
3: Return to Diagnostics Menu
Selection:
Selecting option 1 will produce plots   of the multiple traces for each variable, with the Gelman & Rubin diagnostics printed above each graph.

Selecting option 2 will generate plots   like those shown in Figure 3. These plots are produced by splitting the chain for each variable into a number of segments as follows: the first contains samples 1:50; the second contains samples 1:(50 + n); the third contains samples 1:(50 + 2n) and so on. (Note that these segments are constructed differently to those for plotting Geweke's Z-scores -- see §4.1.1). The default bin size is n=10 for chains of 500 iterations or less. For longer chains, the bin size is determined by splitting the chain equally into 50 bins. These sizes may be changed by the user (see §5.7.2). Gelman & Rubin's diagnostic is computed for each segment, and the median and 97.5% quantile of the sampling distribution for the resulting shrink factor are plotted against the maximum iteration number for the segment. The plots in Figure 3 show that both the median and 97.5% quantile for beta stabilize around a value of 1.0 (indicated by the horizontal dashed line) for chain segments containing the first 150 iterations or more. Since the diagnostic is calculated from the second half of each chain only, this suggests that convergence was first achieved after approximately 75 iterations. The estimated shrink factors for alpha and sigma also appear to have stabilized around 1.0 for chain segments greater than 150 iterations. However, both show small jumps at about iteration 190 which implies that a longer run may be appropriate. (Note that the vertical scale differs for each of these plots). These plots may take some time to produce due to the large number of computations invovled: the process may be speeded up by reducing the total number of bins, or increasing the bin size.

  figure406
Figure 3:   Plot of Gelman & Rubin's diagnostic produced by selecting Shrink Factor Plots (Option 2) from theGelman & Rubin Plots Menu

   

The early iterations in each chain often show poor mixing. This may occasionally lead to numerical errors when calculating Gelman and Rubin's diagnostic for the initial segments. In such circumstances, CODA will display the following warning message:

******* Warning: *******
Could not compute Gelman & Rubin's diagnostic for * chain segments
where * gives the number of segments generating errors. However, the shrink factors for the later segments remain valid and will be shown on the plot. If all segments generate errors, no plots will be produced and CODA displays the following error message:
******* Error: *******
Cannot compute Gelman & Rubin's diagnostic for any chain segments
This indicates convergence failure ==> Run chains for more iterations


next up previous contents index
Next: Raftery & Lewis Up: Gelman & Rubin Previous: Gelman & Rubin

Daniel Farewell
Tue Sep 14 16:08:04 BST 1999