Brief instructions for re-running code samples used in lectures:

A. R code
   ======

1. Click on the appropriate link, and download the file into a suitable 
	directory on your PC.
2. Start up R (if not already running)
      (look under Start | All Programs | Engineering Apps)
3. Source the file (File menu, Source R code item, navigating to the correct
	directory if necessary)
4. Then type the name of the function with arguments in parentheses, as 
	in the examples below.

(in each case, the values after "=" in the argument list of the function
stated below are the default values, assumed if no other value is specified)

binomial.lik(X=45,n=100,pmax=1.15*max(dbinom(X,n,thr)),thr=(4:36)/40)
e.g. you can type:
binomial.lik()
binomial.lik(23)
binomial.lik(X=4,n=20)

normal.lik(n=100,mu0=2.3,sigma0=1.4)
e.g. 
normal.lik()

mn.vs.md(sample.size=25,num.samples=1000,mu0=2.3,sigma0=1.4)
e.g.
mn.vs.md()
mn.vs.md(sample=10)
mn.vs.md(sam=1000)

bimod.lik(n=100)
e.g.
bimod.lik(10)

For the beta-binomial predictive distribution animation, download and
unzip the zip file. Then source the file beta-binomial.R; the function 
runs as soon as it is source'd. Click on the Tcl/Tk icon in the taskbar 
to bring up the control panel, where N, n and X can be set, as well as 
prior parameters.

Just type the name of the function (with no parentheses) to see
a listing of it - each has some comments, so you should be able
to follow the logic. If not, ask!

B. Hugin code
   ==========

The .net files are Bayesian networks set up for running in Hugin 5.7. 

1. Click on the appropriate link, and download the file into a suitable 
	directory on your PC.
2a. If Hugin has been properly installed, just double-clicking on the .net file
      should start up Hugin and load in the file
2b. If Hugin has not been fully installed, start up Hugin yourself 
      (look under Start | All Programs | Engineering Apps)
      then use File | Open and navigate to the .net file to load it
3. click on the yellow 'whirlwind' symbol to run the network

C. WinBugs code
   ============

Instructions for running these Winbugs demos

Unzip the archive

You can put the script files where you like, but the model, data
and initial values files must all be in c:\Program Files\Winbugs14\Test

Start up Winbugs, and open one of the script files. The cursor should
be in the top left of the resulting window. Select Model | Script
from the Winbugs menus.

Results will be displayed in the log window, and also saved
in a .odc file in c:\Program Files\Winbugs14\Test.

You can extend the run (Model | Update) and/or make additional
summaries or do additional monitoring (Inference | Samples).