## some plots
samplesHistory("*", mfrow = c(4, 2)) # plot the chain,
samplesDensity("alpha") # plot the densities,
samplesBgr("alpha[1:6]") # plot the bgr statistics, and
samplesAutoC("alpha[1:6]", 1) # plot autocorrelations of 1st chain
## Not run:
# Getting more (online-)help:
if (is.R())
help.BRugs()
## End(Not run)
OUTPUT LENGKAP:
> ### Step by step example: ###
> library("BRugs") # loading BRugs
Welcome to BRugs connected to OpenBUGS version 3.2.3
Letak Data yang digunakan untuk contoh adalah file yang berada di program OPENBUGS
The software on this page gets updated. Refresh to get latest versions. Last update: 24 Jan 2007.
Write a Bugs model in a file with a .bug extension (in your R working directory; for example,
c:/bayes/)).
Prepare the inputs to the "bugs" function and run it (see example below).
A WinBugs14 window will pop up and R will freeze up. The model will now run in WinBugs. It
might take awhile. You will see things happening in the Log window within WinBugs14. When
WinBugs is done, its window will close and R will work again.
If an error message appears, re-run with the debug=TRUE option. Then, when the model stops
running, the Bugs window will stay open and you can play with the model directly in WinBugs.
When you are ready, you can then close the WinBugs14 window and R will resume.
To see the inferences, use the "print" and "plot" functions (see example below).
To work with the simulations, use the "attach.all" function (see example below).
For more information, type "help(bugs)" when in R.
Exactly the same steps as above, except that you add program="openbugs" to the call to bugs()
from R (see end of the example below)
Also the debug=TRUE option is not yet set up when you call OpenBUGS.