monty
is a toolbox for Monte Carlo methods. It is designed to help run MCMC with models that do not fit closely within the paradigms of packages such as stan - for example some likelihood you have written by hand.
See the package vignette for a basic introduction.
The core of the package is built around some basic ideas:
- you have some statistical model from which you would like to draw samples using MCMC (
monty::monty_sample
) - you can choose between different samplers depending on the properties of your model
- you can specify priors for your model with a high-level DSL
- you can power stochastic models with a fast, parallelisable, random number generator, and use this from both R and C++
Related tools
monty
is a complete rewrite of some of the ideas in mcstate
, though other bits of mcstate
have moved into dust2
.
The dust2
package provides machinery to run particle filters for sequential Monte Carlo methods using the random number support in monty
and can create statistical models that can be used with monty
’s samplers
The odin2
package can generate dynamical models that use monty
’s random number generators and can be used as part of dust2
particle filter. The odin2
DSL and monty
DSL are closely related.
Roadmap
The basic functionality of this package is in place, but we plan to do work on:
- improving debugging tools if models fail mid-chain
- implementing parallel tempering, allowing you to compose with any other supported sampler
- improving support for nested models
- improving and expanding the DSL
Installation
Please install from our r-universe:
install.packages(
"monty",
repos = c("https://mrc-ide.r-universe.dev", "https://cloud.r-project.org"))
If you prefer, you can install from GitHub with remotes
:
remotes::install_github("mrc-ide/monty", upgrade = FALSE)