Skip to main content

FIGARO: Fast Inference for GW Astronomy, Research & Observations

Project description

FIGARO - Fast Inference for GW Astronomy, Research & Observations

FIGARO is an inference code designed to estimate multivariate probability densities given samples from an unknown distribution using a Dirichlet Process Gaussian Mixture Model (DPGMM) as nonparameteric model. It is also possible to perform hierarchical inferences: in this case, the model used is (H)DPGMM, described in Rinaldi & Del Pozzo (2022a). Differently from other DPGMM implementations relying on variational algorithms, FIGARO does not require the user to specify a priori the maximum allowed number of mixture components. The required number of Gaussian distributions to be included in the mixture is inferred from the data.

An introductive guide on how to use FIGARO can be found in the introductive_guide.ipynb notebook, where it is shown how to to reconstruct a probability density with FIGARO and how to use its products. We strongly encourage the interested user to go through the whole notebook, since it provides a (hopefully detailed) tutorial on how to properly set and use FIGARO.
To learn how to use FIGARO to reconstruct skymaps, have a look at the skymaps.ipynb notebook. In that notebook we show how to obtain the skymaps included in Rinaldi & Del Pozzo (2022b) - please cite this paper if you use FIGARO in your research.

You can install FIGARO by running source install.sh: this script will go through all the necessary steps to install the code. We recommend using one of the following two conda environments:

  • figaro_env is a dedicated environment already containing all the required packages. It is created by the installer if the option -e is provided;
  • igwn-py39, which includes all the required packages apart from ImageIO, is available here .

If you prefer install FIGARO by hand, run python setup.py build_ext --inplace and python setup.py install. In some cases (like on clusters), it may happen that you do not have the permission to write in the default installation directory. In this case, run python setup.py install --user.

If you decide not to use one of the default environments, please remember that in order to have access to all the functions, LALSuite is required. Without LALSuite, the following FIGARO functions won't be available:

  • figaro.load module won't be able to load GW posterior samples and will raise an exception;
  • figaro.threeDvolume.VolumeReconstruction will ignore any provided galaxy catalog. The volume reconstruction will be available.

To install LALSuite, follow the instructions provided here. In most cases, conda install -c conda-forge lalsuite will work. The parallelized scripts use Ray to parallelize. Ray is not included in igwn-py39 nor is automatically installed with FIGARO (but it is included in figaro_env). If you wish to use these scripts, please install Ray via pip install ray and then (re-)install FIGARO to include also the parallelized scripts.

FIGARO comes with several plug-and-play console scripts:

  • figaro-density reconstructs a probability density given a set of samples;
  • figaro-hierarchical reconstructs a probability density given a set of single-event samples, each of them drawn around a sample from the initial probability density;
  • figaro-pp_plot produces the so-called pp-plots for a set of single-event posterior samples to assess the validity of a simulated dataset;
  • figaro-mockdata generates a set of synthetic posterior samples from a given hierarchical distribution;
  • figaro-entropy reconstruct a probability density and provides an estimate of the entropy as a function of the number of samples.

In addition to these, the parallelized version of the inference scripts are available:

  • figaro-par-density, parallelized sampling;
  • figaro-par-hierarchical, parallelized single-event analysis and parallelized sampling.

In order to see the available options, run console_script_name -h.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figaro-1.3.0.tar.gz (281.8 kB view details)

Uploaded Source

File details

Details for the file figaro-1.3.0.tar.gz.

File metadata

  • Download URL: figaro-1.3.0.tar.gz
  • Upload date:
  • Size: 281.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for figaro-1.3.0.tar.gz
Algorithm Hash digest
SHA256 77e22b0af2b0ffbb194ba6d9fa58ac6af76e4684f8b5af7987ff4c6e650f715a
MD5 ef39e624a8fb338cec04f6e7a8aa6be1
BLAKE2b-256 640a9c35e0f712e869fd41384447186ba11ef47e0c8298800b8400afebb792d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page