pierrejacob / smcsamplers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

smcsamplers

Implements SMC samplers to re-create the figures of the article entitled An invitation to sequential Monte Carlo samplers, written by Chenguang Dai, Jeremy Heng, Pierre E. Jacob, and Nick Whiteley, available on arXiv at arxiv.org/abs/2007.11936.

This is not a general-purpose statistical software. This is just a collection of scripts intended to reproduce the figures of a paper. Use at your own risk!

The file inst/README.R describes which scripts generate which figures.

Installation

The package can be installed from R via:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("pierrejacob/smcsamplers")

It depends on the packages Rcpp, RcppEigen, tidyverse, doParallel, doRNG, ggridges, ggthemes, gridExtra, lubridate, cobs which are all on CRAN. You can also run the following code to install the ones you miss.

if (!require("Rcpp")) install.packages("Rcpp")
if (!require("RcppEigen")) install.packages("RcppEigen")
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("doParallel")) install.packages("doParallel")
if (!require("doRNG")) install.packages("doRNG")
if (!require("ggridges")) install.packages("ggridges")
if (!require("ggthemes")) install.packages("ggthemes")
if (!require("gridExtra")) install.packages("gridExtra")
if (!require("lubridate")) install.packages("lubridate")
if (!require("cobs")) install.packages("cobs")

Furthermore, the SIR example requires outbreaks and rstan:

if (!require("outbreaks")) install.packages("outbreaks")
if (!require("rstan")) install.packages("rstan")

The “path of least effort” example on logistic regression requires the pgdraw package:

if (!require("pgdraw")) install.packages("pgdraw")

About


Languages

Language:R 85.1%Language:C++ 13.0%Language:TeX 1.9%