Skip to content

guilgautier/PartialRejectionSampling.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PartialRejectionSampling.jl

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.

Getting Started

Installation

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.

Usage

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>

Tutorial Jupyter notebooks

You can also have a look at the tutorial Jupyter notebooks to play with the code.

Documentation

The documentation is currently available at

Bug reports - Contributions

Feel free to raise issues, make comments or make pull requests. Any feedback is welcome 😃.

About

Some implementations of partial rejection samplers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published