Skip to content

statistical algorithms in NIMBLE

Christopher Paciorek edited this page Mar 10, 2015 · 5 revisions

Implementing Statistical Fitting Algorithms for R through NIMBLE

Summary: Adding algorithms to the NIMBLE package by writing them in the NIMBLE DSL, thereby making these algorithms accessible to users who provide their models as written in the BUGS language.

Description: NIMBLE is a package that allows algorithm developers and coders to implement statistical algorithms using the NIMBLE domain specific language (DSL). The NIMBLE DSL is a subset of R syntax that is specially designed for implementing algorithms applied to hiearchical models. Users provide their statistical model using the BUGS language. NIMBLE then generates C++ code that implements an algorithm specified in the DSL for the specific statistical model of interest. We currently have a basic MCMC implementation with conjugate, adaptive Metropolis-Hastings, and slice sampling. We also have prototype MCEM and particle filtering algorithms implemented. We are interested in implementing a variety of other important existing algorithms. Exactly which algorithms can be determined based in part on the interest of the student, but possibilities include sequential Monte Carlo (various flavors), variational Bayes, Laplace approximation, integrated nested Laplace approximation, etc.

Related work: There are a variety of packages in R and for other languages that implement the algorithms mentioned above, some of them specific to particular model structures. The distinction is that we wish to provide algorithms through our system that will be available for any BUGS model for which the algorithm is appropriate.

Potential tasks:

  • Read the statistical/machine learning literature on a given algorithm for hierarchical/Bayesian models.
  • Investigate implementations in other languages/packages.
  • Implement the algorithm in the NIMBLE DSL.
  • Write unit tests of new functionality.
  • Write documentation.

Skills required / desired:

  • Understanding of and ability to implement statistical algorithms.
  • Ability to learn the NIMBLE DSL for specifying algorithms.
  • Ability to understand and port existing code for algorithms in C, R, Python, etc.
  • Good working knowledge of R.
  • Understanding of numerical methods.
  • Basic knowledge of github.

Test: Laplace's method can be used to approximate integrals of the form E(h(theta)|y) where the expectation is with respect to the posterior distribution for theta given the data, y, as discussed in Tierney & Kadane (Journal of the American Statistical Association (1986) 81:82-86). Assuming you have an R function that evaluates the posterior density for the model, where theta is the first argument, and an R function that implements the function h(), where theta is the first argument, write an R function that implements Laplace's method to estimate the expectation.

Mentor: Perry de Valpine ([@](mailto:pdevalpine {at} berkeley {dot} edu)) and Chris Paciorek ([@](mailto:paciorek {at} stat {dot} berkeley {dot} edu)) as backup mentor

Clone this wiki locally