Skip to content

RcppSMC Development

ilyaZar edited this page Apr 5, 2021 · 5 revisions

Background

Sequential Monte Carlo methods, including particle filters, are a powerful simulation-based technique for approximating probability distributions and associated normalizing constants. See, e.g., Particle Filtering Tutorial for one recent introduction to these methods.

There is a perception that such methods are difficult to implement and good software support is needed.

Related work

The majority of software support for such methods is in the form of libraries for lower-level languages (smctc,vsmc) or standalone programs (libBI,biips,Birch).

RcppSMC is an attempt to leverage the power of Rcpp and smctc to combine the flexible, friendly interface of R with the speed and power of C++ in this context.

Details of your coding project

There is considerable flexibility. The intention is that the project will begin with familiarization with SMC and RcppSMC, before the student goes on to complete some simple tasks to gain confidence and experience with the existing software before moving on to produce substantial enhancements and extensions to the existing skeleton.

Some more concrete items are listed below. It's not the case that a project will necessarily address all of these issues and it is not an exhaustive list, simply an indication of the type of development that might be involved. The particular direction of the project will depend on the interests and skills of the student.

Some examples:

  • investigate further vectorizing algorithm internals

  • modify underlying C++ code to allow ancestral lines to be tracked (that is, to keep track of the indices selected in resampling to allow the genealogy associated with the particle filter to be tracked). Aside from being of independent interest, this information is required to allow certain advanced SMC algorithms to be implemented -- the particle Gibbs algorithm for example.

  • provide additional template support for conditional sequential Monte Carlo algorithms as a necessary step towards supporting those inferential schemes which make use of them

  • include support for backward/ancestor sampling and the particle smoothing algorithms by making use of these ancestor indices and conditional SMC algorithms

  • provide exemplar particle Gibbs and iterated conditional SMC smoothing algorithms

Expected impact

A successful project will lead to a more stable, more feature complete package allowing relatively easy development of fast implementation of modern SMC algorithms within R. This could dramatically increase the use of such methods and make R more attractive to developers working with SMC-algorithms and have impact both within academia and more widely.

Mentors

Students, please contact mentors below after completing at least one of the tests below.

  • Adam Johansen is an expert in SMC and has previous GSOC experience with the R Project in 2018-19.
  • Dirk Eddelbuettel is an an experienced open source software developer and maintainer of numerous R packages including Rcpp and has extensive prior experience with GSOC.
  • EVALUATING Mentor: Leah South is an expert in SMC and has previous GSOC experience with the R Project in 2018-19.

All of these mentors have contributed to the RcppSMC project.

Tests

  • Easy: install RcppSMC from CRAN and apply one or more of the example samplers to your own data set.
  • Medium: implement an SMC algorithm of your choice using the RcppSMC package. Turn your code into an R package that passes the R CMD check --as-cran test.
  • Hard: Fork the RcppSMC repository and submit a pull request containing your solution to one of the following tasks:
    • Address one of the outstanding simple issues.
    • Create a parameter object so that algorithm parameters can be stored and their history can be tracked.
    • Allow for proper deep copies of pAdapt and adaptBelong.

Solutions of tests

Students, please post a link to your test results here.

  1. https://github.com/ilyaZar/SVmodelExamples
  2. https://github.com/ilyaZar/SVmodelRcppSMC
Clone this wiki locally