Bayesian SAR-HMM

Source Code

The code is written in Objective Camlopen in new window. The linear algebra operations are done with the GNU Scientific Libraryopen in new window which is called from OCaml via the ocamlgslopen in new window wrapper. Ocamlmpiopen in new window is used to distribute the computation accross multiple machines.

See the included README file for compilation instructions.


The Bayesian SAR-HMM is initialised from an initialised (or trained) SAR-HMM.

./arhmm_to_bsarhmm arhmm-initialised.dat bsarhmm-initialised.dat

First, we need to set up a file with the list of machines we want to use. This file, let's call it machines.lst, should have the form

machine1 1
machine2 2
machine3 2

where the numbers in the second column refer to the number of tasks to be executed on each machine. Note that at least two task slots must be available; one for the controller and one for a worker. If you have only one machine, then you simply define

machine 2

We then start lam.

lamboot -v machines.lst

We can now train a model using a command similar to that used for the SAR-HMM, the only difference being that it must be launched via mpirun.

mpirun N ./bsarhmm_train bsarhmm-initialised.dat train.lst bsarhmm-trained.dat