![[logo]](/bugs/images/bugslogo.gif)
If you have been following the worked line example, examine file bugs.out, which contains output in the form shown below.
501 3.07739
502 3.21921
503 2.38693
......
1499 4.76044E-1
1500 3.19312E-1
The first column represents the iteration number (501 - 1500) and the second column is the sampled values. To relate each such value to a variable one refers to the bugs.ind whose contents are reproduced below.
alpha 1 1000 beta 1001 2000 sigma 2001 3000 tau 3001 4000
This specifies that lines 1 to 1000 of bugs.out correspond to variable alpha, lines 1001 to 2000 are values for beta, and so on.
The suite of S-plus functions, CODA, distributed with BUGS provide plots, summary statistics and convergence diagnostics. See the CODA manual for details.
The stats command also writes the output to a file called by default bugs1.out in a rectangular format suitable for reading into statistical packages for producing graphs, tables and so on. The 10 columns contain the following summary statistics: (1) mean, (2) standard deviation, (3) lower percentile being reported (default 2.5%), (4) observed lower percentile, (5) upper percentile being reported (default 97.5%), (6) observed upper percentile, (7) median, (8) number of iterations, (9) start iteration, (10) finish iteration.
For the line example the results are as follows and should be compared with the results of using the stats command shown in Section 6.
3.017E+0 6.851E-1 2.500E+0 1.996E+0 9.750E+1 4.111E+0 3.012E+0 1000 501 1500 7.811E-1 4.002E-1 2.500E+0 -8.670E-2 9.750E+1 1.528E+0 7.993E-1 1000 501 1500 1.041E+0 8.770E-1 2.500E+0 4.305E-1 9.750E+1 2.837E+0 8.265E-1 1000 501 1500 1.836E+0 1.439E+0 2.500E+0 1.239E-1 9.750E+1 5.391E+0 1.463E+0 1000 501 1500
The file bugs1.ind contains the node names for the variables listed, and the corresponding row number in the bugs1.out file.
alpha 1 beta 2 sigma 3 tau 4
Repeated output from stats commands will simply be appended to the end of these files during a single run (note that use of the out command will overwrite this output).
While recommending several long runs from over-dispersed starting points, for single runs we do include two commands, diag and out, which may help in the monitoring process.
diag calculates
a simple test statistic intended to indicate whether an early part
of a run differs substantially from the later part,
and is a rough approximation to that suggested
by Geweke (1992).
A selected set of sampled values
is divided into two segments: the first quarter (early) and the second half
(late) . The saved values
in each segment are
divided into 25 bins and the mean of each bin is calculated, denoted
and
. The empirical means and variances
of these two sets of 25 numbers are calculated to be
, and the standardised
test statistic
is expected to have a standard normal distribution if the sample
is all from the same distribution. We note that auto-correlation
between the
's may tend to make the empirical variances too low
and hence the procedure anti-conservative, in suggesting differences
between early and late data that are too extreme. The command
allows an arbitrary set of monitored values to be selected,
and prints out
and Z.
For the line example the results of a comand out(beta) will be as follows. In bugs1.out will be stored the sampled values
501 7.31789E-1
502 8.65938E-1
503 1.14477
504 1.23844
505 5.97648E-1
........
1498 4.73403E-1
1499 1.02701
1500 1.49829E-1
while the file bugs1.ind contains the labels for the variables listed.
beta 1 1000
This is in a format ready to be read into CODA for analysis.
Comments to bugs@mrc-bsu.cam.ac.uk
© 1995 MRC Biostatistics Unit
Return to the Welcome Page