MyNixOS website logo
Description

Interface to 'LibBi'.

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

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.

Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows