Interface to 'LibBi'

Provides a complete interface to 'LibBi', a library for Bayesian inference (see < https://libbi.org> and Murray, 2015 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' to conduct inference.


Bayesian inference for state-space models with R

CRANversion GitHub R packageversion R-CMD-check codecov GitHubcontributors License: GPLv3

rbi is an R interface to libbi, a library for Bayesian inference.

It mainly contains:

  • various functions to retrieve and process the results from libbi (which are in NetCDF format)
  • a bi_model class, to manipulate libbi models
  • a libbi wrapper class, to perform Bayesian using libbi inference from within R,

Installation

The easiest way to install the latest stable version of rbi is via CRAN:

install.packages("rbi")

Alternatively, the current development version can be installed using the remotes package

# install.packages("remotes")
library("remotes")
install_github("sbfnk/rbi")

The rbi package has only been tested on GNU/Linux and OS X, but it should mostly work everywhere R works.

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, the easiest way is to install Homebrew, followed by (using a command shell, i.e. Terminal or similar):

brew install libbi

On linux, follow the instructions provided with 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.

Getting started

A good starting point is to look at the included demos:

demo(PZ_generate_dataset) ## generating a data set from a model
demo(PZ_PMMH) ## particle Markov-chain Metropolis-Hastings
demo(PZ_SMC2) ## SMC^2
demo(PZ_filtering) ## filtering

For further information, have a look at the introductory vignette from the link from the rbi CRAN package.

Using coda

LibBi contains the get_traces method which provides an interface to coda.

Other packages

For higher-level methods to interact with LibBi, have a look at rbi.helpers.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rbi")

1.0.1 by Sebastian Funk, 8 months ago


https://github.com/sbfnk/rbi


Report a bug at https://github.com/sbfnk/rbi/issues


Browse source code at https://github.com/cran/rbi


Authors: Pierre E. Jacob [aut] , Anthony Lee [ctb] , Lawrence M. Murray [ctb] , Sebastian Funk [aut, cre] , Sam Abbott [ctb]


Documentation:   PDF Manual  


GPL-3 license


Imports data.table, ncdf4, processx, reshape2

Suggests coda, covr, stringi, testthat, ggplot2, knitr, rmarkdown

System requirements: LibBi (>= 1.4.2)


Imported by rbi.helpers.


See at CRAN