Skip to content

RcppSMC Development

Adam Johansen edited this page Feb 7, 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).

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

  • further develop plugin support for RcppSMC to streamline its use through R

  • 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 indepent 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 theses 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

IMPORTANT: you MUST write "EVALUATING" for one mentor, who will be required to do the three evaluations of the student during the summer. In previous years we have had issues with mentors who do not fill in evaluations, and when this happens R project is penalized (money is taken away), although students are not penalized (students are passed by default if no mentor eval is submitted). Therefore one mentor must take responsibility for doing the evaluations, and you must indicate that here, and your student must indicate that as well in the application. If it is not clear which mentor will be the EVALUATING mentor then your project will not be accepted. Example:

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

  • EVALUATING MENTOR: Toby Hocking [email protected] is the author of R packages X and Y.

  • Other Dev [email protected] is an expert in machine learning, and has previous GSOC experience with NAME_OF_OPEN_SOURCE_ORGANIZATION in 2015-2016.

  • EVALUATING Mentor: Adam Johansen is an expert in SMC and has previous GSOC experience with the R Project in 2018-19.

  • Dirk Eddelbuettel is an aexperience software developer, and maintainer of numerous R packages including Rcpp.

  • Leah South is an expert in SMC and has previous GSOC experience with the R Project in 2018-19.

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; address one of the outstanding simple issues and submit a pull request containing your solution.

Tests

Students, please do one or more of the following tests before contacting the mentors above.

MENTORS: write several tests that potential students can do to demonstrate their capabilities for this particular project. Ask some hard questions that will give you insight about how the students write code to solve problems. You'll see that the harder the questions that you ask, the easier it will be for you to choose between the students that apply for your project! Please modify the suggestions below to make them specific for your project.

  • Easy: something that any useR should be able to do, e.g. download some existing package listed in the Related Work, and run it on some example data.
  • Medium: something a bit more complicated. You can encourage students to write a script or some functions that show their R coding abilities.
  • Hard: Can the student write a package with Rd files, tests, and vignettes? If your package interfaces with non-R code, can the student write in that other language?

Solutions of tests

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

  • EXAMPLE STUDENT 1 NAME, LINK TO GITHUB PROFILE, LINK TO TEST RESULTS.
Clone this wiki locally