This module provides a Julia implementation of the Partial Rejection Sampling (PRS) methodology, recently developed by Guo, Jerrum and Liu (2019). With PRS, you generate exact samples from product distributions subject to some constraints, see e.g., some Graph point processes and Spatial point processes.
Given an initial sample from the (unconstrained) product distribution:
- Vanilla rejection sampling resample all variables if any constraint is violated; until all constraints are satisfied,
- Partial rejection sampling instead identifies a subset of variables to be resampled, starting from variables involved in violated constraints, and preserves the state of the variables outside of this resampling set; until all constraints are satisfied.
In both cases, the output sample is guaranteed to have the right distribution, i.e., the product distribution subject to the prescribed constraints.
PartialRejectionSampling.jl
is not a registered package, yet.
Nevertheless, you can to install it through
julia> ]add https://github.com/guilgautier/PartialRejectionSampling.jl
see also how to manage packages with Pkg
.
To start using the package, simply enter
julia> using PartialRejectionSampling
# const PRS = PartialRejectionSampling is made available so you can then use
# PRS.<type/function_you_want_to_use>
You can also have a look at the tutorial Jupyter notebooks
to play with the code.
The documentation is currently available at
Feel free to raise issues, make comments or make pull requests. Any feedback is welcome 😃.