Provides a complete R interface to LibBi, a library for Bayesian inference (see < http://libbi.org> for more information). This includes functions for manipulating LibBi models, for reading and writing LibBi input/output files, for converting LibBi output to provide traces for use with the coda package, and for running LibBi from R.
[RBi] (https://github.com/libbi/RBi) is an
R interface to [libbi] (http://libbi.org), a library for Bayesian inference.
It mainly contains:
bi_modelclass, to manipulate libbi models
libbiwrapper class, to perform Bayesian using libbi inference from within R,
RBi requires R (>= 2.12.1) as well as the packages:
The easiest way to install the latest stable version of RBi is via CRAN. The package is called
rbi (all lower case):
Alternatively, the current development version can be installed using the
The RBi package has only been tested on GNU/Linux and OS X, but it should mostly work everywhere
If you want to use RBi as a wrapper to LibBi then you need a working version of LibBi. To install LibBi on a Mac or Unix, the easiest way is via the homebrew-science tap: Install Homebrew (on OS X) or Linuxbrew (on linux), then issue the following commands (using a command shell, i.e. Terminal or similar):
brew tap homebrew/sciencebrew install libbi
The path to
libbi script can be passed as an argument to RBi, otherwise the package tries to find it automatically using the
which linux/unix command.
If you just want to process the output from LibBi, then you do not need to have LibBi installed.
A good starting point is to look at the included demos:
demo(PZ_generate_dataset) ## generating a data set from a modeldemo(PZ_PMMH) ## particle Markov-chain Metropolis-Hastingsdemo(PZ_SMC2) ## SMC^2demo(PZ_filtering) ## filtering
LibBi contains the
get_traces method which provides an interface to coda.
bi_contentsto quickly get the variables in an NetCDF file
generate_seedto generate a seed for a
libbi$run, to sample posterior observations
resultfield in the
bi_model$get_varsthat didn't remove all spaces
bi_model$fixthat ignored input variables
clientis now an option to
get_tracesif there is only one sample
bi_model$insert_linescan now work with blocks
bi_generate_dataset(#3, #5, @tyler-abbot)
bi_generate_datasetnow returns observations
ncdf4package for interaction with netCDF files
bi_modelclass to manipulate models
inputas R objects
bi_readfunction to directly read from