Skip to content

Sample a repelled point process, compute a Monte Carlo estimation for the integral of a function using various variants of the Monte Carlo method including the Monte Carlo with a repelled point process, and visualize gravitational allocations 2D.

License

Notifications You must be signed in to change notification settings

dhawat/MCRPPy

Repository files navigation

Monte Carlo with the repelled point processes (MCRPPy)

CI-tests codecov Python >=3.8,<3.10

Sampling repelled point processes, estimating function integrals using various Monte Carlo methods (including a method with the repelled point process), and illustrating 2D gravitational allocation from the Lebesgue measure to a point process.

Introduction

MCRPPy is an open-source Python package that currently includes methods for sampling from a variety of point processes, including the homogeneous Poisson, Thomas, Ginibre, scrambled Sobol, Binomial, and their repelled counterparts. The project also includes several Monte Carlo methods, including a Monte Carlo method with the repelled point process. Furthermore, the package provides tools for visualizing the gravitational allocation from the Lebesgue measure to a point process within a two-dimensional space (d=2).

This project serves as a companion code for the research paper titled ''Repelled point processes with application to numerical integration''; see: How to cite this work.

Dependencies

  • MCRPPy works with Python >=3.8,<3.10.

  • Python dependencies are listed in the pyproject.toml file.

Installation

Install the project as a dependency

  • Install from source (this may be broken)

    # activate your virtual environment and run
    poetry add git+https://github.com/dhawat/MCRPPy.git
    # pip install git+https://github.com/dhawat/MCRPPy.git

Install in editable mode and potentially contribute to the project

The package can be installed in editable mode using poetry.

To do this, clone the repository:

  • if you considered forking the repository

    git clone https://github.com/your_user_name/MCRPPy.git
  • if you have not forked the repository

    git clone https://github.com/dhawat/MCRPPy.git

and install the package in editable mode

cd mcrppy
poetry shell  # to create/activate local .venv (see poetry.toml)
poetry install
# poetry install --no-dev  # to avoid installing the development dependencies
# poetry add -E docs -E MCRPPy  # to install extra dependencies

Getting started

Companion paper

We wrote a companion paper to MCRPPy, "Repelled point processes with application to numerical integration".

In the paper, we introduce the repelled point process, analyze its properties, and use it to develop a Monte Carlo estimator for approximating function integrals. Our main theoretical result is that the repelled Poisson point process yields an unbiased Monte Carlo estimator with lower variance than the crude Monte Carlo method. On the computational side, the evaluation of our estimator is only quadratic in the number of integrand evaluations and can be easily parallelized without any communication across tasks. We illustrate the variance reduction result with numerical experiments and compare it to popular Monte Carlo methods. Finally, we numerically investigate a few open questions on the repulsion operator.

Notebooks

We provide three tutorial Jupyter Notebooks available in the ./notebooks folder.

  • tutorial_sample_repelled_point_pattern.ipynb: tutorial for sampling a Repelled point process.
  • tutorial_monte_carlo_methods.ipynb: tutorial for estimating function integrals using the available Monte Carlo methods.
  • tutorial_gravitational_allocation.ipynb: tutorial for illustrating a two-dimensional gravitational allocation from Lebesgue to a point process.

We also provide two Jupyter Notebooks for replicating the study of the companion paper.

  • companion_paper.ipynb: main notebook.
  • structure_factor_and_pcf.ipynb: supplementary notebook.

See the README.md in the ./notebooks folder for further instructions on how to run a notebook locally.

How to cite this work

If MCRPPy has been significant in your research, and you would like to acknowledge the project in your academic publication, please consider citing it with this piece of BibTeX:

@preprint{HBLR2023,
  arxivid = {2308.04825},
  journal = {arXiv},
  author  = {Hawat, Diala and Bardenet, R{\'{e}}mi and Lachi{\`{e}}ze-Rey, Rapha{\"{e}}l},
  title   = {Repelled point processes with application to numerical integration},
  year    = {2023},
}

About

Sample a repelled point process, compute a Monte Carlo estimation for the integral of a function using various variants of the Monte Carlo method including the Monte Carlo with a repelled point process, and visualize gravitational allocations 2D.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published