Skip to content

Sjl edits #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions joss/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ bibliography: references.bib
# Summary

Generating samples from a probability distribution
is a common requirement in Bayesian inference settings.
The distribution of interest is typically the posterior distribution on a model's parameters,
conditioned on data assumed to be generated by the model.
is a common requirement in many disciplines.
In Bayesian inference, for example, the distribution of interest is the posterior over parameters of a model,
given data assumed to be generated from the model.
Expectations with respect to the posterior can be easily estimated using samples,
allowing computation of posterior means, variances and other quantities of interest.
_Markov chain Monte Carlo_ (MCMC) methods
are a general class of algorithms for approximately sampling from probability distributions.

`rmcmc` is an R package providing implementations of MCMC methods for sampling from distributions on real-valued vector spaces.
`rmcmc` is an R package providing implementations of MCMC methods for sampling from distributions on $\mathbb{R}^d$ for $d \geq 1$.
It provides a general purpose implementation of the Barker proposal [@livingstone2022barker],
a gradient-based MCMC algorithm inspired by the Barker accept-reject rule [@barker1965monte].
a gradient-based MCMC algorithm inspired by the Barker accept-reject rule [@barker1965monte]. It also provides implementations of other MCMC algorithms based on random walk (RWM), Langevin (MALA) and Hamiltonian (HMC) dynamics, and a flexible interface for performing adaptive MCMC so that algorithmic tuning parameters can be learned in a bespoke manner [@haario2001adaptive;@andrieu2008tutorial].
The key function provided by the package is `sample_chain`,
which allows sampling a Markov chain with a user-specified stationary distribution.
The chain is sampled by generating proposals
and accepting or rejecting them using the Metropolis--Hastings [@metropolis1953equation;@hastings1970monte] algorithm.
During an initial warm-up stage, the parameters of the proposal distribution can be adapted [@haario2001adaptive;@andrieu2008tutorial],
During an initial warm-up stage, the parameters of the proposal distribution can be adapted,
with schemes available to both:
tune the scale of the proposals by coercing the average acceptance rate to a target value;
tune the shape of the proposals to match covariance estimates under the target distribution.

# Statement of need

For target distributions for which the density function is differentiable,
For target distributions with smooth density functions,
gradient-based MCMC methods can provide significantly improved sampling efficiency
over simpler schemes such as _random-walk Metropolis_ (RWM),
particularly in high-dimensional settings [@roberts1996exponential;@roberts1998optimal;@beskos2013optimal].
For schemes such as _Metropolis adjusted Langevin algorithm_ (MALA) [@rossky1978brownian;@besag1994comments]
and _Hamiltonian Monte Carlo_ (HMC) [@duane1987hybrid;@neal2011mcmc],
this improved efficiency can however come at the cost of decreased robustness to tuning of the algorithm's parameters,
this improved efficiency can, however, come at the cost of decreased robustness to tuning of the algorithm's parameters,
compared to non-gradient based methods such as RWM [@livingstone2022barker].
The Barker proposal provides a middle road,
offering similar efficiency in high-dimensional settings as other gradient-based methods such as MALA [@vogrinc2023optimal],
Expand All @@ -64,7 +64,7 @@ and improved robustness to certain forms of irregularity, such as skewness,
in the target distribution [@hird2020fresh].

`rmcmc` fills a niche in the R statistical computing ecosystem,
by providing general purpose implementations of the Barker proposal, as well as Gaussian RWM, MALA and HMC,
by providing general purpose implementations of the Barker proposal, as well as RWM, MALA and HMC,
along with several schemes for adapting the proposal parameters.
Significant flexibility is available in specifying the log density of the target distribution,
and its gradient.
Expand Down Expand Up @@ -121,12 +121,11 @@ and in particular both offer gradient-based MCMC methods.

Stan's default MCMC implementation is a HMC method,
which dynamically sets the trajectory lengths when simulating Hamiltonian dynamics to generate proposals [@hoffman2014no;@betancourt2017conceptual],
and also includes schemes for adapting algorithm's scale (step-size) and shape (metric) parameters.
Stan does not currently provide an implementation of the Barker proposal algorithm however.
`rmcmc` does also offer a basic HMC implementation, but unlike Stan,
currently only supports HMC with a static or randomized trajectory lengths.
and also includes schemes for adapting an algorithm's scale (step-size) and shape (metric) parameters, but with limited user-flexibility.
Stan also does not currently provide an implementation of the Barker proposal.
`rmcmc` does also offer a basic HMC implementation, but currently only supports HMC with static or randomized trajectory lengths.
One of the proposal scale adaptation schemes implemented in `rmcmc`,
is a dual-averaging algorithm [@nesterov2009primal;@hoffman2014no] matching the corresponding scheme in Stan.
is a dual-averaging algorithm [@nesterov2009primal;@hoffman2014no] matching the corresponding scheme in Stan, but in contrast to Stan alternative schemes are available in `rmcmc`.

NIMBLE allows definitions of both models and statistical algorithms in its PPL,
and provides implementations of a variety of MCMC methods including,
Expand Down