Home Get BMS Documentation Tutorials BMA Resources BMS Blog

BMS toolbox for Matlab: Bayesian Model Averaging

The BMS toolbox for Matlab (Version 0.2 - beta) provides the core functionality of the R package BMS to Matlab (only under Windows).
The toolbox provides Matlab functions that perform Bayesian Model Averaging via calling a hidden instance of R.


When to use BMS in Matlab, rather than in R

BMS is a Bayesian Model Averaging library written for the open source statistical language R. And only within R, the full range of BMS functionality is available.

However, a substantial number of users prefers to work from within Matlab . Therefore this toolbox provides the basic functionality of BMS in Matlab, intended for simple applications in Bayesian Model Averaging. For more advanced applications, it is strongly recommended to use BMS in its native R environment.

Please bear in mind that BMS toolbox for Matlab is still in testing (beta) stage and may not work as well as its R equivalent!


Install BMS toolbox for Matlab

Running BMS for Matlab requires a Windows operating system (NT, XP, Vista, or 7) and Matlab (Version Matlab 6 or later)

  1. Download RAndFriends to somewhere on your local disk. (This could take quite a while as the download is about 800 MB.)
  2. Install RAndFriends by double-clicking on the downloaded file. In case of troubles, consult the setup instructions at the statconn Wiki
  3. Download BMS_matlab.zip and unzip it to somewhere on your local hard drive.
  4. Open Matlab and navigate your Matlab current directory to the folder BMS_matlab of the toolbox
  5. In Matlab, run the command libraryBMS: At the first time the console will display the following warning:
    BMS library seems to be not installed. Trying to install...
  6. Wait for execution: BMS for Matlab is now ready to use. To close the hidden R instance type closeBMS.

In order to familiarize yourself with the toolbox, try the online BMS for Matlab tutorial
In addition the file demo.m among the toolbox files demonstrates some basic commands.


Release Notes

Release notes and troubleshoting issues are in the README.txt in BMS_matlab.zip.

So far BMS toolbox for MAtlab has been tested on Windows XP and Vista with Matlab versions 6.5 and 2009b (7.9).

Note: The BMS toolbox for Matlab depends on the R D-COM interface to communicate with R. Installing the D-COM as a separate component can be troublesome, therefore it is recommended to install R and the D-COM at once with RAndFriends.